/* ========================================
   Pro Coding - Theme System
   Dark/Light Mode Support
   ======================================== */

:root {
    /* Mode indicator */
    --mode: light;

    /* ===== THEME COLORS (from existing system) ===== */
    --theme-color: #0d0d14;
    --theme-bg-gradient: linear-gradient(135deg, #ffffff 0%, #ffffff 100%);

    /* ===== LIGHT MODE (Default) ===== */

    /* Backgrounds */
    --bg-primary: var(--theme-bg-gradient);
    --glass-bg: rgba(255, 255, 255, 0.15);
    --glass-bg-strong: rgba(255, 255, 255, 0.25);
    --glass-border: rgba(255, 255, 255, 0.25);
    --glass-border-strong: rgba(255, 255, 255, 0.4);
    --dark-overlay: rgba(0, 0, 0, 0.2);
    --dark-overlay-strong: rgba(0, 0, 0, 0.4);

    /* Text */
    --text-primary: #ffffff;
    --text-secondary: rgba(255, 255, 255, 0.85);
    --text-muted: rgba(255, 255, 255, 0.6);
    --text-on-light: #333333;
    --text-on-light-secondary: #555555;

    /* Cards & Components */
    --card-bg: rgba(255, 255, 255, 0.15);
    --card-bg-hover: rgba(255, 255, 255, 0.25);
    --card-border: rgba(255, 255, 255, 0.25);

    /* Code blocks */
    --code-bg: rgba(30, 30, 40, 0.9);
    --code-header-bg: rgba(255, 255, 255, 0.08);
    --code-text: #e4e4e7;

    /* Output box */
    --output-bg: rgba(255, 255, 255, 0.95);
    --output-text: #333333;

    /* Inputs */
    --input-bg: rgba(255, 255, 255, 0.15);
    --input-border: rgba(255, 255, 255, 0.2);
    --input-text: #ffffff;
    --input-placeholder: rgba(255, 255, 255, 0.5);

    /* Scrollbar */
    --scrollbar-track: rgba(255, 255, 255, 0.1);
    --scrollbar-thumb: rgba(255, 255, 255, 0.3);
    --scrollbar-thumb-hover: rgba(255, 255, 255, 0.5);

    /* Shadows */
    --shadow-soft: 0 8px 32px rgba(0, 0, 0, 0.15);
    --shadow-medium: 0 15px 40px rgba(0, 0, 0, 0.2);
    --shadow-strong: 0 20px 50px rgba(0, 0, 0, 0.3);

    /* Branding */
    --branding-bg: rgba(0, 0, 0, 0.4);

    /* Navigation */
    --nav-icon-bg: rgba(255, 255, 255, 0.15);
    --nav-icon-border: rgba(255, 255, 255, 0.2);
    --nav-icon-hover: rgba(255, 255, 255, 0.25);

    /* Buttons */
    --btn-primary-bg: var(--theme-color);
    --btn-secondary-bg: rgba(255, 255, 255, 0.15);
}

/* ===== DARK MODE ===== */
[data-theme="dark"] {
    --mode: dark;
    --theme-color: #667eea; 
    /* Backgrounds - Deep, sophisticated dark */
    --bg-primary: linear-gradient(135deg, #0d0d14 0%,  #0d0d14 100%);
    --glass-bg: rgba(25, 25, 45, 0.85);
    --glass-bg-strong: rgba(35, 35, 60, 0.9);
    --glass-border: rgba(100, 100, 150, 0.25);
    --glass-border-strong: rgba(120, 120, 170, 0.35);
    --dark-overlay: rgba(0, 0, 0, 0.5);
    --dark-overlay-strong: rgba(0, 0, 0, 0.7);

    /* Text - Light colors for dark background */
    --text-primary: #e4e4e7;
    --text-secondary: rgba(228, 228, 231, 0.85);
    --text-muted: rgba(228, 228, 231, 0.55);
    --text-on-light: #e4e4e7;
    --text-on-light-secondary: #a1a1aa;

    /* Cards & Components */
    --card-bg: rgba(30, 30, 55, 0.8);
    --card-bg-hover: rgba(45, 45, 75, 0.85);
    --card-border: rgba(100, 100, 150, 0.3);

    /* Code blocks - Darker in dark mode */
    --code-bg: rgba(15, 15, 25, 0.95);
    --code-header-bg: rgba(40, 40, 70, 0.5);
    --code-text: #d4d4d8;

    /* Output box - Dark version */
    --output-bg: rgba(25, 25, 40, 0.95);
    --output-text: #e4e4e7;

    /* Inputs */
    --input-bg: rgba(30, 30, 55, 0.8);
    --input-border: rgba(100, 100, 150, 0.3);
    --input-text: #e4e4e7;
    --input-placeholder: rgba(228, 228, 231, 0.4);

    /* Scrollbar */
    --scrollbar-track: rgba(30, 30, 55, 0.5);
    --scrollbar-thumb: rgba(100, 100, 150, 0.5);
    --scrollbar-thumb-hover: rgba(120, 120, 170, 0.6);

    /* Shadows - Darker and more pronounced */
    --shadow-soft: 0 8px 32px rgba(0, 0, 0, 0.4);
    --shadow-medium: 0 15px 40px rgba(0, 0, 0, 0.5);
    --shadow-strong: 0 20px 50px rgba(0, 0, 0, 0.6);

    /* Branding */
    --branding-bg: rgba(20, 20, 40, 0.8);

    /* Navigation */
    --nav-icon-bg: rgba(40, 40, 70, 0.7);
    --nav-icon-border: rgba(100, 100, 150, 0.3);
    --nav-icon-hover: rgba(60, 60, 90, 0.8);

    /* Buttons */
    --btn-primary-bg: var(--theme-color);
    --btn-secondary-bg: rgba(50, 50, 80, 0.7);
}

/* ===== GLOBAL BRANDING ===== */
.branding,
.nav-center-brand {
    display: flex !important;
    align-items: center !important;
    gap: 12px !important;
    text-decoration: none !important;
    background: transparent !important;
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
    border: none !important;
    box-shadow: none !important;
    padding: 0 !important;
}

.branding-icon {
    width: 42px !important;
    height: 42px !important;
    background: transparent !important;
    border-radius: 12px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    overflow: hidden !important;
    box-shadow: none !important;
    flex-shrink: 0 !important;
}

.branding-icon img {
    width: 100% !important;
    height: 100% !important;
    object-fit: contain !important;
    display: block !important;
}

.branding-text {
    color: #000000 !important;
    font-size: 18px !important;
    font-weight: 700 !important;
    letter-spacing: -0.5px !important;
    white-space: nowrap !important;
}

[data-theme="dark"] .branding-text {
    color: #ffffff !important;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.2) !important;
}

/* Landscape and Mobile Overrides for Branding */
@media screen and (max-height: 500px), screen and (max-width: 600px) {
    .branding-icon {
        width: 32px !important;
        height: 32px !important;
        border-radius: 8px !important;
    }
    .branding-text {
        font-size: 15px !important;
    }
}

/* ===== GLOBAL ADAPTIVE BACK BUTTON ===== */
body .back-btn,
body nav .back-btn {
    background: var(--dynamic-nav-bg, rgba(100, 100, 100, 0.15)) !important;
    backdrop-filter: blur(10px) !important;
    -webkit-backdrop-filter: blur(10px) !important;
    border: 1px solid var(--dynamic-nav-border, rgba(255, 255, 255, 0.1)) !important;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1) !important;
    border-radius: 12px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    text-decoration: none !important;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275) !important;
    color: var(--dynamic-text-primary, #ffffff) !important;
}

@media (hover: hover) {
    body .back-btn:hover,
    @media (hover: hover) {
        body nav .back-btn:hover {
        background: var(--dynamic-nav-hover, rgba(100, 100, 100, 0.25)) !important;
        transform: translateY(-2px) scale(1.05) !important;
        }
    }
}

body .back-btn svg,
body nav .back-btn svg {
    fill: currentColor !important;
    stroke: none !important;
    transition: all 0.3s ease !important;
}

/* ===== STATIC GRADIENT BACKGROUND (all modes) ===== */
html {
    background-color: var(--bg-solid-fallback, #ffffff) !important;
    animation: none !important;
}

body {
    background: var(--bg-primary) !important;
    background-size: 100% 100% !important;
    animation: none !important;
}

[data-theme="dark"] html {
    background-color: var(--bg-solid-fallback, #0d0d14) !important;
}

[data-theme="dark"] body {
    background: var(--bg-primary) !important;
    background-size: 100% 100% !important;
}

/* ===== THEME TOGGLE BUTTON - ENHANCED ===== */
.theme-toggle {
    width: 42px;
    height: 42px;
    background: linear-gradient(135deg, var(--nav-icon-bg), var(--glass-bg-strong));
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    border: 1px solid var(--nav-icon-border);
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    position: relative;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.15);
}

/* Animated glow ring */
.theme-toggle::before {
    content: '';
    position: absolute;
    inset: -2px;
    border-radius: 16px;
    background: linear-gradient(135deg, #fbbf24, #f59e0b, #fcd34d);
    opacity: 0;
    z-index: -1;
    transition: opacity 0.3s ease;
}

@media (hover: hover) {
    @media (hover: hover) {
        .theme-toggle:hover::before {
        opacity: 0.6;
        }
    }

    @media (hover: hover) {
        .theme-toggle:hover {
        transform: translateY(-3px) scale(1.05);
        box-shadow: 0 8px 25px rgba(251, 191, 36, 0.3);
        border-color: rgba(251, 191, 36, 0.5);
        }
    }
}

.theme-toggle:active {
    transform: translateY(-1px) scale(1.02);
}

.theme-toggle svg {
    width: 26px;
    height: 26px;
    fill: var(--text-primary);
    transition: all 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.2));
}

/* Sun icon (shown in dark mode) */
.theme-toggle .icon-sun {
    position: absolute;
    opacity: 0;
    transform: rotate(-180deg) scale(0);
    color: #fbbf24;
}

/* Moon icon (shown in light mode) */
.theme-toggle .icon-moon {
    position: absolute;
    opacity: 1;
    transform: rotate(0) scale(1);
}

/* Dark mode toggle appearance */
[data-theme="dark"] .theme-toggle {
    background: linear-gradient(135deg, rgba(139, 92, 246, 0.3), rgba(59, 130, 246, 0.2));
    border-color: rgba(139, 92, 246, 0.4);
}

[data-theme="dark"] .theme-toggle::before {
    background: linear-gradient(135deg, #8b5cf6, #3b82f6, #06b6d4);
}

@media (hover: hover) {
    @media (hover: hover) {
        [data-theme="dark"] .theme-toggle:hover {
        box-shadow: 0 8px 25px rgba(139, 92, 246, 0.4);
        border-color: rgba(139, 92, 246, 0.6);
        }
    }
}

[data-theme="dark"] .theme-toggle .icon-sun {
    opacity: 1;
    transform: rotate(0) scale(1);
    fill: #fbbf24;
}

[data-theme="dark"] .theme-toggle .icon-moon {
    opacity: 0;
    transform: rotate(180deg) scale(0);
}

/* ===== DARK MODE ACCENT GLOWS ===== */
@media (hover: hover) {
    [data-theme="dark"] .card:hover,
    [data-theme="dark"] .byte-card:hover,
    @media (hover: hover) {
        [data-theme="dark"] .content-card:hover {
        box-shadow: 0 15px 40px rgba(139, 92, 246, 0.15),
        0 5px 20px rgba(59, 130, 246, 0.1);
        border-color: rgba(139, 92, 246, 0.3);
        }
    }
}

[data-theme="dark"] .start-btn,
[data-theme="dark"] .try-btn {
    box-shadow: 0 6px 20px rgba(5, 150, 105, 0.35);
}

@media (hover: hover) {
    [data-theme="dark"] .start-btn:hover,
    @media (hover: hover) {
        [data-theme="dark"] .try-btn:hover {
        box-shadow: 0 10px 30px rgba(5, 150, 105, 0.45);
        }
    }
}

/* Dark mode branding glow */
[data-theme="dark"] .branding {
    border: 1px solid rgba(139, 92, 246, 0.2);
}

/* Dark mode links/highlights */
[data-theme="dark"] .description strong,
[data-theme="dark"] strong {
    color: #a78bfa;
}

/* ===== SMOOTH TRANSITIONS & INSTANT CLICK FOR MOBILE ===== */
body,
.card,
.byte-card,
.course-card,
.quiz-container,
.chat-container,
.content-card,
.instruction-card,
.nav-icon,
.back-btn,
.branding,
input,
button {
    transition: background-color 0.25s ease,
        border-color 0.25s ease,
        color 0.25s ease,
        box-shadow 0.25s ease,
        transform 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
}

/* ========================================
   LANDSCAPE MOBILE WEBVIEW OPTIMIZATIONS
   ======================================== */

/* WebView base optimizations */
html {
    -webkit-text-size-adjust: 100%;
    -ms-text-size-adjust: 100%;
    touch-action: manipulation;
    scroll-behavior: smooth;
}

body {
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
    -webkit-tap-highlight-color: transparent;
}

/* Disable browser-specific behaviors */
* {
    -webkit-touch-callout: none;
    -webkit-user-select: none;
    user-select: none;
}

/* Allow text selection in content areas (code, descriptions) */
.code-content,
.description,
.output-box,
pre,
code {
    -webkit-user-select: text;
    user-select: text;
}

input,
textarea,
select,
[contenteditable="true"] {
    -webkit-user-select: text !important;
    user-select: text !important;
    -webkit-touch-callout: default !important;
}

/* ===== LANDSCAPE MOBILE - Compact Layout ===== */
/* Target landscape mobile devices (height <= 500px indicates landscape phone) */
@media screen and (max-height: 500px) and (orientation: landscape) {

    /* Reduce body padding for more content space */
    body {
        padding: 0 !important;
        min-height: 100dvh;
        overflow-x: hidden;
    }

    /* Compact navigation */
    .top-nav {
        padding: 20px 10px 10px !important;
        margin-bottom: 8px !important;
    }

    .back-btn {
        width: 32px !important;
        height: 32px !important;
        border-radius: 8px !important;
    }

    .back-btn svg {
        width: 18px !important;
        height: 18px !important;
    }

    .branding {
        padding: 0 !important;
        display: flex !important;
        align-items: center !important;
        gap: 8px !important;
    }

    .branding-icon span {
        font-size: 12px !important;
    }


    .branding-text {
        font-size: 13px !important;
    }

    .nav-icon,
    .theme-toggle,
    .theme-fab {
        width: 32px !important;
        height: 32px !important;
        border-radius: 8px !important;
    }

    .theme-toggle::before {
        display: none !important;
    }

    .nav-icon svg,
    .theme-toggle svg,
    .theme-fab svg {
        width: 18px !important;
        height: 18px !important;
    }

    .nav-icons {
        gap: 8px !important;
    }

    /* Page titles compact */
    .page-title {
        margin-bottom: 10px !important;
    }

    .page-title h1 {
        font-size: 20px !important;
        letter-spacing: 1px !important;
    }

    .page-title p {
        font-size: 12px !important;
        margin-top: 4px !important;
    }

    /* Cards compact */
    .card {
        padding: 15px 20px !important;
        border-radius: 12px !important;
    }

    .card-icon {
        width: 32px !important;
        height: 32px !important;
        margin-bottom: 8px !important;
    }

    .card-title {
        font-size: 16px !important;
        letter-spacing: 1px !important;
    }

    .card-subtitle {
        font-size: 11px !important;
    }

    .corner-deco {
        width: 15px !important;
        height: 15px !important;
    }

    /* Content cards compact */
    .content-card {
        padding: 15px !important;
        border-radius: 14px !important;
        margin-bottom: 10px !important;
    }

    .lesson-title {
        font-size: 20px !important;
        margin-bottom: 5px !important;
    }

    .lesson-subtitle {
        font-size: 13px !important;
        margin-bottom: 12px !important;
        padding-bottom: 10px !important;
    }

    .description {
        font-size: 13px !important;
        line-height: 1.5 !important;
        margin-bottom: 12px !important;
    }

    /* Code blocks compact */
    .code-section {
        margin-bottom: 12px !important;
    }

    .code-label {
        font-size: 14px !important;
        margin-bottom: 8px !important;
    }

    .code-label svg {
        width: 16px !important;
        height: 16px !important;
    }

    .code-header {
        padding: 6px 12px !important;
    }

    .code-filename {
        font-size: 11px !important;
    }

    .copy-btn {
        padding: 4px 10px !important;
        font-size: 10px !important;
    }

    .copy-btn svg {
        width: 12px !important;
        height: 12px !important;
    }

    .code-content {
        padding: 12px !important;
    }

    .code-content pre {
        font-size: 12px !important;
        line-height: 1.5 !important;
    }

    /* Output section compact */
    .output-section {
        margin-bottom: 12px !important;
    }

    .output-label {
        font-size: 14px !important;
        margin-bottom: 8px !important;
    }

    .output-box {
        padding: 15px !important;
        min-height: 50px !important;
    }

    .output-box .demo-text {
        font-size: 18px !important;
    }

    /* Buttons compact */
    .try-btn,
    .start-btn {
        padding: 10px 20px !important;
        font-size: 13px !important;
        border-radius: 8px !important;
    }

    .try-btn svg {
        width: 16px !important;
        height: 16px !important;
    }

    .nav-buttons {
        gap: 10px !important;
    }

    .nav-btn {
        padding: 10px 15px !important;
        font-size: 12px !important;
        border-radius: 8px !important;
    }

    .nav-btn svg {
        width: 14px !important;
        height: 14px !important;
    }

    .nav-button {
        padding: 12px 20px !important;
        font-size: 14px !important;
        border-radius: 10px !important;
        letter-spacing: 1px !important;
    }

    /* Instruction card compact */
    .instruction-card {
        padding: 15px !important;
        gap: 12px !important;
    }

    .instruction-icon {
        width: 50px !important;
        height: 50px !important;
    }

    .instruction-text {
        font-size: 16px !important;
    }

    /* Tutorial display */
    .tutorial-display {
        border-radius: 14px !important;
    }

    .tutorial-placeholder {
        padding: 20px !important;
        font-size: 14px !important;
    }

    .arrow-indicator svg {
        width: 40px !important;
        height: 40px !important;
    }

    /* Voice assist compact */
    .voice-assist {
        padding: 5px 12px !important;
        border-radius: 20px !important;
        gap: 8px !important;
    }

    .voice-assist-label {
        font-size: 12px !important;
    }

    .toggle-switch {
        width: 36px !important;
        height: 20px !important;
        border-radius: 10px !important;
    }

    .toggle-switch::after {
        width: 16px !important;
        height: 16px !important;
    }

    .toggle-switch.active::after {
        left: 18px !important;
    }

    /* Bottom bar compact */
    .bottom-bar {
        margin-top: 8px !important;
        padding: 0 5px !important;
    }

    .bottom-icon {
        width: 36px !important;
        height: 36px !important;
    }

    .bottom-icon svg {
        width: 20px !important;
        height: 20px !important;
    }

    .bottom-icons {
        gap: 10px !important;
    }

    /* Sidebar compact */
    .sidebar {
        padding: 8px 6px !important;
        border-radius: 0 10px 10px 0 !important;
    }

    .sidebar-icon {
        width: 30px !important;
        height: 30px !important;
        border-radius: 6px !important;
    }

    .sidebar-icon svg {
        width: 18px !important;
        height: 18px !important;
    }

    .sidebar-label {
        font-size: 9px !important;
    }

    /* Byte cards compact */
    .byte-card {
        flex: 0 0 240px !important;
        min-width: 240px !important;
        height: auto !important;
        min-height: 200px !important;
        padding: 15px !important;
    }

    .card-header {
        font-size: 14px !important;
        margin-bottom: 12px !important;
    }

    .card-content {
        padding: 12px !important;
        margin-bottom: 12px !important;
        border-radius: 10px !important;
    }

    .text-content {
        font-size: 16px !important;
    }

    .image-content svg {
        width: 50px !important;
        height: 50px !important;
    }

    .toggle-circle {
        width: 20px !important;
        height: 20px !important;
    }

    .toggle-label {
        font-size: 13px !important;
    }

    .apk-description {
        font-size: 11px !important;
    }

    /* Cards wrapper */
    .cards-wrapper {
        padding: 10px 0 !important;
    }

    .cards-container {
        padding: 10px 15px !important;
        gap: 15px !important;
    }

    /* Scroll hint compact */
    .scroll-hint svg {
        width: 22px !important;
        height: 22px !important;
    }

    /* Next bytes sidebar compact */
    .sidebar-title {
        font-size: 14px !important;
        margin-bottom: 10px !important;
    }

    .sidebar-title svg {
        width: 18px !important;
        height: 18px !important;
    }

    .next-byte-card {
        padding: 10px !important;
        gap: 10px !important;
    }

    .byte-thumbnail {
        width: 55px !important;
        height: 40px !important;
    }

    .byte-thumbnail svg {
        width: 20px !important;
        height: 20px !important;
    }

    .byte-info h4 {
        font-size: 12px !important;
    }

    .byte-info span {
        font-size: 10px !important;
    }

    .byte-number {
        font-size: 8px !important;
        padding: 2px 6px !important;
    }


}

/* ===== LANDSCAPE MOBILE - Index page specific ===== */
@media screen and (max-height: 500px) and (orientation: landscape) {

    /* Ensure main container fills screen properly */
    .main-container {
        height: 100dvh !important;
        overflow: hidden !important;
    }

    /* Left section scrollable area */
    .left-section {
        height: calc(100% - 10px) !important;
        margin: 5px !important;
        border-radius: 14px !important;
    }

    /* Right section cards */
    .right-section {
        gap: 8px !important;
        padding: 5px 8px !important;
    }

    /* Roadmap buttons - touch-friendly sizing */
    .roadmap-btn {
        min-height: 30px !important;
    }
}

/* ===== LANDSCAPE MOBILE - Tutorial page specific ===== */
@media screen and (max-height: 500px) and (orientation: landscape) {
    .main-content {
        gap: 12px !important;
    }

    .right-panel {
        width: 200px !important;
        gap: 10px !important;
    }
}

/* ===== LANDSCAPE MOBILE - Bytes tutorial page specific ===== */
@media screen and (max-height: 500px) and (orientation: landscape) {
    .page-wrapper {
        gap: 12px !important;
    }

    .sidebar.bytes-sidebar {
        width: 220px !important;
    }

    .next-bytes-list {
        gap: 8px !important;
    }
}

/* ===== TOUCH OPTIMIZATION ===== */
/* Ensure touch targets are at least 44px for accessibility */
@media (pointer: coarse) {

    button,
    a.back-btn,
    .nav-icon,
    .theme-toggle,
    .theme-fab,
    .branding-icon,
    .bottom-icon,
    .sidebar-icon,
    .roadmap-btn,
    .nav-btn,
    .nav-button,
    .start-btn,
    .try-btn,
    .copy-btn,
    .byte-card,
    .next-byte-card,
    .toggle-switch {
        min-height: 32px !important;
        cursor: pointer;
    }
}

/* ===== WEBVIEW SCROLLBAR OPTIMIZATION ===== */
/* Hide scrollbars on mobile WebView for cleaner look */
@media screen and (max-height: 500px) and (orientation: landscape) {

    .left-section::-webkit-scrollbar,
    .cards-container::-webkit-scrollbar {
        height: 4px !important;
        width: 4px !important;
    }

    .left-section::-webkit-scrollbar-thumb,
    .cards-container::-webkit-scrollbar-thumb {
        border-radius: 2px !important;
    }
}

/* ===== PREVENT DOUBLE-TAP ZOOM ===== */
* {
    touch-action: manipulation;
}

/* ===== FIX 100dvh ON MOBILE ===== */
@supports (-webkit-touch-callout: none) {
    body {
        min-height: -webkit-fill-available;
    }
}

/* ===== PERFORMANCE OPTIMIZATIONS ===== */
@media screen and (max-height: 500px) and (orientation: landscape) {

    /* Reduce animation complexity on mobile */
    @keyframes gradientShift {

        0%,
        100% {
            background-position: 0% 50%;
        }

        50% {
            background-position: 100% 50%;
        }
    }

    /* Simplify backdrop blur on lower-end devices */
    /* @supports not (backdrop-filter: blur(10px)) {

        .glass-bg,
        .card,
        .byte-card,
        .content-card,
        .instruction-card,
        .nav-icon,
        .back-btn {
            background: rgba(0, 0, 0, 0.6) !important;
        }
    } */
}

/* ===== LANDSCAPE MOBILE - Quiz page specific ===== */
@media screen and (max-height: 500px) and (orientation: landscape) {
    .quiz-container {
        max-width: 100% !important;
        padding: 15px 20px !important;
        border-radius: 16px !important;
    }

    .quiz-header {
        margin-bottom: 12px !important;
    }

    .quiz-title {
        font-size: 22px !important;
        margin-bottom: 5px !important;
    }

    .quiz-progress {
        font-size: 13px !important;
    }

    .question-box {
        padding: 15px !important;
        margin-bottom: 12px !important;
        border-radius: 12px !important;
    }

    .question-text {
        font-size: 16px !important;
    }

    .options-grid {
        gap: 8px !important;
        margin-bottom: 15px !important;
    }

    .option-btn {
        padding: 10px 14px !important;
        font-size: 14px !important;
        border-radius: 10px !important;
    }

    .next-btn {
        padding: 12px !important;
        font-size: 14px !important;
        border-radius: 10px !important;
    }

    .back-home {
        width: 35px !important;
        height: 35px !important;
        top: 10px !important;
        left: 10px !important;
        border-radius: 8px !important;
    }

    .back-home svg {
        width: 18px !important;
        height: 18px !important;
    }

    .score-circle {
        width: 100px !important;
        height: 100px !important;
        font-size: 26px !important;
        margin-bottom: 15px !important;
    }

    .result-msg {
        font-size: 18px !important;
        margin-bottom: 15px !important;
    }
}

/* ===== LANDSCAPE MOBILE - Chatbot page specific ===== */
@media screen and (max-height: 500px) and (orientation: landscape) {
    .chat-container {
        border-radius: 14px !important;
    }

    .chat-header {
        padding: 10px 15px !important;
        gap: 10px !important;
    }

    .chat-title {
        font-size: 16px !important;
    }

    .chat-messages {
        padding: 10px 15px !important;
        gap: 10px !important;
    }

    .message {
        padding: 10px 14px !important;
        font-size: 14px !important;
        border-radius: 14px !important;
    }

    .chat-input-area {
        padding: 10px 15px !important;
        gap: 10px !important;
    }

    .chat-input {
        padding: 10px 16px !important;
        font-size: 14px !important;
    }

    .send-btn {
        width: 40px !important;
        height: 40px !important;
    }

    .send-btn svg {
        width: 18px !important;
        height: 18px !important;
    }
}


/* ===== PREVENT DOUBLE-TAP ZOOM ===== */
* {
    touch-action: manipulation;
}

/* ===== FIX 100dvh ON MOBILE ===== */
@supports (-webkit-touch-callout: none) {
    body {
        min-height: -webkit-fill-available;
    }
}

/* ===== PERFORMANCE OPTIMIZATIONS ===== */
@media screen and (max-height: 500px) and (orientation: landscape) {

    /* Reduce animation complexity on mobile */
    @keyframes gradientShift {

        0%,
        100% {
            background-position: 0% 50%;
        }

        50% {
            background-position: 100% 50%;
        }
    }

    /* Simplify backdrop blur on lower-end devices */
    /* @supports not (backdrop-filter: blur(10px)) {

        .glass-bg,
        .card,
        .byte-card,
        .content-card,
        .instruction-card,
        .nav-icon,
        .back-btn {
            background: rgba(0, 0, 0, 0.6) !important;
        }
    } */
}

/* ===== LANDSCAPE MOBILE - Quiz page specific ===== */
@media screen and (max-height: 500px) and (orientation: landscape) {
    .quiz-container {
        max-width: 100% !important;
        padding: 15px 20px !important;
        border-radius: 16px !important;
    }

    .quiz-header {
        margin-bottom: 12px !important;
    }

    .quiz-title {
        font-size: 22px !important;
        margin-bottom: 5px !important;
    }

    .quiz-progress {
        font-size: 13px !important;
    }

    .question-box {
        padding: 15px !important;
        margin-bottom: 12px !important;
        border-radius: 12px !important;
    }

    .question-text {
        font-size: 16px !important;
    }

    .options-grid {
        gap: 8px !important;
        margin-bottom: 15px !important;
    }

    .option-btn {
        padding: 10px 14px !important;
        font-size: 14px !important;
        border-radius: 10px !important;
    }

    .next-btn {
        padding: 12px !important;
        font-size: 14px !important;
        border-radius: 10px !important;
    }

    .back-home {
        width: 35px !important;
        height: 35px !important;
        top: 10px !important;
        left: 10px !important;
        border-radius: 8px !important;
    }

    .back-home svg {
        width: 18px !important;
        height: 18px !important;
    }

    .score-circle {
        width: 100px !important;
        height: 100px !important;
        font-size: 26px !important;
        margin-bottom: 15px !important;
    }

    .result-msg {
        font-size: 18px !important;
        margin-bottom: 15px !important;
    }
}

/* ===== LANDSCAPE MOBILE - Chatbot page specific ===== */
@media screen and (max-height: 500px) and (orientation: landscape) {
    .chat-container {
        border-radius: 14px !important;
    }

    .chat-header {
        padding: 10px 15px !important;
        gap: 10px !important;
    }

    .chat-title {
        font-size: 16px !important;
    }

    .chat-messages {
        padding: 10px 15px !important;
        gap: 10px !important;
    }

    .message {
        padding: 10px 14px !important;
        font-size: 14px !important;
        border-radius: 14px !important;
    }

    .chat-input-area {
        padding: 10px 15px !important;
        gap: 10px !important;
    }

    .chat-input {
        padding: 10px 16px !important;
        font-size: 14px !important;
    }

    .send-btn {
        width: 40px !important;
        height: 40px !important;
    }

    .send-btn svg {
        width: 18px !important;
        height: 18px !important;
    }
}





/* Prevent absolute centered logo from overlapping nav buttons on constrained scopes */
@media screen and (max-height: 499px) and (orientation: landscape), screen and (max-width: 650px) and (orientation: portrait) {
    .top-nav {
        display: grid !important;
        grid-template-columns: 1fr auto 1fr !important;
        align-items: center !important;
    }
    .nav-center-brand {
        position: static !important;
        transform: none !important;
        grid-column: 2 !important;
        justify-self: center !important;
        width: max-content !important;
    }
    .nav-left, .search-container {
        grid-column: 1 !important;
        justify-self: start !important;
        flex: unset !important;
    }
    .nav-icons, .nav-right {
        grid-column: 3 !important;
        justify-self: end !important;
        flex: unset !important;
    }
}

/* ============================================================
   MOBILE WEBVIEW PERFORMANCE OVERRIDES (Touch-First 60fps Scrolling & Snappy Click Responses)
   ============================================================ */


@media (pointer: coarse) {
    .left-section,
    .scroll-wrapper,
    .cards-container,
    .h-scroll-row,
    .landscape-scroller,
    .chat-messages,
    .settings-wrapper,
    .bytes-container,
    .track-wrapper,
    .main-container {
        will-change: transform, scroll-position !important;
        transform: translate3d(0, 0, 0) !important;
        -webkit-overflow-scrolling: touch !important;
    }

    /* Disable expensive blur filters globally to eliminate major WebView rendering bottleneck during scrolling */
    *, *::before, *::after {
        backdrop-filter: none !important;
        -webkit-backdrop-filter: none !important;
    }

    /* Slightly increase opacity of transparent backgrounds on touch devices to preserve high contrast/readability without blur */
    :root {
        --glass-bg: rgba(255, 255, 255, 0.85) !important;
        --glass-bg-strong: rgba(255, 255, 255, 0.9) !important;
        --card-bg: rgba(255, 255, 255, 0.85) !important;
    }
    [data-theme="dark"] {
        --glass-bg: rgba(20, 20, 35, 0.92) !important;
        --glass-bg-strong: rgba(30, 30, 50, 0.95) !important;
        --card-bg: rgba(25, 25, 45, 0.9) !important;
    }

    /* Disable transition delays on hover to prevent "sticky" hover states and tap delays on touch-only screens */
    @media (hover: hover) {
        *:hover {
        transition-duration: 0s !important;
        -webkit-transition-duration: 0s !important;
        }
    }

    /* Fast, crisp active tap feedback (0s delay transition-duration when active) */
    *:active {
        transition-duration: 0s !important;
        -webkit-transition-duration: 0s !important;
    }
}

/* ===== UNIFIED HEADER DESIGN SYSTEM ===== */
:root {
    --nav-height: 60px;
    --nav-padding: 10px 20px;
    --nav-item-size: 42px;
    --nav-logo-size: 42px;
    --nav-logo-text-fs: 18px;
    --nav-search-height: 42px;
    --nav-search-fs: 16px;
    --nav-icon-svg-size: 24px;
}

/* Landscape / Small Mobile Screens */
@media screen and (orientation: landscape), screen and (max-height: 500px), screen and (max-width: 600px) {
    :root {
        --nav-height: 44px;
        --nav-padding: 0 12px;
        --nav-item-size: 32px;
        --nav-logo-size: 32px;
        --nav-logo-text-fs: 14px;
        --nav-search-height: 32px;
        --nav-search-fs: 16px;
        --nav-icon-svg-size: 18px;
    }
}

/* Tablet / Medium Screens */
@media screen and (min-height: 700px) {
    :root {
        --nav-height: 70px;
        --nav-padding: 15px 25px;
        --nav-item-size: 46px;
        --nav-logo-size: 46px;
        --nav-logo-text-fs: 20px;
        --nav-search-height: 46px;
        --nav-search-fs: 16px;
        --nav-icon-svg-size: 24px;
    }
}

/* Large Desktop Displays */
@media screen and (min-width: 1400px) and (min-height: 900px) {
    :root {
        --nav-height: 80px;
        --nav-padding: 15px 30px;
        --nav-item-size: 54px;
        --nav-logo-size: 54px;
        --nav-logo-text-fs: 24px;
        --nav-search-height: 54px;
        --nav-search-fs: 18px;
        --nav-icon-svg-size: 26px;
    }
}

/* Link page container offset overrides dynamically */
html, body, :root {
    --header-h: var(--nav-height) !important;
}

/* High specificity header rules to cleanly override inline/local file rules */
html body nav.top-nav.top-nav, 
html body .top-nav.top-nav, 
html body .chat-header.chat-header {
    height: var(--nav-height) !important;
    padding: var(--nav-padding) !important;
    box-sizing: border-box !important;
}

/* Logo container size standardisation */
html body .branding-icon.branding-icon {
    width: var(--nav-logo-size) !important;
    height: var(--nav-logo-size) !important;
    border-radius: calc(var(--nav-logo-size) * 0.28) !important;
}

/* Logo text standardisation */
html body .branding-text.branding-text,
html body .support-name.support-name {
    font-size: var(--nav-logo-text-fs) !important;
}

/* Search bar size standardisation */
html body .search-bar.search-bar {
    height: var(--nav-search-height) !important;
}

/* Search input font standardisation */
html body .search-input.search-input {
    font-size: var(--nav-search-fs) !important;
}

/* Back button and navigation icon standardisation */
html body .back-btn.back-btn,
html body .nav-icon.nav-icon {
    width: var(--nav-item-size) !important;
    height: var(--nav-item-size) !important;
    border-radius: calc(var(--nav-item-size) * 0.28) !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
}

/* SVG icons size standardisation */
html body .back-btn.back-btn svg,
html body .nav-icon.nav-icon svg,
html body .chat-header.chat-header svg {
    width: var(--nav-icon-svg-size) !important;
    height: var(--nav-icon-svg-size) !important;
}

/* ===== LANDSCAPE MOBILE ENFORCER (PORTRAIT BLOCKER) ===== */
#landscape-prompt {
    display: none;
}

@media screen and (orientation: portrait), screen and (max-aspect-ratio: 1/1) {
    /* Hide all main contents on portrait orientation, unless body has allow-portrait */
    body:not(.allow-portrait) > *:not(#landscape-prompt):not(#procoding-splash) {
        display: none !important;
    }

    /* Hide the rotate prompt while the splash screen is still visible */
    body:has(#procoding-splash) #landscape-prompt {
        display: none !important;
    }

    html:not(.allow-portrait):not(:has(body.allow-portrait)), body:not(.allow-portrait) {
        background: #020617 !important;
        overflow: hidden !important;
        height: 100dvh !important;
        width: 100vw !important;
        margin: 0 !important;
        padding: 0 !important;
    }

    body:not(.allow-portrait) #landscape-prompt {
        position: fixed !important;
        inset: 0 !important;
        z-index: 999999 !important;
        background-color: #020617 !important;
        display: flex !important;
        flex-direction: column !important;
        align-items: center !important;
        justify-content: center !important;
        color: #ffffff !important;
        text-align: center !important;
        box-sizing: border-box !important;
        padding: 20px !important;
    }
    
    body:not(.allow-portrait) #landscape-prompt svg {
        width: 64px !important;
        height: 64px !important;
        margin-bottom: 24px !important;
        color: #22d3ee !important; /* cyan-400 */
        animation: pulse-glow 2s cubic-bezier(0.4, 0, 0.6, 1) infinite !important;
    }

    body:not(.allow-portrait) #landscape-prompt h2 {
        font-family: 'Outfit', sans-serif !important;
        font-size: 24px !important;
        font-weight: 700 !important;
        margin: 0 0 8px 0 !important;
        padding: 0 16px !important;
        line-height: 1.2 !important;
        color: #ffffff !important;
    }

    body:not(.allow-portrait) #landscape-prompt p {
        font-family: 'Outfit', sans-serif !important;
        font-size: 14px !important;
        color: #94a3b8 !important; /* slate-400 */
        margin: 0 !important;
        padding: 0 24px !important;
        line-height: 1.4 !important;
    }
}

@keyframes pulse-glow {
    0%, 100% {
        opacity: 1;
        transform: scale(1);
        filter: drop-shadow(0 0 0px rgba(34, 211, 238, 0));
    }
    50% {
        opacity: .5;
        transform: scale(1.05);
        filter: drop-shadow(0 0 15px rgba(34, 211, 238, 0.6));
    }
}

/* ========================================
   ANDROID STYLE SPLASH SCREEN
   ======================================== */
.splash-overlay {
    position: fixed;
    inset: 0;
    z-index: 1000000;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: var(--bg-primary) !important;
    background-size: 100% 100% !important;
    transition: opacity 0.25s ease;
    pointer-events: all;
}

html:not([data-theme="dark"]) .splash-overlay {
    background: #ffffff !important;
}
html[data-theme="dark"] .splash-overlay {
    background: #000000 !important;
}

.splash-images-container {
    position: relative;
    width: 200px;
    height: 200px;
}

.splash-img {
    position: absolute;
    width: 200px;
    height: 200px;
    top: 0;
    left: 0;
    opacity: 0;
    animation-fill-mode: forwards;
}

.s-slide-down {
    animation: s-slide-y-down 0.6s cubic-bezier(0, 0, 0.2, 1) forwards;
    animation-delay: 0s;
}

.s-slide-right {
    animation: s-slide-x-right 0.6s cubic-bezier(0, 0, 0.2, 1) forwards;
    animation-delay: 0.4s;
}

.s-slide-up {
    animation: s-slide-y-up 0.6s cubic-bezier(0, 0, 0.2, 1) forwards;
    animation-delay: 0.8s;
}

.s-slide-left {
    animation: s-slide-x-left 0.6s cubic-bezier(0, 0, 0.2, 1) forwards;
    animation-delay: 1.2s;
}

.s-slide-down-delayed {
    animation: s-slide-y-down 0.6s cubic-bezier(0, 0, 0.2, 1) forwards;
    animation-delay: 1.6s;
}

.splash-text {
    font-family: 'Outfit', sans-serif;
    font-size: 28px;
    font-weight: bold;
    background: linear-gradient(to right, #FF512F, #F09819);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-top: 24px;
    opacity: 0;
    animation: s-fade-in 0.5s forwards;
    animation-delay: 2s;
}

@keyframes s-slide-y-down {
    0% { transform: translateY(-100%); opacity: 0; }
    100% { transform: translateY(0); opacity: 1; }
}

@keyframes s-slide-x-right {
    0% { transform: translateX(100%); opacity: 0; }
    100% { transform: translateX(0); opacity: 1; }
}

@keyframes s-slide-y-up {
    0% { transform: translateY(100%); opacity: 0; }
    100% { transform: translateY(0); opacity: 1; }
}

@keyframes s-slide-x-left {
    0% { transform: translateX(-100%); opacity: 0; }
    100% { transform: translateX(0); opacity: 1; }
}

@keyframes s-fade-in {
    0% { opacity: 0; }
    100% { opacity: 1; }
}

/* Exit Stage */
.splash-overlay.splash-exit-android {
    opacity: 0;
    pointer-events: none;
}

/* ===== DYNAMIC CARD PALETTES ===== */
/* Light Mode (Distinct, high-contrast curated color spectrum) */
.card-palette-0  { background: #F6CD72; backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px); border: 1px solid #E5BA5A; } /* Amber Gold */
.card-palette-1  { background: #4B9EE3; backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px); border: 1px solid #2C7AC5; } /* Royal Blue */
.card-palette-2  { background: #FF8585; backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px); border: 1px solid #E05353; } /* Coral Red */
.card-palette-3  { background: #E2E8F0; backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px); border: 1px solid #CBD5E1; } /* Smoky White / Frost */
.card-palette-4  { background: #34D399; backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px); border: 1px solid #059669; } /* Deep Emerald */
.card-palette-5  { background: #C4B5FD; backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px); border: 1px solid #8B5CF6; } /* Soft Lavender */
.card-palette-6  { background: #FB923C; backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px); border: 1px solid #EA580C; } /* Sunset Orange */
.card-palette-7  { background: #94A3B8; backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px); border: 1px solid #64748B; } /* Slate Grey */
.card-palette-8  { background: #38BDF8; backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px); border: 1px solid #0284C7; } /* Sky Cyan */
.card-palette-9  { background: #F472B6; backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px); border: 1px solid #DB2777; } /* Bubblegum Pink */
.card-palette-10 { background: #A3E635; backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px); border: 1px solid #65A30D; } /* Olive Sage */
.card-palette-11 { background: #818CF8; backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px); border: 1px solid #4F46E5; } /* Midnight Indigo */
.card-palette-12 { background: #E9D5A1; backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px); border: 1px solid #C4A45A; } /* Champagne Sandstone */
.card-palette-13 { background: #64748B; backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px); border: 1px solid #475569; color: #fff; } /* Dark Charcoal */
.card-palette-14 { background: #6EE7B7; backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px); border: 1px solid #10B981; } /* Aquamarine */
.card-palette-15 { background: #E879F9; backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px); border: 1px solid #C026D3; } /* Vivid Fuchsia */
.card-palette-16 { background: #E07A5F; backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px); border: 1px solid #C85A3D; } /* Warm Terracotta */
.card-palette-17 { background: #2DD4BF; backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px); border: 1px solid #0D9488; } /* Deep Teal */
.card-palette-18 { background: #FDA4AF; backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px); border: 1px solid #E11D48; } /* Wine Burgundy */
.card-palette-19 { background: #BEF264; backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px); border: 1px solid #84CC16; } /* Electric Chartreuse */

/* Dark Mode (Deeper, glowing glassmorphic backgrounds for contrast) */
[data-theme="dark"] .card-palette-0  { background: rgba(217, 119, 6, 0.28); backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px); border: 1px solid rgba(245, 158, 11, 0.45); } /* Amber */
[data-theme="dark"] .card-palette-1  { background: rgba(37, 99, 235, 0.28); backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px); border: 1px solid rgba(59, 130, 246, 0.45); } /* Blue */
[data-theme="dark"] .card-palette-2  { background: rgba(220, 38, 38, 0.28); backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px); border: 1px solid rgba(239, 68, 68, 0.45); } /* Red */
[data-theme="dark"] .card-palette-3  { background: rgba(248, 250, 252, 0.14); backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px); border: 1px solid rgba(255, 255, 255, 0.35); } /* Smoky White / Frost */
[data-theme="dark"] .card-palette-4  { background: rgba(5, 150, 105, 0.28); backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px); border: 1px solid rgba(16, 185, 129, 0.45); } /* Deep Emerald */
[data-theme="dark"] .card-palette-5  { background: rgba(139, 92, 246, 0.28); backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px); border: 1px solid rgba(167, 139, 250, 0.45); } /* Lavender */
[data-theme="dark"] .card-palette-6  { background: rgba(234, 88, 12, 0.28); backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px); border: 1px solid rgba(251, 146, 60, 0.45); } /* Orange */
[data-theme="dark"] .card-palette-7  { background: rgba(100, 116, 139, 0.32); backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px); border: 1px solid rgba(148, 163, 184, 0.5); } /* Slate Grey */
[data-theme="dark"] .card-palette-8  { background: rgba(14, 165, 233, 0.28); backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px); border: 1px solid rgba(56, 189, 248, 0.45); } /* Cyan */
[data-theme="dark"] .card-palette-9  { background: rgba(219, 39, 119, 0.28); backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px); border: 1px solid rgba(244, 114, 182, 0.45); } /* Pink */
[data-theme="dark"] .card-palette-10 { background: rgba(101, 163, 13, 0.28); backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px); border: 1px solid rgba(132, 204, 22, 0.45); } /* Olive Sage */
[data-theme="dark"] .card-palette-11 { background: rgba(67, 56, 202, 0.32); backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px); border: 1px solid rgba(99, 102, 241, 0.5); } /* Midnight Indigo */
[data-theme="dark"] .card-palette-12 { background: rgba(180, 140, 80, 0.25); backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px); border: 1px solid rgba(217, 180, 120, 0.45); } /* Champagne Sandstone */
[data-theme="dark"] .card-palette-13 { background: rgba(30, 41, 59, 0.65); backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px); border: 1px solid rgba(100, 116, 139, 0.55); color: #fff; } /* Dark Charcoal */
[data-theme="dark"] .card-palette-14 { background: rgba(16, 185, 129, 0.28); backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px); border: 1px solid rgba(52, 211, 153, 0.45); } /* Aqua */
[data-theme="dark"] .card-palette-15 { background: rgba(192, 38, 211, 0.28); backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px); border: 1px solid rgba(232, 121, 249, 0.45); } /* Vivid Fuchsia */
[data-theme="dark"] .card-palette-16 { background: rgba(194, 65, 12, 0.30); backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px); border: 1px solid rgba(249, 115, 22, 0.45); } /* Warm Terracotta */
[data-theme="dark"] .card-palette-17 { background: rgba(13, 148, 136, 0.28); backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px); border: 1px solid rgba(45, 212, 191, 0.45); } /* Deep Teal */
[data-theme="dark"] .card-palette-18 { background: rgba(159, 18, 57, 0.32); backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px); border: 1px solid rgba(225, 29, 72, 0.5); } /* Wine Burgundy */
[data-theme="dark"] .card-palette-19 { background: rgba(132, 204, 22, 0.28); backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px); border: 1px solid rgba(163, 230, 53, 0.45); } /* Chartreuse */

/* ===== iOS WEBVIEW FIXES ===== */
/* Fixes multiple tap issues on iOS by defining interactive targets properly */
a, button, [role="button"], input[type="button"], input[type="submit"], .btn, .card, .nav-icon, select {
    cursor: pointer;
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
}
