/* Premium Dark Theme for SpeedWPM - Ultra Smooth & Focused */

:root {
    /* Premium Dark Color Palette */
    --bg-primary: #0a0a0f;
    --bg-secondary: #12121a;
    --bg-tertiary: #1a1a26;
    --bg-glass: rgba(20, 20, 32, 0.8);
    
    /* Text Colors */
    --text-primary: #e8e8f0;
    --text-secondary: #a8a8b8;
    --text-tertiary: #7a7a88;
    --text-accent: #ffffff;
    
    /* Accent Colors */
    --accent-primary: #6366f1; /* Indigo */
    --accent-secondary: #8b5cf6; /* Purple */
    --accent-tertiary: #06b6d4; /* Cyan */
    --accent-gradient: linear-gradient(135deg, #6366f1, #8b5cf6);
    
    /* State Colors */
    --success: #10b981;
    --success-glow: rgba(16, 185, 129, 0.3);
    --error: #ef4444;
    --error-glow: rgba(239, 68, 68, 0.3);
    --warning: #f59e0b;
    --warning-glow: rgba(245, 158, 11, 0.3);
    --current: #6366f1;
    --current-glow: rgba(99, 102, 241, 0.4);
    
    /* Interactive Elements */
    --border-subtle: rgba(255, 255, 255, 0.05);
    --border-medium: rgba(255, 255, 255, 0.1);
    --border-strong: rgba(255, 255, 255, 0.2);
    --hover-overlay: rgba(255, 255, 255, 0.05);
    --active-overlay: rgba(255, 255, 255, 0.1);
    
    /* Shadows & Glows */
    --shadow-small: 0 2px 8px rgba(0, 0, 0, 0.3);
    --shadow-medium: 0 8px 32px rgba(0, 0, 0, 0.4);
    --shadow-large: 0 24px 64px rgba(0, 0, 0, 0.5);
    --glow-subtle: 0 0 20px rgba(99, 102, 241, 0.2);
    --glow-medium: 0 0 40px rgba(99, 102, 241, 0.3);
    --glow-strong: 0 0 60px rgba(99, 102, 241, 0.4);
    
    /* Typography */
    --font-primary: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --font-mono: 'JetBrains Mono', 'Fira Code', 'SF Mono', 'Monaco', 'Cascadia Code', monospace;
    
    /* Animation Timings */
    --transition-fast: 0.15s ease-out;
    --transition-medium: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-slow: 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-spring: 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

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

html {
    scroll-behavior: smooth;
}

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

/* Premium Background with Animated Gradients */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: 
        radial-gradient(circle at 20% 30%, rgba(99, 102, 241, 0.15) 0%, transparent 50%),
        radial-gradient(circle at 80% 70%, rgba(139, 92, 246, 0.12) 0%, transparent 50%),
        radial-gradient(circle at 40% 80%, rgba(6, 182, 212, 0.08) 0%, transparent 50%);
    pointer-events: none;
    z-index: -2;
    animation: gradientShift 20s ease-in-out infinite;
}

body.adaptive-mode::before {
    animation-duration: 15s;
    background: 
        radial-gradient(circle at 25% 25%, rgba(99, 102, 241, 0.2) 0%, transparent 50%),
        radial-gradient(circle at 75% 75%, rgba(139, 92, 246, 0.18) 0%, transparent 50%),
        radial-gradient(circle at 50% 50%, rgba(16, 185, 129, 0.1) 0%, transparent 60%);
}

@keyframes gradientShift {
    0%, 100% { opacity: 1; transform: scale(1) rotate(0deg); }
    33% { opacity: 0.8; transform: scale(1.1) rotate(120deg); }
    66% { opacity: 0.9; transform: scale(0.95) rotate(240deg); }
}

/* Grain Texture Overlay */
body::after {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image: 
        radial-gradient(circle at 25% 25%, rgba(255, 255, 255, 0.02) 1px, transparent 1px),
        radial-gradient(circle at 75% 75%, rgba(255, 255, 255, 0.015) 1px, transparent 1px);
    background-size: 20px 20px, 30px 30px;
    pointer-events: none;
    z-index: -1;
    opacity: 0.6;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 3rem 2rem;
    position: relative;
    z-index: 1;
}

/* Header - Ultra Clean & Focused */
header {
    text-align: center;
    margin-bottom: 4rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2rem;
    position: relative;
}

header h1 {
    font-size: clamp(2.5rem, 5vw, 4rem);
    font-weight: 200;
    letter-spacing: -0.02em;
    background: var(--accent-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    position: relative;
    line-height: 1.1;
    margin-bottom: 0.5rem;
}

header h1::after {
    content: '';
    position: absolute;
    bottom: -10px;
    left: 50%;
    transform: translateX(-50%);
    width: 60px;
    height: 2px;
    background: var(--accent-gradient);
    border-radius: 1px;
    opacity: 0.5;
}

.header-subtitle {
    font-size: 1.1rem;
    color: var(--text-secondary);
    font-weight: 400;
    margin-bottom: 1rem;
    text-align: center;
    opacity: 0.8;
}

.header-controls {
    display: flex;
    gap: 1.5rem;
    align-items: center;
    flex-wrap: wrap;
    justify-content: center;
    padding: 1rem 2rem;
    background: var(--bg-glass);
    backdrop-filter: blur(20px);
    border-radius: 16px;
    border: 1px solid var(--border-subtle);
    box-shadow: var(--shadow-medium);
}

.header-controls select {
    background: var(--bg-secondary);
    color: var(--text-primary);
    border: 1px solid var(--border-medium);
    padding: 0.75rem 1.25rem;
    border-radius: 12px;
    font-size: 0.9rem;
    font-family: var(--font-primary);
    cursor: pointer;
    transition: var(--transition-medium);
    min-width: 140px;
}

.header-controls select:hover {
    border-color: var(--accent-primary);
    background: var(--bg-tertiary);
    box-shadow: var(--glow-subtle);
}

.header-controls select:focus {
    outline: none;
    border-color: var(--accent-primary);
    box-shadow: var(--glow-medium);
}

/* Stats Display - Refined & Elegant */
.stats-display {
    margin-bottom: 3rem;
    opacity: 0.8;
    transition: var(--transition-medium);
}

.stats-display.active {
    opacity: 1;
}

.stat-group {
    display: flex;
    justify-content: center;
    gap: 4rem;
    padding: 2rem;
    background: var(--bg-glass);
    backdrop-filter: blur(20px);
    border-radius: 20px;
    border: 1px solid var(--border-subtle);
    box-shadow: var(--shadow-small);
}

.stat-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
}

.stat-value {
    font-size: 2.5rem;
    font-weight: 300;
    font-variant-numeric: tabular-nums;
    background: var(--accent-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 0.5rem;
    transition: var(--transition-medium);
}

.stat-label {
    font-size: 0.85rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    font-weight: 500;
    letter-spacing: 0.1em;
}

/* Text Display - The Heart of the Experience */
.text-display {
    font-family: var(--font-mono);
    font-size: clamp(1.25rem, 2.5vw, 1.75rem);
    line-height: 1.8;
    padding: 3rem;
    margin: 3rem 0;
    background: var(--bg-glass);
    backdrop-filter: blur(30px);
    border-radius: 24px;
    min-height: 200px;
    max-height: 280px;
    overflow-y: auto;
    overflow-x: hidden;
    text-align: left;
    font-weight: 400;
    letter-spacing: 0.02em;
    border: 1px solid var(--border-subtle);
    transition: var(--transition-medium);
    display: block;
    position: relative;
    box-shadow: var(--shadow-medium);
    word-wrap: break-word;
    hyphens: auto;
}

.text-display:focus-within {
    border-color: var(--accent-primary);
    box-shadow: var(--glow-medium);
}

.text-display .text-content {
    transition: var(--transition-slow);
    display: block;
    white-space: pre-wrap;
    word-break: break-word;
    word-wrap: break-word;
    overflow-wrap: break-word;
    position: relative;
    width: 100%;
    line-height: inherit;
}

/* Character States - Ultra Refined */
.char {
    position: relative;
    transition: var(--transition-fast);
    border-radius: 4px;
    padding: 3px 1px;
    margin: 0 1px;
    display: inline-block;
    line-height: 1.6;
    vertical-align: baseline;
}

.char.correct {
    color: var(--success);
    background: rgba(16, 185, 129, 0.1);
    box-shadow: 0 0 8px var(--success-glow);
}

.char.incorrect {
    color: var(--error);
    background: rgba(239, 68, 68, 0.15);
    box-shadow: 0 0 12px var(--error-glow);
    animation: errorPulse 0.4s ease-out;
}

.char.current {
    background: var(--accent-primary);
    color: var(--text-accent);
    box-shadow: 0 0 20px var(--current-glow);
    animation: currentPulse 1.5s ease-in-out infinite;
    transform: scale(1.05);
    font-weight: 600;
    z-index: 10;
    position: relative;
}

.char.next {
    background: rgba(99, 102, 241, 0.1);
    color: var(--accent-primary);
    border: 1px solid rgba(99, 102, 241, 0.2);
    animation: nextBreathe 2s ease-in-out infinite;
}

@keyframes currentPulse {
    0%, 100% { 
        box-shadow: 0 0 20px var(--current-glow);
        transform: scale(1.05);
    }
    50% { 
        box-shadow: 0 0 30px var(--current-glow);
        transform: scale(1.08);
    }
}

@keyframes nextBreathe {
    0%, 100% { opacity: 0.6; }
    50% { opacity: 1; }
}

@keyframes errorPulse {
    0% { transform: scale(1); }
    25% { transform: scale(1.1) translateX(-1px); }
    75% { transform: scale(1.1) translateX(1px); }
    100% { transform: scale(1); }
}

/* Input Area - Hidden but Accessible */
.input-area {
    margin-bottom: 3rem;
}

#typing-input {
    width: 100%;
    height: 1px;
    opacity: 0;
    position: absolute;
    z-index: -1;
}

/* Controls - Clean & Professional */
.controls {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2rem;
    margin-bottom: 3rem;
}

.difficulty-selector {
    display: flex;
    justify-content: center;
}

.difficulty-selector select {
    background: var(--bg-secondary);
    color: var(--text-primary);
    border: 1px solid var(--border-medium);
    border-radius: 12px;
    padding: 0.75rem 1.25rem;
    font-size: 0.95rem;
    font-family: var(--font-primary);
    cursor: pointer;
    transition: var(--transition-medium);
    min-width: 160px;
}

.difficulty-selector select:hover,
.difficulty-selector select:focus {
    outline: none;
    border-color: var(--accent-primary);
    box-shadow: var(--glow-subtle);
}

.action-buttons {
    display: flex;
    gap: 1.5rem;
}

.btn {
    padding: 1rem 2rem;
    border: 1px solid var(--border-medium);
    border-radius: 12px;
    background: var(--bg-secondary);
    color: var(--text-primary);
    font-family: var(--font-primary);
    font-size: 0.95rem;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition-medium);
    text-transform: capitalize;
    min-width: 120px;
    position: relative;
    overflow: hidden;
}

.btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.1), transparent);
    transition: var(--transition-medium);
}

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

.btn.primary {
    background: var(--accent-gradient);
    border-color: var(--accent-primary);
    color: var(--text-accent);
    box-shadow: var(--glow-subtle);
}

.btn:hover {
    background: var(--bg-tertiary);
    border-color: var(--accent-primary);
    box-shadow: var(--glow-subtle);
    transform: translateY(-1px);
}

.btn.primary:hover {
    box-shadow: var(--glow-medium);
    transform: translateY(-2px);
}

.btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
    transform: none;
}

/* Keyboard Hints - Subtle & Helpful */
.keyboard-hints {
    display: flex;
    gap: 3rem;
    justify-content: center;
    margin-top: 1rem;
}

.hint {
    font-size: 0.8rem;
    color: var(--text-tertiary);
    opacity: 0.7;
    font-weight: 400;
    text-transform: lowercase;
    transition: var(--transition-medium);
}

.hint:hover {
    opacity: 1;
    color: var(--text-secondary);
}

/* Results - Elegant & Comprehensive */
.results {
    text-align: center;
    margin: 3rem 0;
    padding: 3rem;
    background: var(--bg-glass);
    backdrop-filter: blur(30px);
    border-radius: 24px;
    border: 1px solid var(--border-subtle);
    box-shadow: var(--shadow-large);
    animation: resultsAppear 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

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

.results-summary {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2.5rem;
}

.main-result {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.result-value {
    font-size: clamp(3rem, 8vw, 5rem);
    font-weight: 200;
    background: var(--accent-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    font-variant-numeric: tabular-nums;
    margin-bottom: 0.5rem;
    text-shadow: var(--glow-subtle);
}

.result-label {
    font-size: 1.1rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.1em;
    font-weight: 500;
}

.secondary-results {
    display: flex;
    gap: 4rem;
    flex-wrap: wrap;
    justify-content: center;
}

.result-detail {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 1.5rem;
    background: var(--bg-secondary);
    border-radius: 16px;
    border: 1px solid var(--border-subtle);
    min-width: 120px;
}

.result-detail span {
    font-size: 1.8rem;
    font-weight: 400;
    color: var(--text-primary);
    font-variant-numeric: tabular-nums;
    margin-bottom: 0.5rem;
}

.result-detail small {
    font-size: 0.8rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.1em;
    font-weight: 500;
}

/* Footer - Minimal & Clean */
/* SEO Content Section */
.seo-content {
    margin-top: 4rem;
    padding-top: 3rem;
    border-top: 1px solid var(--border-subtle);
}

.seo-content h2 {
    color: var(--accent-primary);
    font-size: 1.8rem;
    font-weight: 400;
    margin-bottom: 1.5rem;
    text-align: center;
}

.seo-content h3 {
    color: var(--text-primary);
    font-size: 1.3rem;
    font-weight: 500;
    margin: 2rem 0 1rem 0;
}

.seo-content p {
    line-height: 1.7;
    margin-bottom: 1.5rem;
    color: var(--text-primary);
}

.seo-content ul,
.seo-content ol {
    margin: 1rem 0 1.5rem 2rem;
    color: var(--text-primary);
}

.seo-content li {
    margin-bottom: 0.75rem;
    line-height: 1.6;
}

.seo-content strong {
    color: var(--accent-primary);
    font-weight: 600;
}

/* Footer */
footer {
    color: var(--text-tertiary);
    font-size: 0.9rem;
    margin-top: 3rem;
    padding: 3rem 2rem 2rem;
    border-top: 1px solid var(--border-subtle);
    background: var(--bg-secondary);
}

.footer-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 2rem;
    margin-bottom: 2rem;
}

.footer-section h4 {
    color: var(--accent-primary);
    font-size: 1.1rem;
    font-weight: 500;
    margin-bottom: 1rem;
}

.footer-section p {
    line-height: 1.6;
    color: var(--text-secondary);
}

.footer-branding {
    text-align: center;
    padding-top: 2rem;
    border-top: 1px solid var(--border-subtle);
}

.footer-branding p {
    font-size: 0.85rem;
    opacity: 0.8;
    margin-bottom: 0.5rem;
}

.footer-branding p:last-child {
    font-size: 0.75rem;
    opacity: 0.6;
}

/* Enhanced Mode Styles */
body.adaptive-mode .text-display {
    box-shadow: var(--glow-medium);
    border-color: rgba(99, 102, 241, 0.3);
}

body.adaptive-mode .stat-value {
    text-shadow: var(--glow-subtle);
}

/* Smooth Scrolling for Text Display */
.text-display::-webkit-scrollbar {
    width: 6px;
}

.text-display::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.1);
    border-radius: 3px;
}

.text-display::-webkit-scrollbar-thumb {
    background: var(--accent-primary);
    border-radius: 3px;
    opacity: 0.7;
}

.text-display::-webkit-scrollbar-thumb:hover {
    opacity: 1;
}

/* Text Content Positioning */
.text-display .text-content {
    padding-bottom: 1rem;
}

/* Better spacing for readability */
.text-display .char + .char {
    /* Add slight spacing between characters for better readability */
}

/* Word separation */
.char[data-char=" "] + .char {
    margin-left: 0.15em;
}

/* Prevent text selection on completed characters */
.char.correct,
.char.incorrect {
    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
}

/* Responsive Design - Mobile First */
@media (max-width: 768px) {
    .container {
        padding: 2rem 1rem;
    }
    
    header {
        margin-bottom: 3rem;
        gap: 1.5rem;
    }
    
    .header-controls {
        flex-direction: column;
        gap: 1rem;
        padding: 1.5rem;
    }
    
    .stat-group {
        gap: 2rem;
        padding: 1.5rem;
        flex-wrap: wrap;
    }
    
    .text-display {
        font-size: clamp(1.1rem, 4vw, 1.3rem);
        padding: 2rem 1.5rem;
        margin: 2rem 0;
        min-height: 160px;
        max-height: 240px;
        line-height: 1.7;
    }
    
    .char {
        padding: 2px 0.5px;
        margin: 0 0.5px;
        line-height: 1.5;
    }
    
    .controls {
        gap: 1.5rem;
    }
    
    .action-buttons {
        flex-direction: column;
        gap: 1rem;
        width: 100%;
        max-width: 300px;
    }
    
    .btn {
        width: 100%;
    }
    
    .secondary-results {
        flex-direction: column;
        gap: 1.5rem;
        align-items: center;
    }
    
    .result-detail {
        min-width: 200px;
    }
    
    .keyboard-hints {
        flex-wrap: wrap;
        gap: 1.5rem;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 1.5rem 1rem;
    }
    
    .stat-group {
        flex-direction: column;
        gap: 1rem;
        text-align: center;
    }
    
    .stat-value {
        font-size: 2rem;
    }
    
    .text-display {
        font-size: clamp(1rem, 5vw, 1.2rem);
        padding: 1.5rem 1rem;
        margin: 1.5rem 0;
        min-height: 140px;
        max-height: 200px;
        line-height: 1.6;
        border-radius: 16px;
    }
    
    .char {
        padding: 1px 0.3px;
        margin: 0 0.3px;
        line-height: 1.4;
        border-radius: 3px;
    }
    
    .result-value {
        font-size: 2.5rem;
    }
    
    .keyboard-hints {
        gap: 1rem;
        flex-direction: column;
        align-items: center;
    }
    
    .hint {
        font-size: 0.75rem;
    }
}

/* High DPI & Retina Support */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
    .text-display {
        -webkit-font-smoothing: antialiased;
        -moz-osx-font-smoothing: grayscale;
    }
}

/* Accessibility Improvements */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
    
    body::before {
        animation: none;
    }
}

/* Focus Styles for Keyboard Navigation */
*:focus-visible {
    outline: 2px solid var(--accent-primary);
    outline-offset: 2px;
    border-radius: 4px;
}

/* Selection Styles */
::selection {
    background: var(--accent-primary);
    color: var(--text-accent);
}

/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: var(--bg-secondary);
}

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

::-webkit-scrollbar-thumb:hover {
    background: var(--accent-secondary);
}

/* Advanced Analytics Panel */
.advanced-analytics {
    margin-top: 3rem;
    padding: 3rem;
    background: var(--bg-glass);
    backdrop-filter: blur(30px);
    border-radius: 24px;
    border: 1px solid var(--border-subtle);
    box-shadow: var(--shadow-large);
}

.advanced-analytics h3 {
    text-align: center;
    font-size: 1.8rem;
    font-weight: 300;
    margin-bottom: 2.5rem;
    background: var(--accent-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.analytics-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
}

.analytics-card {
    background: var(--bg-secondary);
    border-radius: 16px;
    padding: 2rem;
    border: 1px solid var(--border-subtle);
    transition: var(--transition-medium);
}

.analytics-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-medium);
    border-color: var(--border-medium);
}

.analytics-card h4 {
    font-size: 1.1rem;
    font-weight: 500;
    color: var(--text-primary);
    margin-bottom: 1.5rem;
    text-align: center;
}

.metric-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 0;
    border-bottom: 1px solid var(--border-subtle);
}

.metric-row:last-child {
    border-bottom: none;
}

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

.metric-value {
    color: var(--accent-primary);
    font-weight: 600;
    font-variant-numeric: tabular-nums;
}

.problem-keys-mini {
    margin-bottom: 1rem;
}

.problem-key-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.5rem 0.75rem;
    background: rgba(239, 68, 68, 0.1);
    border-radius: 8px;
    margin-bottom: 0.5rem;
    border: 1px solid rgba(239, 68, 68, 0.2);
}

.problem-key-item .key {
    font-weight: 600;
    color: var(--error);
    font-size: 1.1rem;
}

.problem-key-item .errors {
    color: var(--text-secondary);
    font-size: 0.85rem;
}

.no-problems {
    text-align: center;
    padding: 2rem 1rem;
    color: var(--success);
    font-size: 1rem;
    background: rgba(16, 185, 129, 0.1);
    border-radius: 12px;
    border: 1px solid rgba(16, 185, 129, 0.2);
    font-weight: 500;
}

.improvement-suggestion {
    font-size: 0.9rem;
    color: var(--text-secondary);
    font-style: italic;
    text-align: center;
    padding: 1rem;
    background: rgba(99, 102, 241, 0.05);
    border-radius: 8px;
    border: 1px solid rgba(99, 102, 241, 0.1);
}

.speed-chart {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
}

.chart-bars {
    display: flex;
    align-items: flex-end;
    gap: 0.5rem;
    height: 80px;
    width: 100%;
    justify-content: center;
}

.chart-bar {
    background: var(--accent-gradient);
    border-radius: 4px 4px 0 0;
    width: 20px;
    min-height: 10px;
    transition: var(--transition-medium);
    box-shadow: 0 0 10px rgba(99, 102, 241, 0.3);
}

.chart-bar:hover {
    transform: scaleY(1.1);
    box-shadow: 0 0 15px rgba(99, 102, 241, 0.5);
}

.chart-labels {
    display: flex;
    justify-content: space-between;
    width: 100%;
    font-size: 0.8rem;
    color: var(--text-tertiary);
}

.recommendations {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.recommendation {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    background: var(--bg-tertiary);
    border-radius: 10px;
    border: 1px solid var(--border-subtle);
    transition: var(--transition-medium);
}

.recommendation:hover {
    background: rgba(99, 102, 241, 0.05);
    border-color: rgba(99, 102, 241, 0.2);
}

.rec-icon {
    font-size: 1.2rem;
    flex-shrink: 0;
}

.rec-text {
    color: var(--text-secondary);
    font-size: 0.9rem;
    line-height: 1.4;
}

/* Added Text Notification */
.added-text-notification {
    position: fixed;
    top: 20px;
    right: 20px;
    background: var(--bg-glass);
    backdrop-filter: blur(20px);
    border: 1px solid var(--border-medium);
    border-radius: 12px;
    padding: 1rem 1.5rem;
    color: var(--text-primary);
    font-size: 0.9rem;
    font-weight: 500;
    box-shadow: var(--shadow-medium);
    z-index: 1000;
    opacity: 0;
    transform: translateX(100px);
    transition: var(--transition-medium);
    max-width: 300px;
}

.added-text-notification.visible {
    opacity: 1;
    transform: translateX(0);
}

.notification-content {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.notification-icon {
    font-size: 1.2rem;
    color: var(--accent-primary);
    flex-shrink: 0;
}

.notification-text {
    color: var(--text-primary);
    line-height: 1.4;
    word-break: break-word;
}

/* Select Dropdown Styling */
select optgroup {
    background: var(--bg-secondary);
    color: var(--text-primary);
    font-weight: 600;
    font-size: 0.85rem;
    padding: 0.5rem;
}

select option {
    background: var(--bg-secondary);
    color: var(--text-primary);
    padding: 0.5rem;
    font-size: 0.9rem;
}

select option:hover {
    background: var(--accent-primary);
    color: var(--text-accent);
}

/* Mobile Responsive for Analytics */
@media (max-width: 768px) {
    .advanced-analytics {
        padding: 2rem 1.5rem;
        margin-top: 2rem;
    }
    
    .analytics-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
    
    .analytics-card {
        padding: 1.5rem;
    }
    
    .chart-bars {
        height: 60px;
    }
    
    .chart-bar {
        width: 15px;
    }
    
    .added-text-notification {
        top: 10px;
        right: 10px;
        left: 10px;
        right: 10px;
        max-width: none;
        font-size: 0.8rem;
        padding: 0.75rem 1rem;
    }
}

@media (max-width: 480px) {
    .advanced-analytics {
        padding: 1.5rem 1rem;
    }
    
    .advanced-analytics h3 {
        font-size: 1.5rem;
    }
    
    .analytics-card {
        padding: 1.25rem;
    }
    
    .metric-row {
        padding: 0.5rem 0;
    }
    
    .recommendation {
        padding: 0.5rem 0.75rem;
    }
    
    .rec-text {
        font-size: 0.85rem;
    }
}