/* ==========================================================================
   GRADEUP PRO NATIVE APP SHELL — UNIFIED DESKTOP & MOBILE SYSTEM
   Aesthetics: White & Royal Blue (#1e40af / #2563eb / #3b82f6)
   Physics: Apple-Grade Spring Deceleration cubic-bezier(0.175, 0.885, 0.32, 1.1)
   Platforms: macOS, Windows, Android, iOS
   ========================================================================== */

:root {
    /* Brand Tokens */
    --gu-blue-900: #1e3a8a;
    --gu-blue-800: #1e40af;
    --gu-blue-600: #2563eb;
    --gu-blue-500: #3b82f6;
    --gu-blue-100: #dbeafe;
    --gu-blue-50:  #eff6ff;
    
    --gu-emerald-500: #10b981;
    --gu-emerald-100: #d1fae5;
    
    --gu-surface-bg: #f8fafc;
    --gu-surface-card: #ffffff;
    --gu-border: #e2e8f0;
    --gu-border-hover: #cbd5e1;
    
    --gu-text-main: #0f172a;
    --gu-text-muted: #64748b;
    --gu-text-light: #94a3b8;

    /* Spring Animation Tokens */
    --gu-spring: cubic-bezier(0.175, 0.885, 0.32, 1.1);
    --gu-ease-out: cubic-bezier(0.16, 1, 0.3, 1);
    --gu-trans-fast: 120ms;
    --gu-trans-normal: 240ms;
}

/* ==========================================================================
   GLOBAL TACTILE & SPRING PRESS FEEDBACK
   ========================================================================== */
.btn, 
.gu-tab-btn-pill, 
.gu-interactive-btn, 
.gu-card-action,
.gu-bottom-nav-item {
    transition: transform var(--gu-trans-fast) var(--gu-spring), 
                box-shadow var(--gu-trans-fast) var(--gu-ease-out),
                background-color var(--gu-trans-fast) ease !important;
}

.btn:active, 
.gu-tab-btn-pill:active, 
.gu-interactive-btn:active,
.gu-bottom-nav-item:active {
    transform: scale(0.96) !important;
}

/* Shimmer Loading Animations */
@keyframes guShimmer {
    0% { background-position: -200% 0; }
    100% { background-position: 200% 0; }
}

.gu-skeleton {
    background: linear-gradient(90deg, 
        rgba(226, 232, 240, 0.4) 25%, 
        rgba(226, 232, 240, 0.8) 37%, 
        rgba(226, 232, 240, 0.4) 63%
    ) !important;
    background-size: 200% 100% !important;
    animation: guShimmer 1.4s ease infinite !important;
    border-radius: 8px;
}

/* ==========================================================================
   DESKTOP APP SPECIFIC STYLING (.app-platform-desktop)
   ========================================================================== */
body.app-platform-desktop {
    background-color: var(--gu-surface-bg) !important;
    overflow-x: hidden;
    user-select: none;
    -webkit-user-select: none;
}

/* macOS HiddenInset Window Drag Bar */
body.app-platform-desktop .gu-header,
body.app-platform-desktop .app-header {
    -webkit-app-region: drag;
    padding-top: 12px;
}

body.app-platform-desktop .gu-header a,
body.app-platform-desktop .gu-header button,
body.app-platform-desktop .gu-header input,
body.app-platform-desktop .gu-header .dropdown,
body.app-platform-desktop .app-header a,
body.app-platform-desktop .app-header button {
    -webkit-app-region: no-drag;
}

/* Allow text selection inside study materials, questions, and notes */
body.app-platform-desktop .study-content,
body.app-platform-desktop .exam-question-body,
body.app-platform-desktop .card-body,
body.app-platform-desktop input,
body.app-platform-desktop textarea {
    user-select: text !important;
    -webkit-user-select: text !important;
}

/* Desktop Sleek Scrollbars */
body.app-platform-desktop ::-webkit-scrollbar {
    width: 7px;
    height: 7px;
}
body.app-platform-desktop ::-webkit-scrollbar-track {
    background: transparent;
}
body.app-platform-desktop ::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 10px;
}
body.app-platform-desktop ::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}

/* Suppress all web marketing clutter inside desktop app */
body.app-platform-desktop .gu-marketing-ribbon,
body.app-platform-desktop .app-download-banner,
body.app-platform-desktop .public-web-footer,
body.app-platform-desktop .download-app-cta {
    display: none !important;
}

/* ==========================================================================
   MOBILE APP SPECIFIC STYLING (.app-platform-mobile)
   ========================================================================== */
body.app-platform-mobile {
    overscroll-behavior-y: contain !important;
    touch-action: manipulation;
    -webkit-touch-callout: none !important;
    -webkit-user-select: none !important;
    -webkit-tap-highlight-color: transparent !important;
}

/* Allow text selection inside exam questions on mobile */
body.app-platform-mobile .exam-question-body,
body.app-platform-mobile .notes-reading-area {
    -webkit-user-select: text !important;
    user-select: text !important;
}

/* Mobile Safe Area Inset Support */
body.app-platform-mobile .gu-header,
body.app-platform-mobile .app-header,
body.app-platform-mobile .mobile-top-bar {
    padding-top: max(env(safe-area-inset-top, 0px), 12px) !important;
}

/* Frozen 5-Pillar Bottom Navigation Mobile Protection */
body.app-platform-mobile .gu-mobile-bottom-nav {
    padding-bottom: max(env(safe-area-inset-bottom, 0px), 8px) !important;
    background: rgba(255, 255, 255, 0.96) !important;
    backdrop-filter: blur(20px) !important;
    -webkit-backdrop-filter: blur(20px) !important;
    border-top: 1px solid rgba(226, 232, 240, 0.8) !important;
}

/* Sliding Tab Indicator on Active 5-Pillar Button */
.gu-mobile-bottom-nav .gu-bottom-nav-item.active .gu-tab-btn-pill {
    background: var(--gu-blue-50) !important;
    color: var(--gu-blue-600) !important;
    position: relative;
    box-shadow: 0 2px 8px rgba(37, 99, 235, 0.15) !important;
}

.gu-mobile-bottom-nav .gu-bottom-nav-item.active .gu-tab-btn-pill::after {
    content: '';
    position: absolute;
    bottom: -3px;
    left: 50%;
    transform: translateX(-50%);
    width: 14px;
    height: 3px;
    background: var(--gu-blue-600);
    border-radius: 3px;
    transition: all var(--gu-trans-normal) var(--gu-spring);
}

.gu-mobile-bottom-nav .gu-bottom-nav-item.active .gu-nav-label {
    color: var(--gu-blue-600) !important;
    font-weight: 700 !important;
}

/* Floating AI Study Coach / Doubt Solver FAB */
.gu-floating-ai-fab {
    position: fixed;
    right: 18px;
    bottom: calc(76px + env(safe-area-inset-bottom, 0px));
    z-index: 9999;
    display: flex;
    align-items: center;
    gap: 8px;
    background: linear-gradient(135deg, var(--gu-blue-800) 0%, var(--gu-blue-600) 100%);
    color: #ffffff !important;
    padding: 10px 18px;
    border-radius: 50px;
    font-weight: 700;
    font-size: 0.88rem;
    box-shadow: 0 8px 24px rgba(37, 99, 235, 0.35);
    border: 1px solid rgba(255, 255, 255, 0.2);
    text-decoration: none !important;
    transition: transform var(--gu-trans-fast) var(--gu-spring);
}

.gu-floating-ai-fab:active {
    transform: scale(0.94);
}

/* Daily Habit Streak Animation */
@keyframes streakPulse {
    0% { transform: scale(1); filter: drop-shadow(0 0 2px rgba(245, 158, 11, 0.4)); }
    50% { transform: scale(1.08); filter: drop-shadow(0 0 8px rgba(245, 158, 11, 0.8)); }
    100% { transform: scale(1); filter: drop-shadow(0 0 2px rgba(245, 158, 11, 0.4)); }
}

.gu-streak-flame {
    display: inline-block;
    animation: streakPulse 2s infinite ease-in-out;
}

/* Multi-Child Switcher Pill (Parents) */
.gu-child-switcher-bar {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    padding: 8px 0;
    scrollbar-width: none;
}
.gu-child-switcher-bar::-webkit-scrollbar {
    display: none;
}

.gu-child-pill {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    background: #ffffff;
    border: 1.5px solid var(--gu-border);
    border-radius: 50px;
    font-size: 0.88rem;
    font-weight: 600;
    color: var(--gu-text-muted);
    white-space: nowrap;
    cursor: pointer;
    transition: all var(--gu-trans-fast) var(--gu-spring);
}

.gu-child-pill.active {
    background: var(--gu-blue-50);
    border-color: var(--gu-blue-600);
    color: var(--gu-blue-600);
    box-shadow: 0 2px 8px rgba(37, 99, 235, 0.12);
}
