﻿/* ========================================
   Tez-Yoz - Professional Typing Practice
   Modern Dark Theme with Neon Accents
======================================== */

/* CSS Variables */
:root {
    /* Colors */
    --bg-primary: #0a0a0f;
    --bg-secondary: #12121a;
    --bg-tertiary: #1a1a25;
    --bg-card: #15151f;

    --text-primary: #ffffff;
    --text-secondary: #a0a0b0;
    --text-muted: #606070;

    --accent-primary: #00d9ff;
    --accent-secondary: #00b8d4;
    --accent-glow: rgba(0, 217, 255, 0.3);

    --success: #10b981;
    --error: #ef4444;
    --warning: #f59e0b;

    --correct-bg: rgba(16, 185, 129, 0.15);
    --error-bg: rgba(239, 68, 68, 0.2);
    --current-bg: rgba(0, 217, 255, 0.1);

    /* Sizing */
    --font-size-sm: 0.875rem;
    --font-size-base: 1rem;
    --font-size-lg: 1.25rem;
    --font-size-xl: 1.5rem;
    --font-size-2xl: 2rem;
    --font-size-3xl: 3rem;

    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 24px;

    /* Shadows */
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.5);
    --shadow-glow: 0 0 20px var(--accent-glow);

    /* Transitions */
    --transition-fast: 0.15s ease;
    --transition-normal: 0.3s ease;
    --transition-slow: 0.5s ease;
}

/* Color Themes */
[data-theme="purple"] {
    --accent-primary: #a855f7;
    --accent-secondary: #9333ea;
    --accent-glow: rgba(168, 85, 247, 0.3);
}

[data-theme="green"] {
    --accent-primary: #10b981;
    --accent-secondary: #059669;
    --accent-glow: rgba(16, 185, 129, 0.3);
}

[data-theme="orange"] {
    --accent-primary: #f59e0b;
    --accent-secondary: #d97706;
    --accent-glow: rgba(245, 158, 11, 0.3);
}

[data-theme="pink"] {
    --accent-primary: #ec4899;
    --accent-secondary: #db2777;
    --accent-glow: rgba(236, 72, 153, 0.3);
}

/* Font Size Themes */
[data-font="small"] .text-display {
    font-size: 1.1rem !important;
}

[data-font="medium"] .text-display {
    font-size: 1.4rem !important;
}

[data-font="large"] .text-display {
    font-size: 1.8rem !important;
}

/* Light Mode Support */
body.light-mode {
    --bg-primary: #f5f5f7;
    --bg-secondary: #ffffff;
    --bg-tertiary: #f0f0f5;
    --bg-card: #ffffff;

    --text-primary: #1d1d1f;
    --text-secondary: #424245;
    --text-muted: #86868b;

    --accent-glow: rgba(0, 217, 255, 0.15);
}

body.light-mode .typing-container,
body.light-mode .stat-card,
body.light-mode .settings-item,
body.light-mode .stats-card,
body.light-mode .keyboard {
    border-color: rgba(0, 0, 0, 0.05);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.03);
}

body.light-mode .setting-btn,
body.light-mode .btn-secondary,
body.light-mode .key {
    background: #f0f0f5;
    color: #424245;
    border-color: rgba(0, 0, 0, 0.05);
}

body.light-mode .setting-btn:hover,
body.light-mode .key:hover {
    background: #e5e5ea;
}

body.light-mode .char {
    color: #86868b;
}

body.light-mode .char.current {
    background: rgba(0, 217, 255, 0.1);
}

/* Reset & Base */
*,
*::before,
*::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    font-size: 16px;
    scroll-behavior: smooth;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    min-height: 100vh;
    line-height: 1.6;
    overflow-x: hidden;
}

/* Particles Background */
#particles {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 0;
    background:
        radial-gradient(ellipse at 20% 20%, rgba(0, 217, 255, 0.08) 0%, transparent 50%),
        radial-gradient(ellipse at 80% 80%, rgba(168, 85, 247, 0.06) 0%, transparent 50%),
        radial-gradient(ellipse at 50% 50%, rgba(0, 0, 0, 0) 0%, var(--bg-primary) 100%);
}

/* Container */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    position: relative;
    z-index: 1;
}

/* Header */
.header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 0;
    margin-bottom: 30px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

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

.logo-icon {
    font-size: 2rem;
    animation: float 3s ease-in-out infinite;
}

@keyframes float {

    0%,
    100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-5px);
    }
}

.logo h1 {
    font-size: 1.8rem;
    font-weight: 700;
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    text-shadow: 0 0 30px var(--accent-glow);
}

.nav {
    display: flex;
    gap: 8px;
}

.nav-btn {
    padding: 12px 24px;
    background: transparent;
    border: 1.5px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--radius-md);
    color: var(--text-secondary);
    font-size: var(--font-size-sm);
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-normal);
    position: relative;
    overflow: hidden;
    white-space: nowrap;
}

.nav-btn::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    width: 0;
    height: 2px;
    background: var(--accent-primary);
    transition: all var(--transition-normal);
    transform: translateX(-50%);
}

.nav-btn:hover {
    background: rgba(255, 255, 255, 0.08);
    color: var(--text-primary);
    border-color: rgba(255, 255, 255, 0.25);
    transform: translateY(-2px);
}

.nav-btn:hover::after {
    width: 80%;
}

.nav-btn.active {
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
    color: var(--bg-primary);
    border-color: var(--accent-primary);
    box-shadow: var(--shadow-glow);
    transform: translateY(-2px);
}

.nav-btn.active::after {
    width: 0;
}

.theme-toggle button {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: var(--bg-tertiary);
    border: 1.5px solid rgba(255, 255, 255, 0.15);
    font-size: 1.2rem;
    cursor: pointer;
    transition: all var(--transition-normal);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.theme-toggle button:hover {
    background: var(--bg-card);
    transform: rotate(15deg) scale(1.1);
    border-color: var(--accent-primary);
    box-shadow: 0 4px 12px var(--accent-glow);
}

/* Settings Bar Redesign */
.settings-bar {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 30px;
    padding: 28px;
    background: rgba(18, 18, 26, 0.7);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-radius: var(--radius-xl);
    margin-bottom: 35px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.3);
}

.setting-group {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.setting-group label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.75rem;
    color: var(--text-muted);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1.2px;
    margin-bottom: 2px;
}

/* Restored Button Group Styling */
.btn-group {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.setting-btn {
    padding: 10px 18px;
    background: var(--bg-tertiary);
    border: 1.5px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    font-size: var(--font-size-sm);
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-fast);
    white-space: nowrap;
    position: relative;
    overflow: hidden;
    text-align: center;
}

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

.setting-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-primary);
    border-color: rgba(255, 255, 255, 0.2);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

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

.setting-btn.active {
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
    color: var(--bg-primary);
    border-color: var(--accent-primary);
    box-shadow: 0 0 20px var(--accent-glow), 0 4px 12px rgba(0, 0, 0, 0.3);
    font-weight: 700;
    transform: scale(1.05);
}

/* Special sizing for TUR group */
#typeButtons {
    display: flex;
    gap: 8px;
}

@media (max-width: 900px) {
    .settings-bar {
        grid-template-columns: 1fr 1fr;
    }
}

@media (max-width: 600px) {
    .settings-bar {
        grid-template-columns: 1fr;
        gap: 20px;
    }
}

/* Live Stats */
.live-stats {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
    margin-bottom: 30px;
}

.stat-card {
    background: var(--bg-secondary);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: var(--radius-md);
    padding: 20px;
    text-align: center;
    transition: var(--transition-normal);
}

.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.stat-value {
    font-family: 'JetBrains Mono', monospace;
    font-size: var(--font-size-2xl);
    font-weight: 700;
    color: var(--accent-primary);
    text-shadow: 0 0 20px var(--accent-glow);
}

.timer-card .stat-value {
    font-size: var(--font-size-3xl);
}

.stat-label {
    font-size: var(--font-size-sm);
    color: var(--text-muted);
    margin-top: 4px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* Typing Container */
.typing-container {
    background: var(--bg-secondary);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: var(--radius-lg);
    padding: 30px;
    margin-bottom: 20px;
    position: relative;
    overflow: hidden;
}

.typing-container::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--accent-primary), var(--accent-secondary));
    opacity: 0;
    transition: var(--transition-normal);
}

.typing-container.active::before {
    opacity: 1;
}

.text-display {
    font-family: 'JetBrains Mono', monospace;
    font-size: 1.4rem;
    line-height: 2;
    color: var(--text-muted);
    min-height: 120px;
    user-select: none;
    position: relative;
}

.start-hint {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    color: var(--text-muted);
    font-size: var(--font-size-lg);
    animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {

    0%,
    100% {
        opacity: 0.5;
    }

    50% {
        opacity: 1;
    }
}

.hint-icon {
    font-size: 1.5rem;
}

.typing-input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

/* Character Styles */
.char {
    display: inline;
    transition: var(--transition-fast);
    border-radius: 2px;
    padding: 0 1px;
}

.char.correct {
    color: var(--success);
    background: var(--correct-bg);
}

.char.incorrect {
    color: var(--error);
    background: var(--error-bg);
    text-decoration: underline wavy var(--error);
}

.char.current {
    background: var(--current-bg);
    border-left: 2px solid var(--accent-primary);
    animation: blink 1s ease-in-out infinite;
}

@keyframes blink {

    0%,
    100% {
        border-color: var(--accent-primary);
    }

    50% {
        border-color: transparent;
    }
}

.char.space {
    min-width: 0.5em;
}

.word {
    display: inline;
    margin-right: 0.5em;
}

/* Progress Bar */
.progress-container {
    height: 6px;
    background: var(--bg-tertiary);
    border-radius: 3px;
    margin-bottom: 30px;
    overflow: hidden;
}

.progress-bar {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, var(--accent-primary), var(--accent-secondary));
    border-radius: 3px;
    transition: width 0.3s ease;
    box-shadow: 0 0 10px var(--accent-glow);
}

/* Virtual Keyboard */
.keyboard-container {
    margin-bottom: 30px;
}

.keyboard {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 20px;
    background: var(--bg-secondary);
    border-radius: var(--radius-lg);
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.keyboard-row {
    display: flex;
    justify-content: center;
    gap: 6px;
}

.key {
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 50px;
    height: 50px;
    padding: 0 12px;
    background: var(--bg-tertiary);
    border: 1.5px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    font-family: 'JetBrains Mono', monospace;
    font-size: var(--font-size-sm);
    font-weight: 500;
    cursor: default;
    transition: all var(--transition-fast);
    text-transform: uppercase;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.key:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.2);
    transform: translateY(-1px);
}

.key.active {
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
    color: var(--bg-primary);
    border-color: var(--accent-primary);
    transform: scale(0.95) translateY(2px);
    box-shadow: 0 0 20px var(--accent-glow), inset 0 2px 4px rgba(0, 0, 0, 0.2);
}

.key.next {
    background: rgba(0, 217, 255, 0.25);
    border-color: var(--accent-primary);
    box-shadow: 0 0 10px var(--accent-glow);
    animation: keyPulse 1s ease-in-out infinite;
}

@keyframes keyPulse {

    0%,
    100% {
        box-shadow: 0 0 5px var(--accent-glow);
    }

    50% {
        box-shadow: 0 0 20px var(--accent-glow);
    }
}

.key.home-key {
    border-bottom: 3px solid var(--accent-primary);
}

.key-wide {
    min-width: 80px;
}

.key-caps {
    min-width: 90px;
}

.key-shift {
    min-width: 115px;
}

.key-enter {
    min-width: 110px;
}

.key-space {
    min-width: 300px;
}

.key-ctrl,
.key-alt {
    min-width: 70px;
}

/* Modal */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(10px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: var(--transition-normal);
}

.modal.active {
    opacity: 1;
    visibility: visible;
}

.modal-content {
    background: var(--bg-secondary);
    border-radius: var(--radius-xl);
    padding: 30px;
    max-width: 600px;
    width: 95%;
    max-height: 95vh;
    overflow-y: auto;
    position: relative;
    transform: scale(0.9);
    transition: var(--transition-normal);
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: var(--shadow-lg);
    display: flex;
    flex-direction: column;
}

/* Hide scrollbar for Chrome, Safari and Opera */
.modal-content::-webkit-scrollbar {
    display: none;
}

/* Hide scrollbar for IE, Edge and Firefox */
.modal-content {
    -ms-overflow-style: none;
    /* IE and Edge */
    scrollbar-width: none;
    /* Firefox */
}

.modal.active .modal-content {
    transform: scale(1);
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 25px;
}

.modal-header h2 {
    font-size: var(--font-size-xl);
    color: var(--text-primary);
}

.modal-close {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--bg-tertiary);
    border: 1.5px solid rgba(255, 255, 255, 0.1);
    color: var(--text-secondary);
    font-size: 1.5rem;
    cursor: pointer;
    transition: all var(--transition-fast);
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
}

.modal-close:hover {
    background: var(--error);
    color: white;
    border-color: var(--error);
    transform: rotate(90deg) scale(1.1);
    box-shadow: 0 4px 12px rgba(239, 68, 68, 0.4);
}

/* Result Grid */
.result-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
    margin-bottom: 20px;
}

.result-card {
    background: var(--bg-tertiary);
    border-radius: var(--radius-md);
    padding: 20px;
    text-align: center;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.result-card.main-result {
    grid-column: span 3;
    background: linear-gradient(135deg, rgba(0, 217, 255, 0.1), rgba(168, 85, 247, 0.1));
    border-color: var(--accent-primary);
}

.result-icon {
    font-size: 2rem;
    margin-bottom: 8px;
}

.result-value {
    font-family: 'JetBrains Mono', monospace;
    font-size: var(--font-size-2xl);
    font-weight: 700;
    color: var(--accent-primary);
}

.main-result .result-value {
    font-size: var(--font-size-3xl);
    text-shadow: 0 0 30px var(--accent-glow);
}

.result-label {
    font-size: var(--font-size-sm);
    color: var(--text-muted);
    margin-top: 4px;
}

.result-subtitle {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.result-rank {
    text-align: center;
    padding: 20px;
    background: var(--bg-tertiary);
    border-radius: var(--radius-md);
    margin-bottom: 20px;
}

.rank-badge {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 12px 24px;
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
    border-radius: var(--radius-lg);
    font-size: var(--font-size-lg);
    font-weight: 600;
    color: var(--bg-primary);
}

/* Modal Footer */
.modal-footer {
    display: flex;
    gap: 16px;
    justify-content: center;
    margin-top: 24px;
    padding-top: 24px;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    flex-wrap: wrap;
}

.btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 14px 32px;
    border-radius: var(--radius-md);
    font-size: var(--font-size-base);
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-fast);
    border: none;
    position: relative;
    overflow: hidden;
    white-space: nowrap;
}

.btn::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

.btn:hover::before {
    width: 300px;
    height: 300px;
}

.btn-primary {
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
    color: var(--bg-primary);
    box-shadow: 0 4px 15px rgba(0, 217, 255, 0.3);
}

.btn-primary:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px var(--accent-glow), 0 4px 15px rgba(0, 217, 255, 0.4);
}

.btn-primary:active {
    transform: translateY(-1px);
}

.btn-secondary {
    background: var(--bg-tertiary);
    color: var(--text-primary);
    border: 1.5px solid rgba(255, 255, 255, 0.15);
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.12);
    border-color: rgba(255, 255, 255, 0.25);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.btn-danger {
    background: linear-gradient(135deg, var(--error), #dc2626);
    color: white;
    box-shadow: 0 4px 15px rgba(239, 68, 68, 0.3);
}

.btn-danger:hover {
    background: linear-gradient(135deg, #dc2626, #b91c1c);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(239, 68, 68, 0.4);
}

/* Pages */
.page {
    display: none;
    padding: 30px;
    background: var(--bg-secondary);
    border-radius: var(--radius-lg);
    border: 1px solid rgba(255, 255, 255, 0.05);
    margin-bottom: 30px;
}

.page.active {
    display: block;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Stats Page */
.stats-header h2 {
    margin-bottom: 25px;
    font-size: var(--font-size-xl);
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
    margin-bottom: 30px;
}

.stats-card {
    background: var(--bg-tertiary);
    border-radius: var(--radius-md);
    padding: 25px;
    text-align: center;
    border: 1px solid rgba(255, 255, 255, 0.05);
    transition: var(--transition-normal);
}

.stats-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-md);
}

.stats-icon {
    font-size: 2rem;
    margin-bottom: 10px;
}

.stats-value {
    font-family: 'JetBrains Mono', monospace;
    font-size: var(--font-size-2xl);
    font-weight: 700;
    color: var(--accent-primary);
}

.stats-label {
    font-size: var(--font-size-sm);
    color: var(--text-muted);
    margin-top: 5px;
}

.history-section h3 {
    margin-bottom: 15px;
    font-size: var(--font-size-lg);
}

.history-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
    max-height: 300px;
    overflow-y: auto;
    margin-bottom: 20px;
}

.history-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
    background: var(--bg-tertiary);
    border-radius: var(--radius-md);
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.history-info {
    display: flex;
    gap: 20px;
}

.history-wpm {
    font-family: 'JetBrains Mono', monospace;
    font-weight: 700;
    color: var(--accent-primary);
}

.history-accuracy {
    color: var(--success);
}

.history-date {
    font-size: var(--font-size-sm);
    color: var(--text-muted);
}

.empty-history {
    text-align: center;
    padding: 40px;
    color: var(--text-muted);
}

/* Settings Page */
.settings-header h2 {
    margin-bottom: 25px;
    font-size: var(--font-size-xl);
}

.settings-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.settings-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    background: var(--bg-tertiary);
    border-radius: var(--radius-md);
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.settings-info {
    flex: 1;
}

.settings-title {
    font-weight: 600;
    margin-bottom: 4px;
}

.settings-desc {
    font-size: var(--font-size-sm);
    color: var(--text-muted);
}

/* Toggle Switch */
.toggle {
    position: relative;
    display: inline-block;
    width: 56px;
    height: 30px;
}

.toggle input {
    position: absolute;
    opacity: 0;
    width: 100%;
    height: 100%;
    cursor: pointer;
    z-index: 5;
    margin: 0;
}

.toggle-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--bg-primary);
    border-radius: 30px;
    transition: all var(--transition-normal);
    border: 2px solid rgba(255, 255, 255, 0.15);
    pointer-events: none;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.2);
}

.toggle-slider::before {
    position: absolute;
    content: "";
    height: 22px;
    width: 22px;
    left: 4px;
    bottom: 3px;
    background: var(--text-secondary);
    border-radius: 50%;
    transition: all var(--transition-normal);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
}

.toggle:hover .toggle-slider {
    border-color: rgba(255, 255, 255, 0.25);
}

.toggle input:checked+.toggle-slider {
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
    border-color: var(--accent-primary);
    box-shadow: 0 0 15px var(--accent-glow), inset 0 2px 4px rgba(0, 0, 0, 0.1);
}

.toggle input:checked+.toggle-slider::before {
    transform: translateX(24px);
    background: var(--bg-primary);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
}

/* Color Picker */
.color-picker {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.color-btn {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 3px solid transparent;
    background: var(--color);
    cursor: pointer;
    transition: all var(--transition-fast);
    position: relative;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.color-btn::after {
    content: 'âœ“';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0);
    color: white;
    font-size: 18px;
    font-weight: bold;
    transition: transform var(--transition-fast);
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
}

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

.color-btn.active {
    border-color: white;
    box-shadow: 0 0 20px var(--color), 0 4px 12px rgba(0, 0, 0, 0.3);
    transform: scale(1.1);
}

.color-btn.active::after {
    transform: translate(-50%, -50%) scale(1);
}

/* Footer */
.footer {
    text-align: center;
    padding: 20px;
    color: var(--text-muted);
    font-size: var(--font-size-sm);
}

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

::-webkit-scrollbar-track {
    background: var(--bg-tertiary);
    border-radius: 4px;
}

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

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

/* Responsive */
@media (max-width: 768px) {
    .header {
        flex-direction: column;
        gap: 15px;
        align-items: stretch;
    }

    .nav {
        flex-wrap: wrap;
        justify-content: center;
        gap: 8px;
    }

    .nav-btn {
        padding: 10px 18px;
        font-size: 0.8rem;
        flex: 1;
        min-width: 100px;
    }

    .settings-bar {
        grid-template-columns: 1fr;
        gap: 20px;
        padding: 20px;
    }

    .setting-group {
        width: 100%;
    }

    .btn-group {
        justify-content: flex-start;
    }

    .setting-btn {
        padding: 9px 16px;
        font-size: 0.85rem;
    }

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

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

    .result-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .result-card.main-result {
        grid-column: span 2;
    }

    .keyboard {
        display: none;
    }

    .key-space {
        min-width: 150px;
    }

    .text-display {
        font-size: 1.1rem;
    }

    .btn {
        padding: 12px 24px;
        font-size: 0.9rem;
    }

    .modal-footer {
        flex-direction: column;
    }

    .modal-footer .btn {
        width: 100%;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 10px;
    }

    .header {
        padding: 15px 0;
    }

    .logo h1 {
        font-size: 1.5rem;
    }

    .nav {
        width: 100%;
    }

    .nav-btn {
        padding: 8px 12px;
        font-size: 0.75rem;
        min-width: auto;
    }

    .settings-bar {
        padding: 16px;
        gap: 16px;
    }

    .setting-group label {
        font-size: 0.7rem;
    }

    .setting-btn {
        padding: 8px 12px;
        font-size: 0.8rem;
    }

    .typing-container {
        padding: 20px;
    }

    .stats-grid {
        grid-template-columns: 1fr;
        gap: 12px;
    }

    .btn-group {
        flex-wrap: wrap;
        gap: 4px;
    }

    .modal-content {
        padding: 20px;
    }

    .modal-footer {
        flex-direction: column;
        gap: 10px;
    }

    .modal-footer .btn {
        width: 100%;
        padding: 12px 20px;
    }

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

    .stat-card {
        padding: 15px;
    }

    .stat-value {
        font-size: 1.5rem;
    }

    .timer-card .stat-value {
        font-size: 2rem;
    }
}

/* Animations Control */
[data-animations="false"] * {
    animation: none !important;
    transition: none !important;
}

/* Hidden keyboard */
.keyboard-hidden .keyboard-container {
    display: none;
}

@media (max-width: 600px) {
    .sound-list {
        display: grid !important;
        grid-template-columns: 1fr 1fr;
        width: 100% !important;
    }
}

.sound-list .setting-btn {
    flex: 1;
    text-align: center;
    font-size: 0.8rem;
    padding: 8px 4px;
}

/* Guides Page */
.guides-header {
    text-align: center;
    margin-bottom: 40px;
}

.guides-header h2 {
    font-size: 3rem;
    margin-bottom: 10px;
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    text-shadow: 0 0 30px var(--accent-glow);
}

.guides-header p {
    color: var(--text-secondary);
    font-size: 1.25rem;
}

.guides-sections {
    display: flex;
    flex-direction: column;
    gap: 50px;
}

.guide-section h3 {
    font-size: 1.5rem;
    margin-bottom: 25px;
    padding-bottom: 10px;
    border-bottom: 2px solid var(--accent-glow);
    display: inline-block;
}

.guide-card {
    background: var(--bg-tertiary);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 16px;
    padding: 25px;
    text-align: center;
    transition: 0.3s ease;
}

.guide-card:hover {
    transform: translateY(-5px);
    border-color: var(--accent-primary);
    box-shadow: 0 0 20px var(--accent-glow);
}

.guide-icon {
    font-size: 2.5rem;
    margin-bottom: 15px;
}

.guide-card h4 {
    font-size: 1.25rem;
    margin-bottom: 12px;
    color: var(--accent-primary);
}

.guide-card p {
    font-size: 0.875rem;
    color: var(--text-secondary);
    line-height: 1.6;
}

.benefits-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
    gap: 20px;
}

.benefit-item {
    background: var(--bg-secondary);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 16px;
    padding: 20px;
    display: flex;
    gap: 20px;
    align-items: center;
    transition: 0.3s ease;
    position: relative;
    overflow: hidden;
}

.benefit-item::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
    background: var(--accent-primary);
    opacity: 0.5;
}

.benefit-item:hover {
    background: var(--bg-tertiary);
    transform: translateX(5px);
}

.benefit-icon {
    font-size: 2.5rem;
    min-width: 60px;
    height: 60px;
    background: var(--bg-tertiary);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--accent-glow);
}

.benefit-content h4 {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 5px;
    color: var(--text-primary);
}

.benefit-content p {
    font-size: 0.875rem;
    color: var(--text-muted);
}

.tips-list {
    list-style: none;
    background: var(--bg-tertiary);
    border-radius: 16px;
    padding: 30px;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.tips-list li {
    padding: 12px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    display: flex;
    align-items: flex-start;
    gap: 15px;
}

.tips-list li::before {
    content: 'â­';
    font-size: 1.2rem;
}

.tips-list li:last-child {
    border-bottom: none;
}

.tips-list li strong {
    color: var(--accent-primary);
    margin-right: 5px;
}

/* ========================================
   Tez-Yoz - Professional Enhancements
======================================== */

/* Level and XP Bar */
.stat-card.level-card {
    position: relative;
    overflow: hidden;
    min-width: 140px;
}

.xp-mini-bar {
    width: 100%;
    height: 6px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 3px;
    margin-top: 10px;
    overflow: hidden;
}

#xpProgress {
    height: 100%;
    background: linear-gradient(90deg, var(--accent-primary), var(--accent-secondary));
    width: 0%;
    transition: width 0.5s ease;
}

/* WPM Chart Container */
.result-chart-container {
    width: 100%;
    height: 250px;
    margin-top: 25px;
    background: rgba(0, 0, 0, 0.3);
    border-radius: var(--radius-md);
    border: 1px solid rgba(255, 255, 255, 0.1);
    padding: 20px;
    position: relative;
}

#wpmChart {
    width: 100% !important;
    height: 100% !important;
}

/* Achievements */
.achievements-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 25px;
    margin-top: 30px;
}

.achievement-card {
    background: var(--bg-tertiary);
    border: 1.5px solid rgba(255, 255, 255, 0.05);
    border-radius: var(--radius-lg);
    padding: 30px;
    text-align: center;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    opacity: 0.4;
    filter: grayscale(1);
    position: relative;
}

.achievement-card.unlocked {
    opacity: 1;
    filter: grayscale(0);
    border-color: var(--accent-primary);
    box-shadow: 0 10px 30px rgba(0, 217, 255, 0.2);
    transform: translateY(-8px);
}

.achievement-icon {
    font-size: 3.5rem;
    margin-bottom: 20px;
    display: block;
}

.achievement-info h4 {
    color: var(--text-primary);
    margin-bottom: 10px;
    font-size: 1.2rem;
}

.achievement-info p {
    color: var(--text-muted);
    font-size: 0.9rem;
    line-height: 1.5;
}

/* Custom Modal Animations and Styling */
.modal-content {
    background: var(--bg-secondary);
    border: 1.5px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5), 0 0 30px var(--accent-glow);
}

/* Modal Close Button */
.modal-close {
    position: absolute;
    top: 15px;
    right: 15px;
    width: 32px;
    height: 32px;
    background: #ef4444;
    border: none;
    border-radius: 50%;
    color: white;
    font-size: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: 0.3s;
    z-index: 10;
    box-shadow: 0 4px 10px rgba(239, 68, 68, 0.3);
}

.modal-close:hover {
    transform: rotate(90deg) scale(1.1);
    background: #dc2626;
}

/* Custom Text Input Area */
#customTextInput {
    width: 100%;
    height: 220px;
    background: var(--bg-primary);
    border: 1.5px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--radius-md);
    padding: 20px;
    color: var(--text-primary);
    font-family: 'JetBrains Mono', monospace;
    font-size: 1.1rem;
    resize: none;
    outline: none;
    line-height: 1.6;
    transition: border-color 0.3s ease;
}

#customTextInput:focus {
    border-color: var(--accent-primary);
}

/* Keyboard Zones Support */
.keyboard.show-zones .key[data-finger="left-5"] {
    box-shadow: 0 4px 0 #ef4444;
}

.keyboard.show-zones .key[data-finger="left-4"] {
    box-shadow: 0 4px 0 #f59e0b;
}

.keyboard.show-zones .key[data-finger="left-3"] {
    box-shadow: 0 4px 0 #10b981;
}

.keyboard.show-zones .key[data-finger="left-2"] {
    box-shadow: 0 4px 0 #3b82f6;
}

.keyboard.show-zones .key[data-finger="right-2"] {
    box-shadow: 0 4px 0 #3b82f6;
}

.keyboard.show-zones .key[data-finger="right-3"] {
    box-shadow: 0 4px 0 #10b981;
}

.keyboard.show-zones .key[data-finger="right-4"] {
    box-shadow: 0 4px 0 #f59e0b;
}

.keyboard.show-zones .key[data-finger="right-5"] {
    box-shadow: 0 4px 0 #ef4444;
}

.keyboard.show-zones .key[data-finger="thumb"] {
    box-shadow: 0 4px 0 #8b5cf6;
}

/* Result Modal Sharing Card Styling */
.btn-success {
    background: linear-gradient(135deg, var(--success), #059669);
    color: white;
    box-shadow: 0 4px 15px rgba(16, 185, 129, 0.3);
}

.btn-success:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(16, 185, 129, 0.4);
}

@media (max-width: 480px) {
    .stats-grid {
        grid-template-columns: 1fr 1fr;
    }

    .achievements-grid {
        grid-template-columns: 1fr;
    }

    .guides-header h2 {
        font-size: 2.2rem;
    }
}