/* Override all dark styles to match the Apple Light Keyboard theme */
:root {
    --bg-main: #fbfbfd;
    --key-white: #ffffff;
    --key-gray: #e5e5ea;
    --key-orange: #f26522;
    --text-dark: #1d1d1f;
    --text-muted: #86868b;
    --border-color: #d1d1d6;
    --accent-gold: #c39a58;
}

body {
    background: var(--bg-main) !important;
    color: var(--text-dark) !important;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif !important;
}

/* Layout */
.app-container {
    display: flex;
    flex-direction: row !important;
    max-width: 1300px;
    margin: 0 auto;
    padding: 2rem !important;
    padding-top: 6rem !important; /* space for header */
    gap: 2rem;
}
.sidebar { 
    display: flex !important; 
    width: 300px;
    background: var(--key-white) !important;
    border: 1px solid var(--border-color) !important;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.03);
    color: var(--text-dark) !important;
}
.sidebar h2, .sidebar h3 {
    color: var(--text-dark) !important;
}
.sidebar-footer a {
    color: var(--text-muted) !important;
}
#lesson-list li {
    background: transparent !important;
    border-bottom: 1px solid var(--border-color) !important;
    color: var(--text-dark) !important;
}
#lesson-list li:hover {
    background: var(--bg-main) !important;
}
#lesson-list li.active {
    background: var(--bg-main) !important;
    border-left: 4px solid var(--key-orange) !important;
    color: var(--text-dark) !important;
    font-weight: 600;
}
.custom-lesson-box textarea {
    background: var(--bg-main) !important;
    color: var(--text-dark) !important;
    border: 1px solid var(--border-color) !important;
    border-radius: 8px;
}
.primary-btn {
    background: var(--key-orange) !important;
    color: white !important;
    border: none !important;
    border-radius: 8px !important;
    box-shadow: 0 2px 8px rgba(242, 101, 34, 0.3) !important;
}
.secondary-btn {
    background: var(--key-gray) !important;
    color: var(--text-dark) !important;
    border: none !important;
    border-radius: 8px !important;
}

.main-content {
    flex: 1;
}
.glass-panel {
    background: transparent !important;
    border: none !important;
    backdrop-filter: none !important;
    box-shadow: none !important;
}
.sidebar-header {
    display: none; /* Hide old header */
}

/* Replicate the top two boxes */
.text-display.glass-panel {
    display: flex;
    flex-direction: row;
    gap: 1rem;
    background: transparent !important;
    padding: 0 !important;
    box-shadow: none !important;
    margin-bottom: 2rem;
}

.text-wrapper {
    flex: 1;
    background: var(--key-white) !important;
    border: 1px solid var(--border-color) !important;
    border-radius: 12px !important;
    padding: 2rem !important;
    min-height: 140px;
    font-size: 1.5rem;
    position: relative;
    overflow: hidden;
    white-space: pre-wrap;
    text-align: left;
    line-height: 1.5;
}

/* Text Colors */
.text-wrapper span.completed {
    color: var(--text-muted) !important;
    opacity: 0.5;
}
.text-wrapper span.current {
    color: #ff3b30 !important; /* Red for next key */
    background: transparent !important;
    border-bottom: 2px solid #ff3b30 !important;
    font-weight: 600;
}
.text-wrapper span.remaining {
    color: var(--text-dark) !important;
}

/* Start Lesson Overlay */
.start-lesson-overlay {
    background: rgba(255, 255, 255, 0.9) !important;
    backdrop-filter: blur(5px);
}
.start-lesson-overlay button {
    background: #636b70 !important;
    color: white !important;
    border: 1px solid rgba(255,255,255,0.3) !important;
    border-radius: 8px !important;
    padding: 0.75rem 1.5rem !important;
    font-weight: 500 !important;
    box-shadow: none !important;
}

.stats {
    width: 250px;
    background: var(--key-white) !important;
    border: 1px solid var(--border-color) !important;
    border-radius: 12px;
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 0.5rem;
    color: var(--text-muted);
    font-size: 0.9rem;
    text-align: left;
}
.stats span {
    font-size: 14px;
    color: var(--text-dark) !important;
}

/* Keyboard */
.virtual-keyboard {
    background: transparent !important;
    padding: 0 !important;
    gap: 8px !important;
}
.keyboard-row {
    gap: 8px !important;
}
.key {
    background: var(--key-white) !important;
    border: none !important;
    border-radius: 8px !important;
    color: var(--text-dark) !important;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1), 0 1px 1px rgba(0,0,0,0.05) !important;
    font-family: -apple-system, BlinkMacSystemFont, sans-serif !important;
    font-size: 1.2rem !important;
    font-weight: 400 !important;
    text-transform: lowercase;
}

/* Modifier keys are gray */
.key[data-key="Tab"],
.key[data-key="CapsLock"],
.key[data-key="ShiftLeft"],
.key[data-key="ShiftRight"],
.key[data-key="ControlLeft"],
.key[data-key="AltLeft"],
.key[data-key="MetaLeft"],
.key[data-key="ControlRight"],
.key[data-key="AltRight"],
.key[data-key="MetaRight"],
.key[data-key="Backspace"],
.key[data-key="\\"] {
    background: var(--key-gray) !important;
    font-size: 0.9rem !important;
    font-weight: 500 !important;
}

/* Return key */
.key[data-key="Enter"] {
    background: var(--key-orange) !important;
    color: white !important;
    position: relative;
    font-size: 0.9rem !important;
    font-weight: 500 !important;
}
/* Tiny dot on enter key */
.key[data-key="Enter"]::after {
    content: '';
    position: absolute;
    top: 8px;
    right: 8px;
    width: 4px;
    height: 4px;
    background: white;
    border-radius: 50%;
}

/* Override old finger highlights completely */
.key[data-finger] {
    border-bottom: none !important;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1), 0 1px 1px rgba(0,0,0,0.05) !important;
}
.key.highlight {
    background: #d1d1d6 !important;
    color: var(--text-dark) !important;
    border: none !important;
    box-shadow: 0 0 0 2px var(--key-orange) !important;
    transform: none !important;
    text-shadow: none !important;
}
.key.pressed {
    transform: scale(0.95) !important;
    box-shadow: inset 0 2px 4px rgba(0,0,0,0.1) !important;
    border: none !important;
}

/* Hide hands but keep text hint */
.hands-overlay {
    display: none !important;
}
.finger-hint {
    display: block !important;
    position: absolute;
    bottom: -3rem;
    left: 0;
    width: 100%;
    text-align: center;
    color: var(--text-dark) !important;
    font-size: 1.1rem !important;
    font-weight: 600 !important;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    opacity: 1 !important;
    background: transparent !important;
    border: none !important;
}

/* Make text-display relative so absolute finger-hint stays inside */
.text-display.glass-panel {
    display: flex;
    flex-direction: row;
    gap: 1rem;
    background: transparent !important;
    padding: 2rem !important;
    box-shadow: none !important;
    margin-bottom: 5rem;
    position: relative;
    overflow: visible !important;
    border: 1px solid var(--text-dark) !important;
    border-radius: 16px !important;
}

/* Modals */
.modal {
    background: rgba(0, 0, 0, 0.4) !important;
    backdrop-filter: blur(5px);
}
.modal-content, .notification-content {
    background: var(--key-white) !important;
    border: 1px solid var(--border-color) !important;
    border-radius: 16px !important;
    box-shadow: 0 10px 40px rgba(0,0,0,0.1) !important;
    color: var(--text-dark) !important;
}
.notification-content .message {
    color: var(--text-dark) !important;
}

/* LondonGaze specific header/footer in the body */
.lg-header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    padding: 1.5rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    z-index: 100;
    background: rgba(251, 251, 253, 0.8);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--border-color);
}
.lg-logo {
    font-family: 'Playfair Display', serif;
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-dark);
    text-decoration: none;
    letter-spacing: -0.5px;
}
.lg-nav {
    display: flex;
    gap: 2rem;
}
.lg-nav a {
    color: var(--text-dark);
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 500;
    border: 1px solid var(--border-color);
    padding: 0.5rem 1rem;
    border-radius: 50px;
    transition: all 0.2s ease;
}
.lg-nav a:hover {
    background: var(--text-dark);
    color: var(--key-white);
}
.lg-footer {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    padding: 1.5rem 2rem;
    text-align: center;
    font-size: 0.8rem;
    color: var(--text-muted);
}

/* Mobile Warning */
.mobile-warning {
    display: none;
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: var(--bg-main);
    z-index: 999999;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 2rem;
}

.mobile-warning h2 {
    font-family: 'Playfair Display', serif;
    font-size: 2.5rem;
    margin-bottom: 1rem;
    color: var(--text-dark);
}

.mobile-warning p {
    font-size: 1.1rem;
    color: var(--text-muted);
    max-width: 400px;
    line-height: 1.6;
}

@media (max-width: 900px) {
    .app-container, .lg-header, .lg-footer {
        display: none !important;
    }
    .mobile-warning {
        display: flex !important;
    }
}
