/* ============================================================
   MOBILE PERFORMANCE OPTIMIZATIONS
   ============================================================ */
@media (max-width: 768px) {
    /* Disable massive animated blurs on mobile GPU */
    body::before, body::after {
        animation: none !important;
        filter: blur(40px) !important;
        opacity: 0.3 !important;
    }

    /* Downgrade/Reduce glassmorphism expense to 60fps */
    .glass-panel,
    .dashboard-stat-card,
    .bottom-sheet {
        backdrop-filter: blur(4px) !important;
        -webkit-backdrop-filter: blur(4px) !important;
        box-shadow: none !important;
        background: rgba(18, 16, 44, 0.85) !important; /* more opaque fallback */
    }

    .bottom-nav {
        backdrop-filter: blur(12px) !important;
        -webkit-backdrop-filter: blur(12px) !important;
        background: rgba(10, 8, 32, 0.98) !important;
    }
    
    .top-bar {
        backdrop-filter: blur(12px) !important;
        -webkit-backdrop-filter: blur(12px) !important;
        background: rgba(15, 12, 41, 0.95) !important;
    }
}

/* POMODORO FULLSCREEN STYLES */
#pomodoroView.fullscreen-active {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    width: 100vw !important;
    height: 100vh !important;
    max-height: 100vh !important;
    background: #000 !important;
    z-index: 99999 !important;
    display: flex !important;
    flex-direction: column !important;
    justify-content: center !important;
    align-items: center !important;
    padding: 0 !important;
    margin: 0 !important;
    transform: none !important;
}

#pomodoroView.fullscreen-active .pomodoro-panel {
    border: none;
    background: transparent;
    box-shadow: none;
    width: 100%;
    max-width: 1000px;
}

#pomodoroView.fullscreen-active .modal-header,
#pomodoroView.fullscreen-active .pomo-settings-details,
#pomodoroView.fullscreen-active .pomo-sessions {
    display: none !important;
}

#pomodoroView.fullscreen-active .pomo-ring-wrap {
    transform: scale(1.5);
    margin: 3rem 0;
}

#pomodoroView.fullscreen-active .pomo-mode-bar {
    opacity: 0.5;
}

#pomodoroView.fullscreen-active .pomo-controls {
    transform: scale(1.2);
    margin-top: 2rem;
}

/* Fullscreen Pomodoro View */
#pomodoroView:fullscreen {
    background: #0f172a;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
}

#pomodoroView {
    transition: background 0.8s ease;
    -webkit-tap-highlight-color: transparent;
}
#pomodoroView.mode-focus .pomodoro-panel {
    background: rgba(239, 68, 68, 0.08);
    border-color: rgba(239, 68, 68, 0.15);
}
#pomodoroView.mode-short .pomodoro-panel {
    background: rgba(52, 211, 153, 0.08);
    border-color: rgba(52, 211, 153, 0.15);
}
#pomodoroView.mode-short {
    background: radial-gradient(circle at top, rgba(52, 211, 153, 0.08) 0%, transparent 70%);
}
#pomodoroView:fullscreen.mode-focus, #pomodoroView:-webkit-full-screen.mode-focus {
    background: radial-gradient(circle at center, rgba(239, 68, 68, 0.1) 0%, #0f172a 70%);
}
#pomodoroView:fullscreen.mode-short, #pomodoroView:-webkit-full-screen.mode-short {
    background: radial-gradient(circle at center, rgba(52, 211, 153, 0.15) 0%, #0f172a 70%);
}
#pomodoroView:fullscreen .pomodoro-panel {
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
    width: 100vw !important;
    height: 100vh !important;
    margin: 0 !important;
    padding: 0 !important;
    display: flex !important;
    flex-direction: column !important;
    justify-content: center !important;
    align-items: center !important;
}
#pomodoroView:fullscreen .pomo-ring-wrap {
    width: 320px;
    height: 320px;
    margin: 2rem 0;
    transform: none;
}
#pomodoroView:fullscreen .pomo-ring {
    width: 320px;
    height: 320px;
}
#pomodoroView:fullscreen #pomoTime {
    font-size: 5rem;
}
#pomodoroView:fullscreen .pomo-mode-label {
    font-size: 1.2rem;
}
#pomodoroView:fullscreen #bottomNav,
#pomodoroView:fullscreen .top-bar,
#pomodoroView:fullscreen .modal-header,
#pomodoroView:fullscreen .pomo-settings-details,
#pomodoroView:fullscreen .pomo-mode-bar,
#pomodoroView:fullscreen .pomo-sessions,
#pomodoroView:fullscreen .btn-fullscreen-inline,
#pomodoroView:fullscreen .pomo-fullscreen-btn-wrap {
    display: none !important;
}

#pomodoroView:-webkit-full-screen {
    background: #0f172a;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
}
#pomodoroView:-webkit-full-screen .pomodoro-panel {
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
    width: 100vw !important;
    height: 100vh !important;
    margin: 0 !important;
    padding: 0 !important;
    display: flex !important;
    flex-direction: column !important;
    justify-content: center !important;
    align-items: center !important;
}
#pomodoroView:-webkit-full-screen .pomo-ring-wrap {
    width: 320px;
    height: 320px;
    margin: 2rem 0;
    transform: none;
}
#pomodoroView:-webkit-full-screen .pomo-ring {
    width: 320px;
    height: 320px;
}
#pomodoroView:-webkit-full-screen #pomoTime {
    font-size: 5rem;
}
#pomodoroView:-webkit-full-screen .pomo-mode-label {
    font-size: 1.2rem;
}
#pomodoroView:-webkit-full-screen #bottomNav,
#pomodoroView:-webkit-full-screen .top-bar,
#pomodoroView:-webkit-full-screen .modal-header,
#pomodoroView:-webkit-full-screen .pomo-settings-details,
#pomodoroView:-webkit-full-screen .pomo-mode-bar,
#pomodoroView:-webkit-full-screen .pomo-sessions,
#pomodoroView:-webkit-full-screen .btn-fullscreen-inline,
#pomodoroView:-webkit-full-screen .pomo-fullscreen-btn-wrap {
    display: none !important;
}


#pomodoroView.fullscreen-idle .pomo-mode-bar,
#pomodoroView.fullscreen-idle .pomo-controls,
#pomodoroView.fullscreen-idle .pomo-sessions,
#pomodoroView.fullscreen-idle .pomo-settings-details,
#pomodoroView.fullscreen-idle .modal-header {
    opacity: 0 !important;
    pointer-events: none !important;
    transition: opacity 0.5s ease;
}

#pomodoroView .pomo-mode-bar,
#pomodoroView .pomo-controls,
#pomodoroView .pomo-sessions,
#pomodoroView .pomo-settings-details,
#pomodoroView .modal-header {
    transition: opacity 0.3s ease;
    opacity: 1;
}

.btn-fullscreen-toggle {
    position: absolute;
    right: 1.5rem;
    top: 1.5rem;
    z-index: 1000;
}
/* Old overrides removed to properly hide setting bars in fullscreen */

/* Show floating controls div only in fullscreen */
:fullscreen #pomoFullscreenControls,
:-webkit-full-screen #pomoFullscreenControls {
    display: flex !important;
}

#pomoFullscreenControls {
    position: fixed;
    bottom: 3rem;
    left: 50%;
    transform: translateX(-50%);
    z-index: 99999;
    display: none; /* only shown in fullscreen */
    flex-direction: row;
    align-items: center;
    justify-content: center;
    gap: 1.5rem;
    background: rgba(0, 0, 0, 0.55);
    -webkit-
    border-radius: 3rem;
    padding: 1rem 2rem;
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
    transition: opacity 0.4s ease, transform 0.4s ease;
}

#pomoFullscreenControls.fs-visible {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
    pointer-events: auto;
}

.fs-cycle-text {
    color: var(--accent-primary);
    font-size: 1.1rem;
    font-weight: bold;
    background: rgba(10, 8, 32, 0.7);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    padding: 0.4rem 1.2rem;
    border-radius: 20px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5);
    margin: 0;
}

#pomodoroView:fullscreen .pomo-controls,
#pomodoroView:-webkit-full-screen .pomo-controls {
    display: none !important;
}

#pomodoroView.fullscreen-idle #pomoFullscreenControls {
    opacity: 0 !important;
    transform: translateX(-50%) translateY(20px) !important;
    pointer-events: none !important;
}

/* Also hide top header stuff in fullscreen */
#pomodoroView:fullscreen .header-icon-group,
#pomodoroView:-webkit-full-screen .header-icon-group {
    display: none !important;
}

/* ===================== MOBILE CSS FULLSCREEN FALLBACK ===================== */
/* Used when native Fullscreen API is unavailable (iOS Safari, Android Chrome PWA) */
body.pomo-fs-active {
    overflow: hidden;
}

#pomodoroView.is-pomo-fs {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    width: 100vw !important;
    height: 100dvh !important;  /* dynamic viewport height — avoids browser chrome */
    z-index: 9999 !important;
    border-radius: 0 !important;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

/* Hide top nav, bottom nav, and inline settings in mobile fullscreen */
body.pomo-fs-active #bottomNav,
body.pomo-fs-active .top-bar,
#pomodoroView.is-pomo-fs .pomo-mode-bar,
#pomodoroView.is-pomo-fs .pomo-sessions,
#pomodoroView.is-pomo-fs .pomo-settings-details,
#pomodoroView.is-pomo-fs .btn-fullscreen-inline,
#pomodoroView.is-pomo-fs .pomo-controls,
#pomodoroView.is-pomo-fs .modal-header,
#pomodoroView.is-pomo-fs .pomo-fullscreen-btn-wrap {
    display: none !important;
}

/* Show the floating controls overlay */
#pomodoroView.is-pomo-fs #pomoFullscreenControls {
    display: flex !important;
}

/* Make the ring bigger in mobile fullscreen */
#pomodoroView.is-pomo-fs .pomo-ring-wrap {
    width: 280px;
    height: 280px;
    margin: 2rem 0;
}

#pomodoroView.is-pomo-fs .pomo-ring {
    width: 280px;
    height: 280px;
}

#pomodoroView.is-pomo-fs #pomoTime {
    font-size: 4.5rem;
}

/* Idle fade in mobile fullscreen too */
#pomodoroView.is-pomo-fs.fullscreen-idle .pomo-mode-label {
    opacity: 0.3;
    transition: opacity 0.5s ease;
}
