/* =====================================================
   POMODORO TIMER — Sikkim PSC Preparation Hub
   Floating productivity widget, neomorphic design
   ===================================================== */

/* --- Floating Action Button --- */
#pomodoro-fab {
    position: fixed !important;
    bottom: 24px !important;
    right: 24px !important;
    width: 52px !important;
    height: 52px !important;
    border-radius: 50% !important;
    border: none !important;
    cursor: pointer !important;
    z-index: 9998 !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    background: #eef1f5 !important;
    box-shadow: 6px 6px 12px #d1d9e6, -6px -6px 12px #ffffff !important;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important;
    -webkit-tap-highlight-color: transparent;
    padding: 0 !important;
    font-size: inherit !important;
    color: inherit !important;
}

#pomodoro-fab:hover {
    transform: scale(1.08);
    box-shadow: 4px 4px 8px #d1d9e6, -4px -4px 8px #ffffff;
}

#pomodoro-fab:active {
    transform: scale(0.95);
}

#pomodoro-fab svg {
    width: 26px;
    height: 26px;
    color: #0284c7;
    transition: color 0.3s ease;
}

html.dark #pomodoro-fab {
    background: #24272c !important;
    box-shadow: 6px 6px 12px #16181b, -6px -6px 12px #32363d !important;
}

html.dark #pomodoro-fab:hover {
    box-shadow: 4px 4px 8px #16181b, -4px -4px 8px #32363d;
}

html.dark #pomodoro-fab svg {
    color: #38bdf8;
}

/* FAB badge — shows time when running & panel closed */
#pomodoro-fab-badge {
    position: absolute;
    top: -6px;
    left: -10px;
    background: #0284c7;
    color: #fff;
    font-size: 0.6rem;
    font-weight: 700;
    padding: 2px 6px;
    border-radius: 10px;
    white-space: nowrap;
    pointer-events: none;
    opacity: 0;
    transform: scale(0.8);
    transition: all 0.3s ease;
    font-family: 'SF Mono', 'Fira Code', monospace;
}

#pomodoro-fab-badge.visible {
    opacity: 1;
    transform: scale(1);
}

html.dark #pomodoro-fab-badge {
    background: #38bdf8;
    color: #1a1c20;
}

/* Pulsing glow when timer is running */
#pomodoro-fab.running {
    animation: pomodoroFabPulse 2s ease-in-out infinite;
}

@keyframes pomodoroFabPulse {
    0%, 100% {
        box-shadow: 6px 6px 12px #d1d9e6, -6px -6px 12px #ffffff, 0 0 0 0 rgba(2, 132, 199, 0.3);
    }
    50% {
        box-shadow: 6px 6px 12px #d1d9e6, -6px -6px 12px #ffffff, 0 0 0 10px rgba(2, 132, 199, 0);
    }
}

html.dark #pomodoro-fab.running {
    animation: pomodoroFabPulseDark 2s ease-in-out infinite;
}

@keyframes pomodoroFabPulseDark {
    0%, 100% {
        box-shadow: 6px 6px 12px #16181b, -6px -6px 12px #32363d, 0 0 0 0 rgba(56, 189, 248, 0.3);
    }
    50% {
        box-shadow: 6px 6px 12px #16181b, -6px -6px 12px #32363d, 0 0 0 10px rgba(56, 189, 248, 0);
    }
}

/* --- Timer Panel --- */
#pomodoro-panel {
    position: fixed;
    bottom: 88px;
    right: 24px;
    width: 300px;
    max-width: calc(100vw - 32px);
    background: #eef1f5;
    border-radius: 20px;
    z-index: 9998;
    padding: 24px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    border: 1px solid rgba(0, 0, 0, 0.06);
    opacity: 0;
    visibility: hidden;
    transform: translateY(16px) scale(0.96);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

#pomodoro-panel.open {
    opacity: 1;
    visibility: visible;
    transform: translateY(0) scale(1);
}

html.dark #pomodoro-panel {
    background: #24272c;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.08);
}

/* --- Panel Header --- */
.pomo-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
}

.pomo-title {
    font-size: 0.8rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: #9ca3af;
}

html.dark .pomo-title {
    color: #6b7280;
}

.pomo-close-btn {
    width: 28px !important;
    height: 28px !important;
    border-radius: 50% !important;
    border: none !important;
    cursor: pointer !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    background: #eef1f5 !important;
    box-shadow: 3px 3px 6px #d1d9e6, -3px -3px 6px #ffffff !important;
    transition: all 0.2s ease !important;
    color: #9ca3af !important;
    padding: 0 !important;
    font-size: inherit !important;
}

.pomo-close-btn:hover {
    box-shadow: inset 2px 2px 4px #d1d9e6, inset -2px -2px 4px #ffffff;
    color: #4b5563;
}

html.dark .pomo-close-btn {
    background: #24272c !important;
    box-shadow: 3px 3px 6px #16181b, -3px -3px 6px #32363d !important;
    color: #6b7280 !important;
}

html.dark .pomo-close-btn:hover {
    box-shadow: inset 2px 2px 4px #16181b, inset -2px -2px 4px #32363d;
    color: #d1d5db;
}

.pomo-close-btn svg {
    width: 14px;
    height: 14px;
}

/* --- Mode Label --- */
.pomo-mode-label {
    text-align: center;
    font-size: 0.85rem;
    font-weight: 600;
    color: #0284c7;
    margin-bottom: 8px;
    transition: color 0.3s ease;
}

html.dark .pomo-mode-label {
    color: #38bdf8;
}

.pomo-mode-label.break-mode {
    color: #059669;
}

html.dark .pomo-mode-label.break-mode {
    color: #34d399;
}

/* --- Countdown Display --- */
.pomo-countdown {
    text-align: center;
    font-size: 3.5rem;
    font-weight: 800;
    letter-spacing: -0.02em;
    color: #1f2937;
    margin-bottom: 16px;
    font-variant-numeric: tabular-nums;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    line-height: 1;
}

html.dark .pomo-countdown {
    color: #f3f4f6;
}

/* --- Session Progress Dots --- */
.pomo-dots {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-bottom: 20px;
}

.pomo-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #d1d9e6;
    transition: all 0.3s ease;
    box-shadow: inset 1px 1px 2px rgba(0, 0, 0, 0.06);
}

.pomo-dot.completed {
    background: #0284c7;
    box-shadow: 0 0 6px rgba(2, 132, 199, 0.4);
}

html.dark .pomo-dot {
    background: #374151;
}

html.dark .pomo-dot.completed {
    background: #38bdf8;
    box-shadow: 0 0 6px rgba(56, 189, 248, 0.4);
}

/* --- Control Buttons --- */
.pomo-controls {
    display: flex;
    justify-content: center;
    gap: 12px;
    margin-bottom: 16px;
}

.pomo-btn {
    width: 44px !important;
    height: 44px !important;
    border-radius: 14px !important;
    border: none !important;
    cursor: pointer !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    background: #eef1f5 !important;
    box-shadow: 4px 4px 8px #d1d9e6, -4px -4px 8px #ffffff !important;
    transition: all 0.2s ease !important;
    color: #4b5563 !important;
    -webkit-tap-highlight-color: transparent;
    padding: 0 !important;
    font-size: inherit !important;
}

.pomo-btn:hover {
    box-shadow: 2px 2px 4px #d1d9e6, -2px -2px 4px #ffffff;
    color: #0284c7;
}

.pomo-btn:active {
    box-shadow: inset 2px 2px 4px #d1d9e6, inset -2px -2px 4px #ffffff;
}

html.dark .pomo-btn {
    background: #24272c !important;
    box-shadow: 4px 4px 8px #16181b, -4px -4px 8px #32363d !important;
    color: #d1d5db !important;
}

html.dark .pomo-btn:hover {
    box-shadow: 2px 2px 4px #16181b, -2px -2px 4px #32363d;
    color: #38bdf8;
}

html.dark .pomo-btn:active {
    box-shadow: inset 2px 2px 4px #16181b, inset -2px -2px 4px #32363d;
}

.pomo-btn svg {
    width: 20px;
    height: 20px;
}

/* Primary (Start/Pause) button */
.pomo-btn-primary {
    width: 56px !important;
    height: 56px !important;
    border-radius: 18px !important;
    background: linear-gradient(135deg, #0284c7, #0ea5e9) !important;
    color: #ffffff !important;
    box-shadow: 4px 4px 8px #d1d9e6, -4px -4px 8px #ffffff, 0 4px 12px rgba(2, 132, 199, 0.3) !important;
}

.pomo-btn-primary:hover {
    color: #ffffff;
    box-shadow: 2px 2px 4px #d1d9e6, -2px -2px 4px #ffffff, 0 6px 16px rgba(2, 132, 199, 0.4);
    transform: translateY(-1px);
}

.pomo-btn-primary:active {
    transform: translateY(0);
    box-shadow: inset 2px 2px 4px rgba(0, 0, 0, 0.15);
}

html.dark .pomo-btn-primary {
    background: linear-gradient(135deg, #0284c7, #38bdf8) !important;
    box-shadow: 4px 4px 8px #16181b, -4px -4px 8px #32363d, 0 4px 12px rgba(56, 189, 248, 0.3) !important;
}

html.dark .pomo-btn-primary:hover {
    color: #ffffff;
    box-shadow: 2px 2px 4px #16181b, -2px -2px 4px #32363d, 0 6px 16px rgba(56, 189, 248, 0.4);
}

.pomo-btn-primary svg {
    width: 24px;
    height: 24px;
}

/* --- Daily Stats --- */
.pomo-stats {
    text-align: center;
    font-size: 0.78rem;
    color: #9ca3af;
    font-weight: 500;
}

html.dark .pomo-stats {
    color: #6b7280;
}

.pomo-stats span {
    color: #0284c7;
    font-weight: 700;
}

html.dark .pomo-stats span {
    color: #38bdf8;
}

/* --- Reset double-press hint --- */
.pomo-btn-warn {
    color: #f59e0b !important;
    box-shadow: 4px 4px 8px #d1d9e6, -4px -4px 8px #ffffff, 0 0 8px rgba(245, 158, 11, 0.35);
    transition: all 0.2s ease;
}

html.dark .pomo-btn-warn {
    color: #fbbf24 !important;
    box-shadow: 4px 4px 8px #16181b, -4px -4px 8px #32363d, 0 0 8px rgba(251, 191, 36, 0.35);
}

/* --- Mobile Adjustments --- */
@media (max-width: 400px) {
    #pomodoro-fab {
        bottom: 16px;
        right: 16px;
        width: 48px;
        height: 48px;
    }

    #pomodoro-panel {
        bottom: 76px;
        right: 16px;
        width: calc(100vw - 32px);
        padding: 20px;
    }

    .pomo-countdown {
        font-size: 3rem;
    }
}
