/* 
 * ExamReportAI - PWA Mobile-First Premium Styles
 * Makes the app feel like a native mobile application
 */

/* Global PWA behavior: prevent pull-to-refresh on mobile only */
/* Global PWA behavior: prevent pull-to-refresh on mobile only */
/* Rule removed to ensure scrolling works on all devices */


/* ============================================

/* ============================================
   ERA BRAND ANIMATION SYSTEM
   ============================================ */

.era-logo-container {
    perspective: 1000px;
    cursor: default;
}

.era-block {
    display: inline-flex;
    align-items: baseline;
    overflow: hidden;
    margin-right: 0.1rem;
}

/* ERA expand spans - start hidden, animate to visible */
.era-expand {
    max-width: 0;
    opacity: 0;
    overflow: hidden;
    white-space: nowrap;
    display: inline-block;
    color: var(--text-primary);
    transition: max-width 1.5s cubic-bezier(0.34, 1.56, 0.64, 1), opacity 1.0s ease-out;
}

.era-letter {
    display: inline;
}

/* Animate state - Hover or Class */
.era-logo-container:hover .era-expand,
.era-logo-container.animate-in .era-expand {
    max-width: 150px;
    opacity: 1;
    margin-left: 0;
}

.era-brand-title {
    white-space: nowrap !important;
    overflow: visible !important;
    text-overflow: clip !important;
}

.era-tagline {
    white-space: nowrap;
}

/* ============================================
   MOBILE HEADER TWO-ROW LAYOUT
   ============================================ */

@media screen and (max-width: 767px) {

    /* Make header two-row on mobile */
    .era-header-desktop {
        flex-direction: column !important;
        height: auto !important;
        padding: 10px 0 !important;
        gap: 8px !important;
        align-items: stretch !important;
    }

    /* Logo row - centered */
    .era-logo-link {
        justify-content: center !important;
        gap: 10px !important;
    }

    /* Logo icon smaller on mobile */
    .era-logo-icon {
        width: 36px !important;
        height: 36px !important;
    }

    /* Brand title proper size on mobile */
    .era-brand-title {
        font-size: 20px !important;
    }

    /* Hide tagline on mobile to save space */
    .era-tagline {
        display: none !important;
    }

    /* Nav actions row - centered below logo */
    .era-nav-actions {
        justify-content: center !important;
        gap: 8px !important;
        border-top: 1px solid rgba(255, 255, 255, 0.05);
        padding-top: 8px !important;
    }

    .era-nav-actions .flex.items-center.gap-6 {
        gap: 6px !important;
    }

    .era-nav-actions .flex.items-center.gap-4 {
        gap: 6px !important;
    }

    /* Compact Quick Access button on mobile */
    #quickMenuBtn {
        padding: 6px 10px !important;
        font-size: 12px !important;
    }

    #quickMenuBtn span {
        display: none !important;
    }

    /* Compact Profile toggle on mobile */
    #profileToggle {
        padding: 4px 8px 4px 4px !important;
    }

    #profileToggle .hidden.sm\\:block {
        display: none !important;
    }

    /* Compact logout on mobile */
    .era-nav-actions a[href="/logout"] span,
    .era-nav-actions a[href="/logout"] {
        font-size: 12px !important;
        padding: 4px 8px !important;
    }
}

/* ============================================
   PWA SPLASH SCREEN & LOADING
   ============================================ */

/* Full-screen premium splash/loading overlay */
#pwa-splash {
    position: fixed;
    inset: 0;
    background: linear-gradient(135deg, #020617 0%, #0f172a 50%, #1e1b4b 100%);
    z-index: 99999;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    transition: opacity 0.6s ease, visibility 0.6s ease;
}

#pwa-splash.hidden {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

/* Logo container with glow effect */
.splash-logo {
    width: 120px;
    height: 120px;
    border-radius: 28px;
    background: linear-gradient(135deg, #6366f1, #8b5cf6, #a855f7);
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    animation: splashPulse 2s ease-in-out infinite;
    box-shadow:
        0 0 60px rgba(99, 102, 241, 0.5),
        0 0 120px rgba(139, 92, 246, 0.3);
}

.splash-logo img {
    width: 80%;
    height: 80%;
    object-fit: contain;
    filter: drop-shadow(0 4px 12px rgba(0, 0, 0, 0.3));
}

.splash-logo::before {
    content: '';
    position: absolute;
    inset: -3px;
    border-radius: 30px;
    background: linear-gradient(135deg, #6366f1, #a855f7, #ec4899, #6366f1);
    background-size: 300% 300%;
    animation: borderRotate 3s linear infinite;
    z-index: -1;
}

.splash-logo::after {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: 28px;
    background: linear-gradient(135deg, #020617, #0f172a);
}

.splash-logo img {
    z-index: 1;
}

/* Splash text */
.splash-title {
    margin-top: 32px;
    font-size: 28px;
    font-weight: 700;
    background: linear-gradient(135deg, #fff 0%, #a5b4fc 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: splashTextFade 1.5s ease-out both 0.3s;
}

.splash-subtitle {
    margin-top: 8px;
    font-size: 14px;
    color: #64748b;
    letter-spacing: 2px;
    text-transform: uppercase;
    animation: splashTextFade 1.5s ease-out both 0.5s;
}

/* Loading dots */
.splash-loader {
    margin-top: 48px;
    display: flex;
    gap: 8px;
    animation: splashTextFade 1.5s ease-out both 0.7s;
}

.splash-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #6366f1;
    animation: splashDotBounce 1.4s ease-in-out infinite both;
}

.splash-dot:nth-child(1) {
    animation-delay: 0s;
}

.splash-dot:nth-child(2) {
    animation-delay: 0.16s;
}

.splash-dot:nth-child(3) {
    animation-delay: 0.32s;
}

@keyframes splashPulse {

    0%,
    100% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.05);
    }
}

@keyframes borderRotate {
    0% {
        background-position: 0% 50%;
    }

    50% {
        background-position: 100% 50%;
    }

    100% {
        background-position: 0% 50%;
    }
}

@keyframes splashTextFade {
    0% {
        opacity: 0;
        transform: translateY(20px);
    }

    100% {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes splashDotBounce {

    0%,
    80%,
    100% {
        transform: scale(0.6);
        opacity: 0.5;
    }

    40% {
        transform: scale(1);
        opacity: 1;
    }
}

/* ============================================
   PREMIUM SPLASH ANIMATIONS
   ============================================ */

/* 3D entrance for logo */
.splash-3d-entrance {
    animation: splash3DEntrance 1.2s cubic-bezier(0.34, 1.56, 0.64, 1) both !important;
}

@keyframes splash3DEntrance {
    0% {
        transform: perspective(800px) rotateY(25deg) scale(0.6) translateZ(-100px);
        opacity: 0;
    }

    100% {
        transform: perspective(800px) rotateY(0deg) scale(1) translateZ(0);
        opacity: 1;
    }
}

/* Glowing orb behind logo */
.splash-glow-orb {
    position: absolute;
    width: 250px;
    height: 250px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(99, 102, 241, 0.3), rgba(139, 92, 246, 0.15), transparent 70%);
    filter: blur(40px);
    animation: orbPulse 3s ease-in-out infinite;
    z-index: 0;
}

@keyframes orbPulse {

    0%,
    100% {
        transform: scale(1);
        opacity: 0.6;
    }

    50% {
        transform: scale(1.3);
        opacity: 1;
    }
}

/* Floating particles */
.splash-particles {
    position: absolute;
    inset: 0;
    overflow: hidden;
    z-index: 0;
    pointer-events: none;
    /* Fix: Prevent blocking scroll/clicks */
}

.splash-particle {
    position: absolute;
    bottom: -10px;
    border-radius: 50%;
    background: rgba(99, 102, 241, 0.6);
    animation: particleFloat linear infinite;
}

@keyframes particleFloat {
    0% {
        transform: translateY(0) rotate(0deg);
        opacity: 0;
    }

    10% {
        opacity: 1;
    }

    90% {
        opacity: 1;
    }

    100% {
        transform: translateY(-100vh) rotate(360deg);
        opacity: 0;
    }
}

/* Splash type-in animation */
.splash-type-in {
    animation: splashTypeIn 0.8s ease-out both 0.4s !important;
}

@keyframes splashTypeIn {
    0% {
        opacity: 0;
        transform: translateY(20px) scale(0.95);
        letter-spacing: 8px;
    }

    100% {
        opacity: 1;
        transform: translateY(0) scale(1);
        letter-spacing: normal;
    }
}

/* Fade up for subtitle */
.splash-fade-up {
    animation: splashFadeUp 0.6s ease-out both 0.8s !important;
}

@keyframes splashFadeUp {
    0% {
        opacity: 0;
        transform: translateY(15px);
    }

    100% {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Premium progress bar */
.splash-progress-bar {
    margin-top: 48px;
    width: 200px;
    height: 3px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 3px;
    overflow: hidden;
    animation: splashFadeUp 0.5s ease-out both 1s;
}

.splash-progress-fill {
    width: 0%;
    height: 100%;
    background: linear-gradient(90deg, #6366f1, #a855f7, #ec4899);
    border-radius: 3px;
    animation: progressFill 1.8s ease-in-out both 1s;
}

@keyframes progressFill {
    0% {
        width: 0%;
    }

    100% {
        width: 100%;
    }
}

/* ============================================
   MOBILE-FIRST FOUNDATION
   ============================================ */

/* PWA standalone mode detection */
@media all and (display-mode: standalone) {

    /* Add safe area padding for notched devices */
    body {
        padding-top: env(safe-area-inset-top);
        padding-bottom: env(safe-area-inset-bottom);
        padding-left: env(safe-area-inset-left);
        padding-right: env(safe-area-inset-right);
    }

    /* Hide browser-specific elements in PWA */
    .browser-only {
        display: none !important;
    }
}

/* Touch optimization */
@media (pointer: coarse) {

    /* Larger touch targets */
    button,
    .btn,
    a.btn,
    [role="button"] {
        min-height: 44px;
        min-width: 44px;
    }

    /* Increase spacing for touch */
    .touch-spacing>*+* {
        margin-top: 12px;
    }
}

/* ============================================
   MOBILE LAYOUT FIXES
   ============================================ */

/* Prevent horizontal scroll */
html,
body {
    overflow-x: hidden;
    max-width: 100vw;
}

/* Container max-widths */
.container-mobile {
    width: 100%;
    max-width: 100%;
    padding-left: 16px;
    padding-right: 16px;
}

@media (min-width: 640px) {
    .container-mobile {
        padding-left: 24px;
        padding-right: 24px;
    }
}

/* Stack on mobile, row on desktop */
.mobile-stack {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

@media (min-width: 768px) {
    .mobile-stack {
        flex-direction: row;
    }
}

/* Grid that collapses properly */
.mobile-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 16px;
}

@media (min-width: 640px) {
    .mobile-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (min-width: 1024px) {
    .mobile-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

/* ============================================
   MOBILE CARD STYLES
   ============================================ */

.card-mobile {
    width: 100%;
    padding: 16px;
    border-radius: 16px;
    background: var(--bg-card);
    border: 1px solid var(--glass-border);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}

@media (min-width: 640px) {
    .card-mobile {
        padding: 20px;
        border-radius: 20px;
    }
}

/* ============================================
   MOBILE HEADER / NAVBAR
   ============================================ */

.mobile-header {
    position: sticky;
    top: 0;
    z-index: 1000;
    background: rgba(2, 6, 23, 0.95);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    padding: 12px 16px;
    padding-top: calc(12px + env(safe-area-inset-top));
}

/* ============================================
   MOBILE BOTTOM NAV (if needed)
   ============================================ */

.mobile-bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    background: rgba(2, 6, 23, 0.98);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    padding: 8px 16px;
    padding-bottom: calc(8px + env(safe-area-inset-bottom));
    display: flex;
    justify-content: space-around;
    align-items: center;
}

.mobile-bottom-nav .nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    color: #64748b;
    font-size: 10px;
    transition: all 0.2s ease;
}

.mobile-bottom-nav .nav-item.active,
.mobile-bottom-nav .nav-item:hover {
    color: #6366f1;
}

.mobile-bottom-nav .nav-icon {
    width: 24px;
    height: 24px;
}

/* ============================================
   MOBILE FORM INPUTS
   ============================================ */

.input-mobile {
    width: 100%;
    padding: 14px 16px;
    font-size: 16px;
    /* Prevents zoom on iOS */
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: #fff;
    transition: all 0.2s ease;
    -webkit-appearance: none;
    appearance: none;
}

.input-mobile:focus {
    outline: none;
    border-color: #6366f1;
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.2);
}

.input-mobile::placeholder {
    color: #64748b;
}

/* ============================================
   MOBILE BUTTONS
   ============================================ */

.btn-mobile {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    padding: 14px 20px;
    font-size: 15px;
    font-weight: 600;
    border-radius: 12px;
    border: none;
    cursor: pointer;
    transition: all 0.2s ease;
    -webkit-tap-highlight-color: transparent;
}

.btn-mobile:active {
    transform: scale(0.98);
}

.btn-mobile-primary {
    background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
    color: #fff;
    box-shadow: 0 4px 15px rgba(99, 102, 241, 0.4);
}

.btn-mobile-primary:hover {
    box-shadow: 0 6px 20px rgba(99, 102, 241, 0.5);
    transform: translateY(-1px);
}

.btn-mobile-secondary {
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

/* ============================================
   MOBILE TYPOGRAPHY
   ============================================ */

.text-mobile-title {
    font-size: 24px;
    font-weight: 700;
    line-height: 1.2;
}

@media (min-width: 640px) {
    .text-mobile-title {
        font-size: 32px;
    }
}

.text-mobile-body {
    font-size: 14px;
    line-height: 1.6;
}

/* ============================================
   MOBILE UTILITIES
   ============================================ */

/* Hide on mobile */
@media (max-width: 767px) {
    .hide-mobile {
        display: none !important;
    }
}

/* Hide on desktop */
@media (min-width: 768px) {
    .hide-desktop {
        display: none !important;
    }
}

/* Full-width on mobile */
.mobile-full {
    width: 100% !important;
}

@media (min-width: 768px) {
    .mobile-full {
        width: auto !important;
    }
}

/* Mobile text alignment */
.mobile-center {
    text-align: center;
}

@media (min-width: 768px) {
    .mobile-center {
        text-align: left;
    }
}

/* ============================================
   PULL TO REFRESH INDICATOR (Optional)
   ============================================ */

.pull-refresh-indicator {
    position: fixed;
    top: 0;
    left: 50%;
    transform: translateX(-50%) translateY(-100%);
    z-index: 9999;
    padding: 12px 24px;
    background: rgba(99, 102, 241, 0.9);
    backdrop-filter: blur(10px);
    border-radius: 0 0 12px 12px;
    color: #fff;
    font-size: 12px;
    font-weight: 500;
    transition: transform 0.3s ease;
}

.pull-refresh-indicator.active {
    transform: translateX(-50%) translateY(0);
}

/* ============================================
   SMOOTH PAGE TRANSITIONS
   ============================================ */

.page-enter {
    opacity: 0;
    transform: translateY(10px);
}

.page-enter-active {
    opacity: 1;
    transform: translateY(0);
    transition: opacity 0.3s ease, transform 0.3s ease;
}

.page-exit {
    opacity: 1;
}

.page-exit-active {
    opacity: 0;
    transition: opacity 0.2s ease;
}

/* ============================================
   HAPTIC FEEDBACK VISUAL
   ============================================ */

.haptic-press {
    transition: transform 0.1s ease;
}

.haptic-press:active {
    transform: scale(0.97);
}

/* ============================================
   MOBILE MODAL / SHEET
   ============================================ */

.mobile-sheet {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 10000;
    background: #0f172a;
    border-radius: 24px 24px 0 0;
    padding: 24px;
    padding-bottom: calc(24px + env(safe-area-inset-bottom));
    transform: translateY(100%);
    transition: transform 0.3s ease;
}

.mobile-sheet.open {
    transform: translateY(0);
}

.mobile-sheet-handle {
    width: 40px;
    height: 4px;
    background: rgba(255, 255, 255, 0.3);
    border-radius: 2px;
    margin: 0 auto 20px;
}

/* Sheet backdrop */
.mobile-sheet-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    z-index: 9999;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.mobile-sheet-backdrop.open {
    opacity: 1;
    visibility: visible;
}

/* ============================================
   SKELETON LOADING (MOBILE OPTIMIZED)
   ============================================ */

.skeleton-mobile {
    background: linear-gradient(90deg,
            rgba(255, 255, 255, 0.05) 0%,
            rgba(255, 255, 255, 0.1) 50%,
            rgba(255, 255, 255, 0.05) 100%);
    background-size: 200% 100%;
    animation: shimmerMobile 1.5s ease-in-out infinite;
    border-radius: 8px;
}

@keyframes shimmerMobile {
    0% {
        background-position: 200% 0;
    }

    100% {
        background-position: -200% 0;
    }
}

/* ============================================
   IOS SPECIFIC FIXES
   ============================================ */

/* Prevent rubber-banding on iOS */
@supports (-webkit-touch-callout: none) {
    body {
        -webkit-overflow-scrolling: touch;
    }

    /* Fix 100vh issue on iOS */
    .full-height-mobile {
        height: 100vh;
        height: -webkit-fill-available;
        height: 100dvh;
    }
}

/* ============================================
   ANDROID SPECIFIC
   ============================================ */

/* Remove tap highlight on Android */
* {
    -webkit-tap-highlight-color: transparent;
}

/* ============================================
   ANIMATION PERFORMANCE
   ============================================ */

.gpu-accelerate {
    transform: translateZ(0);
    will-change: transform;
}

/* Reduce motion for accessibility */
@media (prefers-reduced-motion: reduce) {

    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* ============================================
   DISABLE PULL-TO-REFRESH (Native App Feel)
   ============================================ */

/* Prevent overscroll/pull-to-refresh */
html,
body {
    /* Check */
}

@media all and (display-mode: standalone) {
    html {
        /* Check */
    }

    body {
        /* Check */
        touch-action: pan-y !important;
        /* Force vertical scroll */
        -webkit-overflow-scrolling: touch;
    }
}

/* ============================================
   NOTIFICATION PERMISSION PROMPT
   ============================================ */

#notification-prompt {
    position: fixed;
    bottom: 80px;
    left: 16px;
    right: 16px;
    z-index: 99998;
    background: linear-gradient(135deg, #1e1b4b 0%, #312e81 100%);
    border: 1px solid rgba(99, 102, 241, 0.3);
    border-radius: 20px;
    padding: 20px;
    box-shadow:
        0 20px 50px rgba(0, 0, 0, 0.5),
        0 0 40px rgba(99, 102, 241, 0.2);
    transform: translateY(150%);
    transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

#notification-prompt.show {
    transform: translateY(0);
}

#notification-prompt.hide {
    transform: translateY(150%);
}

.notif-prompt-icon {
    width: 48px;
    height: 48px;
    background: linear-gradient(135deg, #6366f1, #8b5cf6);
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 12px;
    animation: bellRing 2s ease-in-out infinite;
}

@keyframes bellRing {

    0%,
    100% {
        transform: rotate(0deg);
    }

    10% {
        transform: rotate(15deg);
    }

    20% {
        transform: rotate(-15deg);
    }

    30% {
        transform: rotate(10deg);
    }

    40% {
        transform: rotate(-10deg);
    }

    50% {
        transform: rotate(0deg);
    }
}

.notif-prompt-title {
    font-size: 16px;
    font-weight: 700;
    color: #fff;
    margin-bottom: 6px;
}

.notif-prompt-desc {
    font-size: 13px;
    color: #a5b4fc;
    margin-bottom: 16px;
    line-height: 1.5;
}

.notif-prompt-buttons {
    display: flex;
    gap: 10px;
}

.notif-btn-allow {
    flex: 1;
    padding: 12px 20px;
    background: linear-gradient(135deg, #6366f1, #8b5cf6);
    border: none;
    border-radius: 12px;
    color: #fff;
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s;
}

.notif-btn-allow:active {
    transform: scale(0.97);
}

.notif-btn-later {
    padding: 12px 20px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 12px;
    color: #94a3b8;
    font-weight: 500;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s;
}

/* ============================================
   COMPACT DASHBOARD TILES (PREMIUM MOBILE)
   ============================================ */

/* Dashboard compact layout */
@media (max-width: 768px) {

    /* Compact stat cards */
    .stat-card,
    .glass-card,
    .card-mobile {
        padding: 14px 16px !important;
        border-radius: 14px !important;
    }

    /* Smaller icon containers in cards */
    .stat-card .w-10,
    .stat-card .w-12,
    .stat-card .w-14 {
        width: 36px !important;
        height: 36px !important;
    }

    .stat-card svg {
        width: 18px !important;
        height: 18px !important;
    }

    /* Compact text */
    .stat-card .text-3xl,
    .stat-card .text-2xl {
        font-size: 22px !important;
        line-height: 1.2 !important;
    }

    .stat-card .text-sm {
        font-size: 12px !important;
    }

    .stat-card .text-xs {
        font-size: 10px !important;
    }

    /* Compact welcome section */
    .text-3xl.font-bold {
        font-size: 22px !important;
    }

    /* Compact buttons */
    button,
    .btn,
    [type="button"],
    [type="submit"] {
        padding: 10px 16px !important;
        font-size: 13px !important;
    }

    /* Reduce spacing */
    .space-y-6>*+* {
        margin-top: 12px !important;
    }

    .space-y-4>*+* {
        margin-top: 10px !important;
    }

    .gap-6 {
        gap: 12px !important;
    }

    .gap-4 {
        gap: 10px !important;
    }

    .p-6,
    .p-8 {
        padding: 14px !important;
    }

    .py-6,
    .py-8 {
        padding-top: 14px !important;
        padding-bottom: 14px !important;
    }

    .px-4,
    .px-6 {
        padding-left: 14px !important;
        padding-right: 14px !important;
    }

    .mb-6,
    .mb-8 {
        margin-bottom: 12px !important;
    }

    .mt-6,
    .mt-8 {
        margin-top: 12px !important;
    }

    /* Compact header */
    header .h-16 {
        height: 52px !important;
    }

    header .w-12,
    header .h-12 {
        width: 36px !important;
        height: 36px !important;
    }

    header .text-2xl {
        font-size: 16px !important;
    }

    /* Hide text on mobile header buttons */
    header .text-sm.font-medium {
        display: none !important;
    }
}

/* Wallet page compact styles */
@media (max-width: 768px) {

    /* Wallet cards */
    .wallet-card,
    [class*="earnings"],
    [class*="balance"] {
        padding: 16px !important;
    }

    /* Wallet header */
    .wallet-header {
        padding: 12px 16px !important;
    }
}

/* ============================================
   PREMIUM ANIMATIONS
   ============================================ */

/* Card entrance animation */
@keyframes cardSlideUp {
    0% {
        opacity: 0;
        transform: translateY(20px);
    }

    100% {
        opacity: 1;
        transform: translateY(0);
    }
}

.animate-card-up {
    animation: cardSlideUp 0.4s ease-out forwards;
}

/* Stagger animation for multiple cards */
.stagger-1 {
    animation-delay: 0.05s;
}

.stagger-2 {
    animation-delay: 0.1s;
}

.stagger-3 {
    animation-delay: 0.15s;
}

.stagger-4 {
    animation-delay: 0.2s;
}

.stagger-5 {
    animation-delay: 0.25s;
}

/* Premium glow effect */
.glow-premium {
    box-shadow:
        0 0 20px rgba(99, 102, 241, 0.15),
        0 4px 20px rgba(0, 0, 0, 0.3);
}

/* Smooth icon pulse */
@keyframes iconPulse {

    0%,
    100% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.05);
    }
}

.icon-pulse {
    animation: iconPulse 2s ease-in-out infinite;
}

/* Touch feedback */
.touch-feedback {
    transition: transform 0.1s ease, opacity 0.1s ease;
}

.touch-feedback:active {
    transform: scale(0.97);
    opacity: 0.9;
}

/* Gradient border animation */
@keyframes gradientBorder {
    0% {
        background-position: 0% 50%;
    }

    50% {
        background-position: 100% 50%;
    }

    100% {
        background-position: 0% 50%;
    }
}

.animated-border {
    background: linear-gradient(90deg, #6366f1, #8b5cf6, #a855f7, #6366f1);
    background-size: 300% 100%;
    animation: gradientBorder 3s linear infinite;
}

/* ============================================
   EMAIL CONFIRMATION SUCCESS MESSAGE
   ============================================ */

.email-confirm-banner {
    background: linear-gradient(135deg, #065f46 0%, #047857 100%);
    border: 1px solid rgba(16, 185, 129, 0.3);
    border-radius: 16px;
    padding: 16px;
    margin-bottom: 20px;
    display: flex;
    align-items: flex-start;
    gap: 12px;
}

.email-confirm-icon {
    width: 40px;
    height: 40px;
    background: rgba(16, 185, 129, 0.2);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.email-confirm-text h4 {
    color: #fff;
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 4px;
}

.email-confirm-text p {
    color: #a7f3d0;
    font-size: 12px;
    line-height: 1.5;
}

/* ============================================
   AGGRESSIVE MOBILE LAYOUT FIXES
   Fixes header overflow, menu clipping, and card sizing
   ============================================ */

/* CRITICAL: Force all elements to stay within viewport */
@media screen and (max-width: 767px) {

    /* Prevent ANY horizontal overflow */
    html,
    body {
        overflow-x: hidden !important;
        max-width: 100vw !important;
        -webkit-overflow-scrolling: touch;
    }

    * {
        max-width: 100vw;
    }

    /* ===== HEADER FIXES ===== */
    header,
    .sticky.top-0 {
        padding-left: 8px !important;
        padding-right: 8px !important;
    }

    header .max-w-7xl,
    .sticky.top-0 .max-w-7xl {
        padding-left: 4px !important;
        padding-right: 4px !important;
    }

    /* Smaller logo on mobile */
    header .w-12.h-12,
    .sticky.top-0 .w-12.h-12 {
        width: 36px !important;
        height: 36px !important;
    }

    /* Hide extended logo text on mobile - COMMENTED OUT to show expanding animation */
    /* .expand-text {
        display: none !important;
    } */

    /* Main logo text smaller */
    header h1,
    .sticky.top-0 h1 {
        font-size: 18px !important;
    }

    /* Hide tagline on mobile */
    header .text-\[10px\].uppercase,
    .sticky.top-0 .text-\[10px\].uppercase {
        display: none !important;
    }

    /* Gap between header elements */
    header .gap-4,
    .sticky.top-0 .gap-4 {
        gap: 8px !important;
    }

    header .gap-6,
    .sticky.top-0 .gap-6 {
        gap: 8px !important;
    }

    /* ===== DROPDOWN MENU FIXES ===== */

    /* Quick Menu Dropdown - Position correctly */
    #quickMenuDropdown {
        left: auto !important;
        right: 0 !important;
        max-width: calc(100vw - 32px) !important;
        transform: translateX(0) !important;
    }

    /* Profile Panel - Keep inside viewport */
    #profilePanel {
        right: 0 !important;
        left: auto !important;
        max-width: calc(100vw - 32px) !important;
        width: 280px !important;
    }

    /* Any absolute positioned dropdown */
    .absolute.right-0 {
        right: 0 !important;
        left: auto !important;
        max-width: calc(100vw - 16px) !important;
    }

    /* ===== NAVIGATION BUTTON FIXES ===== */

    /* Profile toggle smaller */
    #profileToggle {
        padding: 4px 8px 4px 4px !important;
    }

    #profileToggle .w-8.h-8 {
        width: 28px !important;
        height: 28px !important;
    }

    /* Hide profile name on mobile */
    #profileToggle .hidden.sm\:block {
        display: none !important;
    }

    /* Quick menu button smaller */
    #quickMenuBtn {
        padding: 6px 10px !important;
        font-size: 12px !important;
    }

    /* ===== MAIN CONTENT PADDING ===== */
    .max-w-7xl {
        padding-left: 12px !important;
        padding-right: 12px !important;
    }

    main,
    .main-content {
        padding-left: 12px !important;
        padding-right: 12px !important;
    }

    /* ===== CARD & TILE SIZING ===== */

    /* Grid cards - 2 columns on mobile */
    .grid-cols-2,
    .grid-cols-3,
    .sm\:grid-cols-2,
    .md\:grid-cols-3,
    .lg\:grid-cols-4 {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 10px !important;
    }

    /* Individual cards smaller */
    .glass-card,
    .bg-white\/5,
    .bg-slate-800\/50 {
        padding: 12px !important;
    }

    /* ===== ACTION TILES (Dashboard Icons) ===== */

    /* Fix the large action tiles */
    .p-6.rounded-2xl {
        padding: 10px !important;
        border-radius: 14px !important;
    }

    /* Icons in tiles smaller */
    .w-14.h-14 {
        width: 32px !important;
        height: 32px !important;
    }

    .w-12.h-12 {
        width: 28px !important;
        height: 28px !important;
    }

    /* Text in tiles smaller */
    .text-lg {
        font-size: 13px !important;
    }

    .text-xl {
        font-size: 14px !important;
    }

    .text-2xl {
        font-size: 16px !important;
    }

    /* ===== CREATE CLASS MODAL ===== */
    #createClassModal>div {
        max-width: calc(100vw - 32px) !important;
        margin: 16px !important;
    }

    /* ===== WALLET / BALANCE CARD ===== */
    .rounded-3xl.p-8 {
        padding: 16px !important;
        border-radius: 20px !important;
    }

    /* ===== FORM INPUTS ===== */
    input,
    select,
    textarea {
        font-size: 16px !important;
        /* Prevents iOS zoom */
    }

    /* ===== BUTTONS ===== */
    button,
    .btn {
        min-height: 44px;
        padding-left: 12px !important;
        padding-right: 12px !important;
    }

    /* ===== MODAL POSITIONING ===== */
    .fixed.inset-0 .glass,
    .fixed.inset-0>div:not(.glass) {
        max-width: calc(100vw - 24px) !important;
        max-height: calc(100vh - 48px) !important;
        overflow-y: auto !important;
    }
}

/* Tablet-specific fixes */
@media screen and (min-width: 768px) and (max-width: 1023px) {

    .grid-cols-3,
    .md\:grid-cols-3 {
        grid-template-columns: repeat(2, 1fr) !important;
    }
}

/* ===== NOTIFICATION PROMPT MOBILE STYLES ===== */
@media screen and (max-width: 767px) {
    #notificationPrompt {
        width: calc(100vw - 32px) !important;
        left: 16px !important;
        right: 16px !important;
        bottom: 24px !important;
    }

    #notificationPrompt button {
        flex: 1 !important;
        min-width: 0 !important;
    }
}

/* ===== HIDE OVERFLOW HELPERS ===== */
.truncate {
    max-width: 100%;
}

/* Only truncate inside cards, NOT header brand text */
.glass-card .whitespace-nowrap,
.bg-white\/5 .whitespace-nowrap {
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* ===== SAFE AREA FOR NOTCHED PHONES ===== */
@supports(padding: max(0px)) {
    @media screen and (max-width: 767px) {

        header,
        .sticky.top-0 {
            padding-top: max(8px, env(safe-area-inset-top)) !important;
        }

        .fixed.bottom-0,
        #notificationPrompt {
            padding-bottom: max(16px, env(safe-area-inset-bottom)) !important;
        }
    }
}