/* ==========================================================================
   TYPER TEACHER - OPTIMIZED CSS
   Modern CSS Grid Layout - Production Ready
   ========================================================================== */

/* CSS Variables for Themes */
:root {
    /* Ocean Theme (Default) */
    --primary-bg: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --glass-bg: rgba(255, 255, 255, 0.1);
    --glass-border: rgba(255, 255, 255, 0.2);
    --text-primary: #ffffff;
    --text-secondary: rgba(255, 255, 255, 0.8);
    --text-muted: rgba(255, 255, 255, 0.6);
    --accent: #00d4ff;
    --accent-dark: #0056b3;
    --success: #00ff88;
    --error: #ff4757;
    --warning: #ffa502;
    
    /* Typography */
    --font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    --font-mono: 'Consolas', 'Monaco', 'Courier New', monospace;
    
    /* Spacing */
    --gap: 16px;
    --padding: 16px;
    --border-radius: 12px;
    
    /* Sizes */
    --sidebar-width: 240px;
    --header-height: 60px;
    --footer-height: 100px;
}

/* ==========================================================================
   THEME DEFINITIONS
   ========================================================================== */

/* Forest Theme */
.theme-forest {
    --primary-bg: linear-gradient(135deg, #2d5016 0%, #3e7b27 50%, #4a7c59 100%);
    --accent: #7ed321;
    --accent-dark: #5ba61a;
}

/* Space Theme */
.theme-space {
    --primary-bg: linear-gradient(135deg, #0c0c0c 0%, #2d1b69 50%, #11998e 100%);
    --accent: #00ffff;
    --accent-dark: #00cccc;
}

/* AI Theme */
.theme-ai {
    --primary-bg: linear-gradient(135deg, #0a0a0a 0%, #1a1a2e 30%, #16213e 60%, #0f0f23 100%);
    --accent: #00ff88;
    --accent-dark: #00cc6a;
    --text-primary: #00ffff;
    --text-secondary: #80e5ff;
    --text-muted: #4da6c7;
    --glass-bg: rgba(0, 255, 255, 0.08);
    --glass-border: rgba(0, 255, 136, 0.4);
    --card-bg: rgba(0, 0, 0, 0.7);
    --border-color: rgba(0, 255, 136, 0.3);
    --background-color: rgba(10, 10, 10, 0.8);
    --success: #00ff41;
    --error: #ff0080;
    --warning: #ffaa00;
}

/* Candy Theme */
.theme-candy {
    --primary-bg: linear-gradient(135deg, #fc466b 0%, #3f5efb 50%, #fc466b 100%);
    --accent: #ffeaa7;
    --accent-dark: #fdcb6e;
}

/* Neon Tokyo Theme - Claude's Signature Creation */
.theme-neon {
    --primary-bg: linear-gradient(135deg, #0a0a0a 0%, #1a0826 25%, #2d1b69 50%, #0f0f23 75%, #000000 100%);
    --accent: #00d4ff;
    --accent-dark: #0099cc;
    --text-primary: #ffffff;
    --text-secondary: #a0a0ff;
    --glass-bg: rgba(0, 212, 255, 0.1);
    --glass-border: rgba(0, 212, 255, 0.3);
    --card-bg: rgba(13, 13, 35, 0.8);
    --border-color: rgba(0, 212, 255, 0.2);
    --background-color: rgba(10, 10, 26, 0.6);
    --success: #00ff88;
    --error: #ff0080;
    --warning: #ffaa00;
}

/* Retro Theme - 1990s Computer Aesthetic */
.theme-retro {
    --primary-bg: linear-gradient(135deg, #1a1a1a 0%, #2a2a2a 50%, #000000 100%);
    --accent: #00ff00;
    --accent-dark: #00cc00;
    --text-primary: #00ff00;
    --text-secondary: #80ff80;
    --glass-bg: rgba(0, 0, 0, 0.8);
    --glass-border: rgba(0, 255, 0, 0.3);
    --card-bg: rgba(0, 0, 0, 0.6);
    --border-color: rgba(0, 255, 0, 0.2);
    --background-color: rgba(0, 0, 0, 0.4);
    --success: #00ff00;
    --error: #ff0000;
    --warning: #ffff00;
}

/* Matrix Theme */
.theme-matrix {
    --primary-bg: linear-gradient(135deg, #000000 0%, #0d4f3c 50%, #000000 100%);
    --accent: #00ff41;
    --accent-dark: #00cc33;
    --text-primary: #00ff41;
}

/* Cyberpunk Theme */
.theme-cyberpunk {
    --primary-bg: 
        radial-gradient(circle at 20% 30%, rgba(255, 0, 150, 0.2) 0%, transparent 50%),
        radial-gradient(circle at 80% 70%, rgba(0, 255, 255, 0.2) 0%, transparent 50%),
        linear-gradient(135deg, #0a0015 0%, #1a0033 25%, #330066 50%, #1a0033 75%, #0a0015 100%);
    --accent: #ff0099;
    --accent-dark: #cc0077;
    --text-primary: #ffffff;
    --text-secondary: #ff00ff;
    --text-muted: #cc88ff;
    --glass-bg: rgba(51, 0, 102, 0.7);
    --glass-border: rgba(255, 0, 153, 0.5);
    --card-bg: rgba(26, 0, 51, 0.9);
    --border-color: rgba(255, 0, 153, 0.4);
    --background-color: rgba(10, 0, 21, 0.8);
    --success: #00ff99;
    --error: #ff0066;
    --warning: #ffaa00;
}

/* ==========================================================================
   BASE STYLES
   ========================================================================== */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: var(--font-family);
    background: var(--primary-bg);
    color: var(--text-primary);
    overflow-x: hidden;
    min-height: 100vh;
}

/* ==========================================================================
   APP CONTAINER - SINGLE SCREEN LAYOUT
   ========================================================================== */

.app-container {
    height: 100vh;
    display: grid;
    grid-template-rows: var(--header-height) 1fr var(--footer-height);
    grid-template-areas: 
        "header"
        "main"
        "footer";
}

/* ==========================================================================
   HEADER
   ========================================================================== */

.app-header {
    grid-area: header;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 var(--padding);
    background: var(--glass-bg);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--glass-border);
    position: relative;
    z-index: 9998;
}

.brand-container {
    display: flex;
    align-items: center;
    gap: 12px;
}



.keyboard-logo {
    display: flex;
    gap: 4px;
}

.keyboard-logo .key {
    width: 32px;
    height: 32px;
    background: var(--accent);
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    color: #000;
    animation: pulse 2s infinite;
}

.keyboard-logo .key:nth-child(2) {
    animation-delay: 0.5s;
}

@keyframes pulse {
    0%, 100% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.1); opacity: 0.8; }
}

.brand-text {
    font-size: 24px;
    font-weight: bold;
    background: linear-gradient(45deg, var(--accent), var(--text-primary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin: 0;
}

.tagline {
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    font-size: 16px;
    font-weight: 500;
    color: var(--accent);
    letter-spacing: 0.5px;
    opacity: 0.9;
    font-style: italic;
}

/* ==========================================================================
   AUTHENTICATION SECTION - ENHANCED STYLING
   ========================================================================== */

.auth-section {
    display: flex;
    align-items: center;
    padding: 0 16px;
    position: relative;
    z-index: 9999;
}

/* Login Button Styling */
.login-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    background: none;
    backdrop-filter: none;
    border: none;
    border-radius: 0;
    color: var(--accent);
    text-decoration: none;
    font-weight: 600;
    font-size: 14px;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    outline: none;
}

.login-btn:hover {
    background: none;
    color: var(--accent-hover, var(--accent));
    transform: translateY(-1px);
    box-shadow: none;
}

.login-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: none;
    transition: none;
}

.login-btn:hover::before {
    left: 100%;
}

.login-btn i {
    font-size: 16px;
    transition: transform 0.3s ease;
}

.login-btn:hover i {
    transform: translateX(2px);
}

/* User Dropdown Styling */
.user-dropdown {
    position: relative;
    z-index: 9999;
}

.user-btn {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px 16px;
    background: none;
    backdrop-filter: none;
    border: none;
    border-radius: none;
    color: var(--text-primary);
    font-weight: 500;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.3s ease;
    min-width: 140px;
}

.user-btn:hover {
    background: none;
    border-color: none;
    transform: none;
    box-shadow: none;
}



.user-btn span {
    flex: 1;
    text-align: left;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 80px;
}

.user-btn i {
    font-size: 12px;
    transition: transform 0.3s ease;
}

.user-dropdown.active .user-btn i {
    transform: rotate(180deg);
}

/* Dropdown Menu */
.dropdown-menu {
    position: absolute;
    top: 100%;
    right: 0;
    margin-top: 8px;
    background: var(--glass-bg);
    backdrop-filter: blur(20px);
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    padding: 8px 0;
    min-width: 160px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.3s ease;
    z-index: 10000;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

.dropdown-menu.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.dropdown-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 16px;
    color: var(--text-primary);
    text-decoration: none;
    font-size: 14px;
    transition: all 0.2s ease;
}

.dropdown-item:hover {
    background: rgba(255, 255, 255, 0.1);
    color: var(--accent);
}

.dropdown-item i {
    font-size: 14px;
    width: 16px;
    text-align: center;
}

/* ==========================================================================
   MAIN GRID - 3 COLUMN LAYOUT
   ========================================================================== */

.main-grid {
    grid-area: main;
    display: grid;
    grid-template-columns: var(--sidebar-width) 1fr var(--sidebar-width);
    grid-template-areas: "sidebar-left main-content sidebar-right";
    gap: var(--gap);
    padding: var(--padding);
    overflow: hidden;
}

/* ==========================================================================
   SIDEBARS
   ========================================================================== */

.sidebar {
    background: var(--glass-bg);
    backdrop-filter: blur(20px);
    border: 1px solid var(--glass-border);
    border-radius: var(--border-radius);
    padding: var(--padding);
    overflow-y: auto;
}

.sidebar-left {
    grid-area: sidebar-left;
}

.sidebar-right {
    grid-area: sidebar-right;
}

.sidebar-header {
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--glass-border);
}

.sidebar-header h4 {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 8px;
}

/* Live Progress Sidebar */
.live-stats {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.stat-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0;
}

.stat-label {
    font-size: 12px;
    color: var(--text-secondary);
    font-weight: 500;
}

.stat-value {
    font-size: 16px;
    font-weight: bold;
    color: var(--accent);
    font-family: var(--font-mono);
}

.progress-section {
    margin-top: 20px;
    padding-top: 16px;
    border-top: 1px solid var(--glass-border);
}

.progress-section h5 {
    font-size: 14px;
    margin-bottom: 12px;
    color: var(--text-primary);
}

.best-stats {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.best-stat {
    display: flex;
    justify-content: space-between;
    font-size: 12px;
}

.best-label {
    color: var(--text-secondary);
}

.best-value {
    color: var(--accent);
    font-weight: bold;
}

/* Performance Sidebar */
.performance-metrics {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 20px;
}

.metric-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 6px 0;
}

.metric-label {
    font-size: 12px;
    color: var(--text-secondary);
}

.metric-value {
    font-size: 14px;
    font-weight: bold;
    color: var(--accent);
    font-family: var(--font-mono);
}

.chart-container {
    height: 120px;
    margin-top: 16px;
}

.chart-container canvas {
    width: 100% !important;
    height: 100% !important;
}

/* ==========================================================================
   MAIN CONTENT AREA
   ========================================================================== */

.main-content {
    grid-area: main-content;
    display: flex;
    flex-direction: column;
    gap: var(--gap);
    overflow: hidden;
}

/* ==========================================================================
   LESSON TILE (PRESERVED EXACTLY)
   ========================================================================== */

.lesson-tile {
    background: var(--glass-bg);
    backdrop-filter: blur(20px);
    border: 1px solid var(--glass-border);
    border-radius: var(--border-radius);
    overflow: hidden;
    flex-shrink: 0;
}

.lesson-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
    background: rgba(255, 255, 255, 0.05);
    border-bottom: 1px solid var(--glass-border);
    gap: 16px;
}

.lesson-header-right {
    display: flex;
    align-items: center;
    gap: 12px;
}

.lesson-title-row {
    display: flex;
    align-items: center;
    gap: 8px;
}

.current-lesson-text {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
}

.chevron-separator {
    color: var(--text-muted);
    font-size: 12px;
}

.difficulty-badge {
    background: var(--accent);
    color: #000;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: bold;
    text-transform: capitalize;
    border: none;
    cursor: pointer;
    transition: all 0.3s ease;
    user-select: none;
}

.difficulty-badge:hover {
    background: var(--accent-hover, var(--accent));
    transform: translateY(-1px);
}

.accordion-toggle {
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 16px;
    cursor: pointer;
    transition: transform 0.3s ease;
}

.accordion-toggle.active {
    transform: rotate(180deg);
}

.accordion-content {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
}

.accordion-content.active {
    max-height: 350px;
}

.tabs-container {
    padding: 16px;
}

.lesson-header .tabs {
    display: flex;
    flex: 1;
    gap: 0;
    margin-bottom: 0;
}

.tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 16px;
}

.lesson-header .tab-button {
    background: none;
    border: none;
    border-bottom: 2px solid transparent;
    color: var(--text-secondary);
    padding: 8px 16px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 13px;
    border-radius: 0;
    flex: 1;
    text-align: center;
}

.tab-button {
    background: none;
    border: none;
    border-bottom: 2px solid transparent;
    color: var(--text-secondary);
    padding: 8px 16px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 13px;
    border-radius: 0;
}

.tab-button.active {
    color: var(--accent);
    border-bottom-color: var(--accent);
}

.tab-button:hover {
    color: var(--text-primary);
    border-bottom-color: var(--text-primary);
}

.tab-content {
    display: block;
}

.tab-content.hidden {
    display: none;
}

.practice-modes {
    display: flex;
    gap: 8px;
    margin-bottom: 16px;
    justify-content: center;
}

.mode-button {
    background: none;
    border: 1px solid var(--glass-border);
    color: var(--text-secondary);
    padding: 6px 12px;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 12px;
}

.mode-button.active,
.mode-button:hover {
    background: var(--accent);
    color: #000;
    border-color: var(--accent);
}

.subjects-grid {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 8px;
}

.subject-btn {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    color: var(--text-secondary);
    padding: 8px;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 11px;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
}

.subject-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: var(--accent);
}

.subject-btn.active {
    background: var(--accent);
    color: #000;
    border-color: var(--accent);
}

.subject-btn i {
    font-size: 16px;
    filter: grayscale(1);
    transition: filter 0.3s ease;
}

.subject-btn .emoji-icon {
    font-size: 16px;
    display: block;
    margin-bottom: 4px;
}

.subject-btn.active i,
.subject-btn:hover i {
    filter: grayscale(0);
}



/* Profile Tab Styles */
.profile-content {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
}

.stat-card {
    background: rgba(255, 255, 255, 0.05);
    padding: 12px;
    border-radius: 6px;
    text-align: center;
}

.stat-number {
    font-size: 18px;
    font-weight: bold;
    color: var(--accent);
    margin-bottom: 4px;
}

.stat-label {
    font-size: 11px;
    color: var(--text-secondary);
}

.achievements-section h5 {
    font-size: 14px;
    margin-bottom: 8px;
}

.achievements-list {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.achievement-badge {
    background: var(--success);
    color: #000;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 10px;
    font-weight: bold;
}

/* Performance Chart Section */
.performance-chart {
    margin-top: 16px;
    padding: 16px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 6px;
}

.performance-chart h5 {
    font-size: 14px;
    margin-bottom: 12px;
    color: var(--text-primary);
}

.chart-container {
    position: relative;
    height: 150px;
}

.guest-profile {
    text-align: center;
    padding: 20px 0;
}

.guest-profile h5 {
    margin-bottom: 12px;
    color: var(--text-primary);
}

.guest-profile p {
    margin-bottom: 16px;
    color: var(--text-secondary);
    font-size: 13px;
}

.btn {
    background: var(--accent);
    color: #000;
    border: none;
    padding: 8px 16px;
    border-radius: 6px;
    cursor: pointer;
    font-weight: bold;
    text-decoration: none;
    display: inline-block;
    transition: all 0.3s ease;
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

/* Enhanced Sidebar Styles */

/* Left Sidebar Enhancements */
.achievements-preview, .session-summary, .typing-tips {
    margin-top: 20px;
    padding: 15px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.achievements-preview h6, .session-summary h6, .typing-tips h6 {
    margin: 0 0 10px 0;
    font-size: 12px;
    color: var(--text-primary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.achievements-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
}

.achievement-mini {
    background: var(--accent);
    color: #000;
    padding: 2px 6px;
    border-radius: 3px;
    font-size: 9px;
    font-weight: bold;
}

.recent-sessions {
    max-height: 120px;
    overflow-y: auto;
}

.session-mini {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 6px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    font-size: 11px;
}

.session-mini:last-child {
    border-bottom: none;
}

.session-date {
    color: var(--text-secondary);
}

.session-wpm {
    color: var(--accent);
    font-weight: bold;
}

.tip-card {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 6px;
    border-left: 3px solid var(--accent);
}

.tip-icon {
    font-size: 16px;
}

.tip-text {
    font-size: 11px;
    color: var(--text-secondary);
    line-height: 1.4;
}

.guest-encouragement {
    margin-top: 20px;
    padding: 20px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    text-align: center;
}

.guest-encouragement h5 {
    margin: 0 0 10px 0;
    color: var(--text-primary);
    font-size: 14px;
}

.guest-encouragement p {
    margin: 0 0 15px 0;
    color: var(--text-secondary);
    font-size: 12px;
    line-height: 1.4;
}

.sign-in-btn {
    background: var(--accent);
    color: #000;
    padding: 8px 16px;
    border-radius: 6px;
    text-decoration: none;
    font-size: 12px;
    font-weight: bold;
    transition: all 0.3s ease;
}

.sign-in-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 3px 8px rgba(0, 0, 0, 0.3);
}

/* Right Sidebar Enhancements */
.typing-analysis {
    margin-top: 20px;
    padding: 15px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.typing-analysis h5 {
    margin: 0 0 12px 0;
    font-size: 13px;
    color: var(--text-primary);
}

.analysis-metrics {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.analysis-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 6px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.analysis-item:last-child {
    border-bottom: none;
}

.analysis-label {
    font-size: 11px;
    color: var(--text-secondary);
}

.analysis-value {
    font-size: 11px;
    color: var(--accent);
    font-weight: bold;
}



/* ==========================================================================
   TYPING WINDOW
   ========================================================================== */

.typing-window {
    background: var(--glass-bg);
    backdrop-filter: blur(20px);
    border: 1px solid var(--glass-border);
    border-radius: var(--border-radius);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    flex: 1;
    min-height: 200px;
}

.typing-display {
    padding: 20px;
    flex: 1.5;
    overflow-y: auto;
    background: rgba(0, 0, 0, 0.2);
}

.text-to-type {
    font-family: var(--font-mono);
    font-size: 18px;
    line-height: 1.8;
    color: var(--text-secondary);
    word-break: normal;
    overflow-wrap: break-word;
    white-space: normal;
    hyphens: none;
    user-select: none;
    /* iOS Safari optimization */
    -webkit-text-size-adjust: 100%;
    -webkit-font-smoothing: antialiased;
}

.text-to-type .char {
    position: relative;
}

.text-to-type .char.correct {
    color: var(--success);
    background: rgba(0, 255, 136, 0.2);
}

.text-to-type .char.incorrect {
    color: var(--error);
    background: rgba(255, 71, 87, 0.2);
}

.text-to-type .char.current {
    background: var(--accent);
    color: #000;
    animation: blink 1s infinite;
}

@keyframes blink {
    0%, 50% { opacity: 1; }
    51%, 100% { opacity: 0.5; }
}

.typing-input-container {
    padding: 16px;
    border-top: 1px solid var(--glass-border);
    flex: 1;
    display: flex;
    flex-direction: column;
}

.typing-input {
    width: 100%;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid var(--glass-border);
    border-radius: 6px;
    padding: 12px;
    color: var(--text-primary);
    font-family: var(--font-mono);
    font-size: 16px;
    resize: none;
    outline: none;
    min-height: 120px;
    flex: 1;
}

.typing-input:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 2px rgba(0, 212, 255, 0.2);
}

/* ==========================================================================
   FOOTER - AD PLACEHOLDERS
   ========================================================================== */

.ad-footer {
    grid-area: footer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 var(--padding);
    gap: var(--gap);
}

.ad-placeholder {
    background: var(--glass-bg);
    backdrop-filter: blur(20px);
    border: 1px solid var(--glass-border);
    border-radius: var(--border-radius);
    width: 300px;
    height: 80px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.ad-content {
    text-align: center;
    color: var(--text-muted);
    opacity: 0.6;
}

.ad-content i {
    display: block;
    font-size: 20px;
    margin-bottom: 4px;
}

.ad-content span {
    display: block;
    font-size: 11px;
    margin-bottom: 2px;
}

.ad-content small {
    font-size: 9px;
    font-family: var(--font-mono);
}

.nav-tile {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
    width: 100%;
}

.nav-tile-link {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 6px;
    text-decoration: none;
    color: var(--text-muted);
    transition: all 0.3s ease;
    padding: 16px;
    border-radius: 8px;
    width: 100%;
    height: 100%;
}

.nav-tile-link:hover {
    color: var(--accent);
    background: rgba(0, 212, 255, 0.1);
    transform: translateY(-2px);
}

.nav-tile-link i {
    font-size: 24px;
    margin-bottom: 4px;
    transition: all 0.3s ease;
}

.nav-tile-link:hover i {
    color: var(--accent);
    transform: scale(1.1);
}

.nav-tile-link span {
    font-size: 11px;
    font-weight: 600;
    text-align: center;
    white-space: nowrap;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.achievement-mini-bottom .achievement-desc {
    font-size: 9px;
    color: var(--text-secondary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.contact-email:hover {
    color: var(--text-primary);
    background: var(--accent);
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(0, 212, 255, 0.3);
}

/* ==========================================================================
   THEME SWITCHER
   ========================================================================== */



.theme-switcher {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    flex-direction: row;
    gap: 8px;
    z-index: 100;
}

.theme-btn {
    width: 40px;
    height: 40px;
    border: 2px solid var(--glass-border);
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 10px;
    color: var(--text-primary);
    background: var(--glass-bg);
    backdrop-filter: blur(10px);
}

.theme-btn:hover {
    transform: scale(1.1);
    border-color: var(--accent);
}

.theme-btn.active {
    border-color: var(--accent);
    background: var(--accent);
    color: #000;
}



/* Header actions layout */
.header-actions {
    display: flex;
    align-items: center;
    gap: 10px;
}

/* ==========================================================================
   RESPONSIVE DESIGN
   ========================================================================== */

@media (max-width: 1200px) {
    :root {
        --sidebar-width: 200px;
        --gap: 12px;
        --padding: 12px;
    }
    
    .subjects-grid {
        grid-template-columns: repeat(5, 1fr);
    }
}

@media (max-width: 900px), (max-device-width: 900px) {
    /* Remove footer from grid layout on mobile */
    .app-container {
        grid-template-rows: var(--header-height) 1fr;
        grid-template-areas: 
            "header"
            "main";
    }
    
    .main-grid {
        grid-template-columns: 1fr;
        grid-template-areas: 
            "main-content";
    }
    
    /* Hide sidebars on mobile for better typing experience */
    .sidebar-left,
    .sidebar-right {
        display: none;
    }
    
    /* Hide ad placeholders and contact info on mobile */
    .ad-footer,
    .ad-placeholder {
        display: none;
    }
    
    /* Hide tagline on mobile for cleaner navbar */
    .tagline {
        display: none;
    }
    
    /* Show floating theme buttons at bottom on mobile */
    .theme-switcher {
        display: flex !important;
        position: fixed !important;
        bottom: 10px !important;
        left: 50% !important;
        transform: translateX(-50%) !important;
        flex-direction: row !important;
        gap: 8px !important;
        z-index: 1000 !important;
        background: none !important;
        backdrop-filter: none !important;
        border: none !important;
        border-radius: 0 !important;
        padding: 0 !important;
        box-shadow: none !important;
    }
    
    /* Mobile accordion optimization - controlled height with better scrolling */
    .accordion-content.active {
        max-height: 500px !important;
        overflow-y: auto !important;
        -webkit-overflow-scrolling: touch !important;
        padding-bottom: 20px !important;
        /* Fix bounce by ensuring content doesn't extend beyond container */
        box-sizing: border-box !important;
    }
    
    /* Mobile optimization - vertical stacking for subjects */
    .subjects-grid {
        display: grid !important;
        grid-template-columns: repeat(3, 1fr) !important;
        gap: 8px !important;
        padding: 8px 4px 30px 4px !important;
        overflow-x: hidden !important;
        /* Ensure proper height calculation to prevent bounce */
        max-height: calc(100% - 30px) !important;
    }
    
    /* iOS Safari scrollbar styling for accordion */
    .accordion-content.active::-webkit-scrollbar {
        width: 4px;
    }
    
    .accordion-content.active::-webkit-scrollbar-track {
        background: transparent;
    }
    
    .accordion-content.active::-webkit-scrollbar-thumb {
        background: var(--accent);
        border-radius: 2px;
        opacity: 0.7;
    }
    
    .accordion-content.active::-webkit-scrollbar-thumb:hover {
        background: var(--accent-dark);
    }
    
    .subject-btn {
        background: var(--glass-bg);
        border: 1px solid var(--glass-border);
        color: var(--text-secondary);
        padding: 12px 8px;
        border-radius: 8px;
        cursor: pointer;
        transition: all 0.3s ease;
        font-size: 10px;
        text-align: center;
        display: flex;
        flex-direction: column;
        align-items: center;
        gap: 4px;
        min-height: 65px;
        width: 100%;
        font-weight: 500;
        white-space: normal;
        word-wrap: break-word;
    }
    
    .subject-btn:hover {
        background: rgba(255, 255, 255, 0.1);
        border-color: var(--accent);
    }
    
    .subject-btn.active {
        background: var(--accent);
        color: #000;
        border-color: var(--accent);
        font-weight: 600;
    }
    
    .subject-btn i {
        font-size: 14px;
        filter: grayscale(1);
        transition: filter 0.3s ease;
    }
    
    .subject-btn:hover i,
    .subject-btn.active i {
        filter: grayscale(0);
    }
}

@media (max-width: 600px) {
    .subjects-grid {
        grid-template-columns: repeat(3, 1fr);
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
    }
    
    .theme-btn {
        width: 28px !important;
        height: 28px !important;
        font-size: 8px !important;
        border-radius: 50% !important;
        border: none !important;
        background: var(--glass-bg) !important;
        backdrop-filter: blur(10px) !important;
        transition: all 0.3s ease !important;
        cursor: pointer !important;
        box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3) !important;
    }
    
    .theme-btn:hover {
        transform: scale(1.1) !important;
        box-shadow: 0 4px 15px rgba(0, 0, 0, 0.5) !important;
    }
    
    .theme-btn.active {
        background: var(--accent) !important;
        color: #000 !important;
        box-shadow: 0 4px 15px rgba(0, 0, 0, 0.5) !important;
    }
    
    /* Enhanced mobile subject buttons for smaller screens */
    .subjects-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 6px;
        padding: 6px 2px 10px 2px;
    }
    
    /* Ensure accordion content has proper scrolling on very small screens */
    .accordion-content.active {
        max-height: 450px !important;
        padding-bottom: 25px !important;
    }
    
    .subject-btn {
        padding: 10px 6px;
        font-size: 9px;
        min-height: 60px;
        width: 100%;
        border-radius: 8px;
    }
    
    .subject-btn i {
        font-size: 16px;
    }
    
    /* Enhanced mobile typing experience */
    .main-content {
        padding: 8px;
    }
}

/* ==========================================================================
   UTILITY CLASSES
   ========================================================================== */

.hidden {
    display: none !important;
}

.text-center {
    text-align: center;
}

.mt-2 {
    margin-top: 16px;
}

.mb-2 {
    margin-bottom: 16px;
}

/* ==========================================================================
   SCROLLBAR STYLING
   ========================================================================== */

::-webkit-scrollbar {
    width: 6px;
}

::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 3px;
}

::-webkit-scrollbar-thumb {
    background: var(--accent);
    border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--text-primary);
}

/* ==========================================================================
   BOTTOM BAR STYLING
   ========================================================================== */

.bottom-bar {
    flex: 1;
    height: 2px;
    background: linear-gradient(90deg, 
        transparent 0%, 
        var(--accent) 20%, 
        var(--accent) 80%, 
        transparent 100%);
    align-self: center;
    margin: 0 20px;
}

/* ==========================================================================
   COOKIE CONSENT BANNER - CYBERPUNK THEME
   ========================================================================== */

.cookie-consent-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(10px);
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.5s ease-out;
}

.cookie-consent-container {
    background: linear-gradient(135deg, 
        rgba(23, 23, 23, 0.95) 0%, 
        rgba(45, 45, 45, 0.95) 50%, 
        rgba(23, 23, 23, 0.95) 100%);
    border: 2px solid var(--accent);
    border-radius: 16px;
    max-width: 500px;
    width: 90%;
    padding: 24px;
    box-shadow: 
        0 0 40px rgba(0, 212, 255, 0.3),
        0 0 80px rgba(0, 212, 255, 0.1),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);
    position: relative;
    overflow: hidden;
    animation: slideUp 0.5s ease-out;
}

.cookie-consent-container::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, 
        transparent 0%, 
        rgba(0, 212, 255, 0.1) 50%, 
        transparent 100%);
    animation: scanLine 3s infinite;
}

.cookie-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
}

.cookie-icon {
    font-size: 24px;
    animation: pulse 2s infinite;
}

.cookie-header h3 {
    color: var(--accent);
    font-size: 20px;
    font-weight: 600;
    margin: 0;
    text-shadow: 0 0 10px rgba(0, 212, 255, 0.5);
}

.cookie-content {
    margin-bottom: 20px;
}

.cookie-content p {
    color: var(--text-primary);
    font-size: 14px;
    line-height: 1.5;
    margin-bottom: 12px;
}

.cookie-details {
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(0, 212, 255, 0.2);
    border-radius: 8px;
    padding: 12px;
    margin-bottom: 16px;
}

.cookie-category {
    color: var(--text-secondary);
    font-size: 12px;
    margin-bottom: 4px;
}

.cookie-category strong {
    color: var(--accent);
}

.cookie-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    justify-content: center;
    margin-bottom: 16px;
}

.cookie-btn {
    padding: 10px 16px;
    border: 1px solid var(--accent);
    border-radius: 6px;
    background: rgba(0, 212, 255, 0.1);
    color: var(--text-primary);
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    min-width: 100px;
}

.cookie-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, 
        transparent 0%, 
        rgba(0, 212, 255, 0.3) 50%, 
        transparent 100%);
    transition: left 0.5s ease;
}

.cookie-btn:hover {
    background: rgba(0, 212, 255, 0.2);
    box-shadow: 0 0 20px rgba(0, 212, 255, 0.3);
    transform: translateY(-1px);
}

.cookie-btn:hover::before {
    left: 100%;
}

.cookie-accept {
    background: linear-gradient(135deg, rgba(0, 255, 136, 0.2), rgba(0, 212, 255, 0.2));
    border-color: var(--success);
}

.cookie-accept:hover {
    background: linear-gradient(135deg, rgba(0, 255, 136, 0.3), rgba(0, 212, 255, 0.3));
    box-shadow: 0 0 20px rgba(0, 255, 136, 0.3);
}

.cookie-essential {
    background: linear-gradient(135deg, rgba(255, 165, 2, 0.2), rgba(0, 212, 255, 0.2));
    border-color: var(--warning);
}

.cookie-essential:hover {
    background: linear-gradient(135deg, rgba(255, 165, 2, 0.3), rgba(0, 212, 255, 0.3));
    box-shadow: 0 0 20px rgba(255, 165, 2, 0.3);
}

.cookie-decline {
    background: linear-gradient(135deg, rgba(255, 71, 87, 0.2), rgba(0, 212, 255, 0.2));
    border-color: var(--error);
}

.cookie-decline:hover {
    background: linear-gradient(135deg, rgba(255, 71, 87, 0.3), rgba(0, 212, 255, 0.3));
    box-shadow: 0 0 20px rgba(255, 71, 87, 0.3);
}

.cookie-footer {
    text-align: center;
    font-size: 11px;
    color: var(--text-muted);
}

.cookie-link {
    color: var(--accent);
    text-decoration: none;
    transition: all 0.3s ease;
}

.cookie-link:hover {
    color: var(--text-primary);
    text-shadow: 0 0 8px rgba(0, 212, 255, 0.5);
}

/* Animations */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(30px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

@keyframes scanLine {
    0% { left: -100%; }
    50% { left: 100%; }
    100% { left: 100%; }
}

@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.1); }
}

/* Mobile Responsiveness */
@media (max-width: 600px) {
    .cookie-consent-container {
        margin: 16px;
        padding: 20px;
    }
    
    .cookie-actions {
        flex-direction: column;
    }
    
    .cookie-btn {
        width: 100%;
        margin-bottom: 8px;
    }
}

