/* ==========================================
   HARMONIZED SPLASH SCREEN (GLASS)
   ========================================== */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border-width: 0;
}

#splash-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(6, 6, 14, 0.4);
    backdrop-filter: blur(80px);
    -webkit-backdrop-filter: blur(80px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    transition:
        backdrop-filter 1.2s cubic-bezier(0.16, 1, 0.3, 1),
        background 1.2s cubic-bezier(0.16, 1, 0.3, 1),
        opacity 0.8s ease;
}

#splash-screen.fade-out {
    backdrop-filter: blur(0);
    -webkit-backdrop-filter: blur(0);
    background: transparent;
    opacity: 0;
    pointer-events: none;
}

.splash-content {
    position: relative;
    z-index: 1;
}

.splash-title {
    font-family: 'Outfit', sans-serif;
    font-size: clamp(1.5rem, 6vw, 4.5rem);
    font-weight: 200;
    letter-spacing: 1.5rem;
    color: #fff;
    margin-right: -2rem;
    text-transform: uppercase;
    text-align: center;
    opacity: 0;
    filter: blur(25px);
    transform: scale(0.95);
    animation: splash-focus 2.2s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes splash-focus {
    0% {
        opacity: 0;
        filter: blur(25px);
        letter-spacing: 3rem;
        margin-right: -3rem;
        transform: scale(0.95);
    }

    100% {
        opacity: 1;
        filter: blur(0);
        letter-spacing: 1rem;
        margin-right: -1rem;
        transform: scale(1);
    }
}

:root {
    /* Default - Midnight Purple */
    --bg-dark: #06060e;
    --accent: #7c6cf0;
    --accent-glow: rgba(124, 108, 240, 0.3);
    --gradient-1: rgba(124, 108, 240, 0.25);
    --gradient-2: rgba(56, 189, 248, 0.15);

    --text-white: #f0f0f5;
    --text-muted: rgba(255, 255, 255, 0.35);
    --glass-bg: rgba(255, 255, 255, 0.04);
    --glass-border: rgba(255, 255, 255, 0.08);
    --font: 'Outfit', -apple-system, BlinkMacSystemFont, sans-serif;
    --radius-sm: 14px;
    --radius-md: 20px;
    --radius-lg: 28px;
    --radius-xl: 40px;
    --card-bg: rgba(255, 255, 255, 0.03);
}

body.theme-emerald {
    --bg-dark: #040d0a;
    --accent: #10b981;
    --accent-glow: rgba(16, 185, 129, 0.3);
    --gradient-1: rgba(16, 185, 129, 0.2);
    --gradient-2: rgba(52, 211, 153, 0.1);
}

body.theme-sunset {
    --bg-dark: #0d0606;
    --accent: #f43f5e;
    --accent-glow: rgba(244, 63, 94, 0.3);
    --gradient-1: rgba(244, 63, 94, 0.15);
    --gradient-2: rgba(251, 146, 60, 0.1);
}

body.theme-ocean {
    --bg-dark: #060b0d;
    --accent: #0ea5e9;
    --accent-glow: rgba(14, 165, 233, 0.3);
    --gradient-1: rgba(14, 165, 233, 0.2);
    --gradient-2: rgba(34, 211, 238, 0.1);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

body {
    background-color: var(--bg-dark);
    color: var(--text-white);
    font-family: var(--font);
    height: 100vh;
    overflow-x: hidden;
    overflow-y: auto;
    user-select: none;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    transition: padding 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    overflow-x: hidden;
}

/* ==========================================
   BACKGROUND
   ========================================== */
.background-wrapper {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    overflow: hidden;
    background: var(--bg-dark);
}

.bg-gradient {
    position: absolute;
    border-radius: 50%;
    filter: blur(100px);
    will-change: transform;
}

.bg-gradient-1 {
    width: 700px;
    height: 700px;
    background: radial-gradient(circle, var(--gradient-1) 0%, transparent 70%);
    top: -15%;
    left: -10%;
    animation: floatGrad1 30s infinite ease-in-out alternate;
}

.bg-gradient-2 {
    width: 600px;
    height: 600px;
    background: radial-gradient(circle, var(--gradient-2) 0%, transparent 70%);
    bottom: -10%;
    right: -10%;
    animation: floatGrad2 25s infinite ease-in-out alternate-reverse;
}

.bg-gradient-3 {
    width: 500px;
    height: 500px;
    background: radial-gradient(circle, rgba(236, 72, 153, 0.12) 0%, transparent 70%);
    top: 40%;
    left: 50%;
    animation: floatGrad3 35s infinite ease-in-out alternate;
}

.bg-gradient-4 {
    width: 400px;
    height: 400px;
    background: radial-gradient(circle, rgba(52, 211, 153, 0.1) 0%, transparent 70%);
    top: 10%;
    right: 20%;
    animation: floatGrad4 28s infinite ease-in-out alternate-reverse;
}

@keyframes floatGrad1 {
    0% {
        transform: translate(0, 0) scale(1);
    }

    50% {
        transform: translate(120px, 80px) scale(1.15);
    }

    100% {
        transform: translate(200px, 150px) scale(1.3);
    }
}

@keyframes floatGrad2 {
    0% {
        transform: translate(0, 0) scale(1);
    }

    50% {
        transform: translate(-100px, -60px) scale(1.1);
    }

    100% {
        transform: translate(-180px, -120px) scale(1.2);
    }
}

@keyframes floatGrad3 {
    0% {
        transform: translate(0, 0) scale(1) rotate(0deg);
    }

    100% {
        transform: translate(-100px, 50px) scale(1.2) rotate(180deg);
    }
}

@keyframes floatGrad4 {
    0% {
        transform: translate(0, 0) scale(1);
    }

    100% {
        transform: translate(80px, -60px) scale(1.15);
    }
}

/* Noise texture overlay */
.bg-noise {
    position: absolute;
    width: 100%;
    height: 100%;
    opacity: 0.03;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)'/%3E%3C/svg%3E");
    background-size: 128px 128px;
    pointer-events: none;
}

/* Subtle grid */
.bg-grid {
    position: absolute;
    width: 100%;
    height: 100%;
    background-image:
        linear-gradient(rgba(255, 255, 255, 0.015) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.015) 1px, transparent 1px);
    background-size: 60px 60px;
    pointer-events: none;
}

/* ==========================================
   INLINE COUNTDOWN PANEL
   ========================================== */
.main-content {
    flex: 1;
    width: 100%;
    max-width: 1400px;
    margin: 0 auto;
    position: relative;
    display: flex;
    flex-direction: column;
    padding: 20px;
    z-index: 10;
}

.inline-panel {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
    max-width: 800px;
    margin: 40px auto 0;
    padding: 0;
    z-index: 10;
    transition: all 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

body.zen .inline-panel {
    max-height: 0;
    margin-top: 0 !important;
    opacity: 0;
    pointer-events: none;
    transform: translateY(30px) scale(0.95);
    visibility: hidden;
    overflow: hidden;
}

.inline-panel .panel-header {
    border-bottom: none;
    padding-bottom: 12px;
    text-align: center;
}

.inline-panel .panel-header h3 {
    font-size: 14px;
    font-weight: 600;
    letter-spacing: 0.1em;
    color: var(--text-muted);
    text-transform: uppercase;
    opacity: 0.8;
}

.compact-cards-grid {
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    justify-content: center;
    gap: 12px;
    width: 100%;
    padding: 10px;
}

/* Countdown Cards */
.countdown-card {
    position: relative;
    width: calc(50% - 12px);
    min-width: 140px;
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 14px 16px;
    background: var(--card-bg);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 16px;
    cursor: pointer;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

.countdown-card:hover {
    background: rgba(255, 255, 255, 0.06);
    border-color: rgba(255, 255, 255, 0.12);
    transform: translateY(-2px);
}

.countdown-card.active {
    background: rgba(124, 108, 240, 0.1);
    border-color: rgba(124, 108, 240, 0.3);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
}

.countdown-card .card-title {
    font-size: 14px;
    font-weight: 500;
    color: var(--text-white);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    padding-right: 24px;
}

.countdown-card .card-remaining {
    font-size: 12px;
    font-weight: 400;
    color: var(--text-muted);
    font-variant-numeric: tabular-nums;
}

.countdown-card .card-delete {
    position: absolute;
    top: 10px;
    right: 10px;
    width: 24px;
    height: 24px;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.04);
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: all 0.2s ease;
    font-size: 12px;
    line-height: 1;
}

.countdown-card:hover .card-delete {
    opacity: 1;
}

.countdown-card .card-delete:hover {
    background: rgba(239, 68, 68, 0.2);
    color: #ff6b6b;
}

/* Glass Add Button */
.glass-btn.add-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 24px;
    margin-top: 16px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px dashed rgba(255, 255, 255, 0.15);
    border-radius: 14px;
    color: var(--text-muted);
    cursor: pointer;
    font-family: var(--font);
    font-size: 14px;
    font-weight: 500;
    transition: all 0.3s ease;
}

.glass-btn.add-btn:hover {
    background: rgba(255, 255, 255, 0.08);
    border-style: solid;
    border-color: var(--accent-light);
    color: var(--text-white);
}

/* ==========================================
   MODERN SEGMENTED SWITCH
   ========================================== */
#mode-toggle {
    position: fixed;
    top: 32px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 500;
    display: flex;
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    padding: 5px;
    border-radius: 16px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.25);
    transition: opacity 0.4s ease, visibility 0.4s ease, transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    max-width: 95vw;
}

.mode-option {
    position: relative;
    background: transparent;
    border: none;
    color: var(--text-muted);
    padding: 10px 24px;
    border-radius: 12px;
    font-family: var(--font);
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: color 0.3s ease;
    z-index: 2;
    white-space: nowrap;
}

.mode-option:hover {
    color: var(--text-white);
}

.mode-option.active {
    color: var(--bg-dark);
    font-weight: 600;
}

.active-pill {
    position: absolute;
    top: 5px;
    left: 5px;
    height: calc(100% - 10px);
    background: #fff;
    border-radius: 12px;
    transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    z-index: 1;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

/* Mode-specific body classes for consistency */

/* ==========================================
   MAIN CONTENT
   ========================================== */
.main-content {
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    transition: opacity 0.4s ease;
}

.content-viewport {
    position: relative;
    width: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 350px;
}

.view {
    position: absolute;
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    transition: all 0.6s cubic-bezier(0.16, 1, 0.3, 1);
    opacity: 0;
    pointer-events: none;
    transform: translateY(30px) scale(0.97);
}

.view.active {
    opacity: 1;
    pointer-events: all;
    transform: translateY(0) scale(1);
}

body.mode-stopwatch #view-countdown {
    transform: translateY(-40px) scale(0.95);
    filter: blur(10px);
}

body.mode-timer #view-countdown,
body.mode-timer #view-stopwatch {
    transform: translateY(-40px) scale(0.95);
    filter: blur(10px);
}

body.mode-countdown #view-stopwatch,
body.mode-countdown #view-timer {
    transform: translateY(40px) scale(0.95);
    filter: blur(10px);
}

body.mode-stopwatch #view-timer {
    transform: translateY(40px) scale(0.95);
    filter: blur(10px);
}

/* ==========================================
   EVENT TITLE
   ========================================== */
.event-title {
    font-size: clamp(15px, 2vw, 20px);
    font-weight: 400;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    color: var(--text-muted);
    margin-bottom: 48px;
    text-align: center;
    transition: all 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

/* ==========================================
   TIMER / STOPWATCH DISPLAYS
   ========================================== */
/* ==========================================
   PREMIUM UNIFIED DISPLAY (Lens Design)
   ========================================== */
.display-wrapper {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    position: relative;
}

/* Background Highlight Aura - Centered behind the new frame */
.display-wrapper::before {
    content: '';
    position: absolute;
    width: 600px;
    height: 250px;
    background: var(--accent);
    filter: blur(140px);
    opacity: 0.12;
    border-radius: 50%;
    pointer-events: none;
    z-index: -1;
}

.timer-display,
.stopwatch-display,
.timer-view-display {
    display: flex;
    align-items: center;
    gap: 30px;
    /* Slightly more gap for wider units */
    background: var(--glass-bg);
    backdrop-filter: blur(40px);
    -webkit-backdrop-filter: blur(40px);
    border: 1px solid var(--glass-border);
    padding: 30px 60px;
    border-radius: var(--radius-xl);
    transition: all 0.5s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.5s ease;
    box-shadow:
        0 20px 50px rgba(0, 0, 0, 0.2),
        inset 0 0 20px rgba(255, 255, 255, 0.02);
    margin: 0 10px;
    max-width: calc(100% - 20px);
}

/* --- NEW PURE TYPE LAYOUT --- */
.unit {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 12px;
    transition: all 0.5s cubic-bezier(0.16, 1, 0.3, 1);
    position: relative;
    z-index: 2;
}

.unit:hover,
.unit:focus-within {
    transform: translateY(-5px);
}

.unit::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 180%;
    /* Expand way beyond the numbers */
    height: 180%;
    background: radial-gradient(circle, var(--accent-glow) 0%, transparent 70%);
    opacity: 0;
    transition: opacity 0.6s ease;
    z-index: -1;
    pointer-events: none;
}

.unit:hover::after,
.unit:focus-within::after {
    opacity: 0.35;
    /* Further reduced for an ultra-subtle, minimalist hint */
}

.unit:hover .digit {
    transform: scale(1.05);
}

/* Digital Look - ULTRA Large & Global */
.digit {
    font-family: var(--font) !important;
    font-size: clamp(4rem, 15vw, 10rem) !important;
    /* Responsive font size */
    font-weight: 200 !important;
    letter-spacing: -0.05em;
    font-variant-numeric: tabular-nums;
    color: var(--text-white);
    text-align: center;
    transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1),
        color 0.3s ease,
        opacity 0.4s ease;
    line-height: 1;
    /* Fixed vertical balance */
    display: block;
    position: relative;
    z-index: 1;
}

/* Timer Input Specific */
input.digit {
    background: transparent !important;
    border: none !important;
    outline: none !important;
    width: 1.3em;
    padding: 0 !important;
    margin: 0 !important;
    color: inherit;
    cursor: pointer;
    font-weight: 200 !important;
}

/* SPECIFIC TIGHTENING FOR TIMER VIEW ONLY */
#view-timer input.digit {
    width: 1.18em !important;
    font-weight: 200 !important;
}

input.digit:focus {
    color: #fff;
    outline: none;
}

input.digit::placeholder {
    color: rgba(255, 255, 255, 0.08) !important;
}

/* Legacy input positioning removed */

/* Timer Input Magic - Standardizing with digit */
.digit-input {
    width: 100% !important;
    height: 100% !important;
    background: transparent !important;
    border: none !important;
    color: inherit !important;
    text-align: center !important;
    font-family: inherit !important;
    /* Removed font-size: inherit to allow .digit class to rule */
}

.digit-input::-webkit-outer-spin-button,
.digit-input::-webkit-inner-spin-button {
    -webkit-appearance: none;
}

.digit-input::placeholder {
    color: rgba(255, 255, 255, 0.05) !important;
}

.label {
    font-size: 13px;
    /* Slightly larger as requested */
    font-weight: 600;
    letter-spacing: 0.2em;
    /* Slightly tighter tracking for the larger size */
    color: rgba(255, 255, 255, 0.45);
    /* A bit more visible */
    text-transform: uppercase;
    transition: all 0.3s ease;
}

.unit:hover .label,
.unit:focus-within .label {
    color: var(--text-white);
    opacity: 1;
}

.sep-wrapper {
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 10px;
}

.sep {
    font-size: 24px;
    font-weight: 100;
    color: rgba(255, 255, 255, 0.2);
    /* No pulsing anymore for cleaner look */
}

/* Responsive Scaling */
@media (max-width: 768px) {

    .timer-display,
    .stopwatch-display,
    .timer-view-display {
        padding: 20px 25px;
        gap: 15px;
        flex-wrap: wrap;
        justify-content: center;
    }

    .sep {
        font-size: 16px;
    }

    #mode-toggle {
        top: 60px; /* Push down to clear the centered .app-brand logo */
        padding: 3px;
        gap: 2px;
        max-width: 95vw;
        overflow-x: auto;
        scrollbar-width: none;
        /* Hide scrollbar for cleaner look */
    }

    #mode-toggle::-webkit-scrollbar {
        display: none;
    }

    .mode-option {
        padding: 6px 12px;
        font-size: 12px;
    }

    .event-title {
        margin-bottom: 24px;
        font-size: 14px;
    }

    .timer-controls {
        margin-top: 24px;
        gap: 15px;
    }

    .timer-main-btn {
        width: 64px;
        height: 64px;
    }

    .timer-sec-btn {
        width: 48px;
        height: 48px;
    }

    .digit {
        font-size: clamp(2.5rem, 12vw, 5rem) !important;
    }

    .unit {
        gap: 6px;
    }

    .label {
        font-size: 10px;
        letter-spacing: 0.15em;
    }

    .timer-display,
    .stopwatch-display,
    .timer-view-display {
        padding: 15px 20px;
        gap: 10px;
        border-radius: var(--radius-lg);
        flex-wrap: nowrap;
        /* Prevent units from breaking to new line unless really needed */
    }

    .timer-presets {
        display: grid;
        grid-template-columns: repeat(4, 1fr);
        gap: 6px;
        padding: 8px;
        margin-top: 20px;
    }

    .preset-btn {
        padding: 8px 12px;
        font-size: 11px;
        justify-content: center;
    }

    .bottom-controls {
        bottom: 20px;
        gap: 16px;
    }

    .glass-btn {
        padding: 10px;
    }


}

@media (max-width: 400px) {

    .timer-display,
    .stopwatch-display,
    .timer-view-display {
        gap: 5px;
        padding: 12px 15px;
    }

    .digit {
        font-size: clamp(2rem, 10vw, 3.5rem) !important;
    }

    .timer-display,
    .stopwatch-display,
    .timer-view-display {
        gap: 6px;
        padding: 12px 10px;
    }

    .sep-wrapper {
        margin: 0 4px;
    }

    .timer-presets {
        grid-template-columns: repeat(3, 1fr);
    }
}

/* View Transitions */
.view {
    position: absolute;
    width: 100%;
    transition: all 0.8s cubic-bezier(0.2, 0.8, 0.2, 1);
    opacity: 0;
    pointer-events: none;
    transform: scale(0.95) translateY(20px);
    filter: blur(10px);
}

.view.active {
    opacity: 1;
    pointer-events: all;
    transform: scale(1) translateY(0);
    filter: blur(0);
}

/* ==========================================
   BOTTOM CONTROLS
   ========================================== */
.bottom-controls {
    position: fixed;
    bottom: 44px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    align-items: center;
    gap: 24px;
    /* Increased for circular buttons */
    z-index: 100;
    transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.4s ease, visibility 0.4s ease;
}

.bottom-controls.hidden {
    transform: translateX(-50%) translateY(100px) !important;
    opacity: 0 !important;
    pointer-events: none !important;
    visibility: hidden !important;
}

.control-group {
    display: flex;
    align-items: center;
    gap: 10px;
}

.glass-btn {
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    color: var(--text-white);
    padding: 14px;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.25s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.glass-btn:hover {
    background: rgba(255, 255, 255, 0.12);
    transform: scale(1.08);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
}

.glass-btn:active {
    transform: scale(0.95);
}

.play-btn {
    border-radius: 28px;
    padding: 14px 28px;
}

.primary-btn {
    background: var(--text-white);
    color: var(--bg-dark);
    border: none;
    padding: 14px 28px;
    border-radius: 28px;
    font-size: 14px;
    font-weight: 600;
    font-family: var(--font);
    cursor: pointer;
    transition: all 0.25s ease;
    display: flex;
    align-items: center;
    gap: 8px;
    box-shadow: 0 4px 20px rgba(255, 255, 255, 0.08);
}

.primary-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 6px 28px rgba(255, 255, 255, 0.12);
}

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

/* Mode visibility */
body.mode-countdown .stopwatch-only,
body.mode-countdown .timer-only {
    display: none;
}

body.mode-stopwatch .countdown-only,
body.mode-stopwatch .timer-only {
    display: none;
}

body.mode-timer .countdown-only,
body.mode-timer .stopwatch-only {
    display: none;
}

body:not(.mode-pomodoro) .pomodoro-only {
    display: none;
}

/* ==========================================
   TIMER VIEW STYLES
   ========================================== */
#view-timer {
    position: absolute;
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

#view-timer.active {
    opacity: 1;
    pointer-events: all;
    transform: translateY(0) scale(1);
    filter: blur(0);
}

.timer-controls {
    display: flex;
    gap: 20px;
    align-items: center;
    margin-top: 40px;
    transition: all 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

body.zen .timer-controls {
    margin-top: 24px;
}

.timer-main-btn {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: #fff;
    border: none;
    color: #000;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    box-shadow: 0 8px 24px rgba(255, 255, 255, 0.2);
}

.timer-main-btn:hover {
    transform: scale(1.1);
    box-shadow: 0 12px 32px rgba(255, 255, 255, 0.3);
}

.timer-main-btn.running {
    background: #ff4757;
    color: #fff;
    box-shadow: 0 8px 24px rgba(255, 71, 87, 0.3);
}

.timer-sec-btn {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: var(--text-white);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.timer-sec-btn:hover {
    background: rgba(255, 255, 255, 0.12);
    transform: scale(1.08);
}

.timer-main-btn svg,
.timer-sec-btn svg {
    width: 24px;
    height: 24px;
    fill: currentColor;
}

/* Legacy timer media query removed */

/* ==========================================
   ZEN MODE
   ========================================== */
body.zen #mode-toggle {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

body.zen .bottom-controls {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

body.zen #btn-toggle-presets,
body.zen #timer-presets-panel {
    opacity: 0 !important;
    pointer-events: none !important;
}

body.zen .app-brand {
    opacity: 0;
}

body.zen .event-title {
    margin-bottom: 24px;
    font-size: clamp(20px, 3vw, 28px);
    color: rgba(255, 255, 255, 0.55);
}

.lock-status-indicator {
    display: flex;
    justify-content: center;
    align-items: center;
    margin-bottom: 12px;
    opacity: 0;
    pointer-events: none;
    transition: all 0.5s cubic-bezier(0.16, 1, 0.3, 1);
    color: var(--accent);
    filter: drop-shadow(0 0 10px var(--accent-glow));
}

.lock-status-indicator.visible {
    opacity: 1;
    transform: scale(1.1);
}

.lock-status-indicator svg {
    width: 38px;
    height: 38px;
}

/* Red Shake Feedback for Lock Icon */
.lock-status-indicator.locked-error {
    animation: shakeIndicator 0.5s cubic-bezier(0.36, 0.07, 0.19, 0.97) both;
    color: #f43f5e !important;
    filter: drop-shadow(0 0 15px rgba(244, 63, 94, 0.6));
}

@keyframes shakeIndicator {

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

    15%,
    85% {
        transform: scale(1.1) translateX(-8px);
    }

    35%,
    65% {
        transform: scale(1.1) translateX(8px);
    }

    50% {
        transform: scale(1.1) translateX(0);
    }
}

.zen-controls {
    position: fixed;
    bottom: 32px;
    right: 32px;
    z-index: 300;
    display: flex;
    align-items: center;
    gap: 16px;
    opacity: 0;
    pointer-events: none;
    transition: all 0.3s ease;
}

body.zen .zen-controls {
    opacity: 1;
    pointer-events: all;
}

.zen-exit-btn {
    position: fixed;
    bottom: 32px;
    right: 32px;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    color: var(--text-muted);
    width: 52px;
    height: 52px;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
}

.zen-exit-btn:hover {
    background: rgba(255, 255, 255, 0.12);
    color: var(--text-white);
    transform: scale(1.08);
}

/* Refined Slide to Unlock Styles */
.unlock-slider-wrapper {
    position: fixed;
    bottom: 40px;
    right: 50%;
    transform: translateX(50%) translateY(100px);
    width: calc(100% - 40px);
    max-width: 320px;
    height: 64px;
    background: rgba(255, 255, 255, 0.04);
    backdrop-filter: blur(25px);
    -webkit-backdrop-filter: blur(25px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 32px;
    z-index: 2000;
    opacity: 0;
    pointer-events: none;
    transition: all 0.7s cubic-bezier(0.16, 1, 0.3, 1);
}

body.zen .unlock-slider-wrapper.visible {
    transform: translateX(50%) translateY(0);
    opacity: 1;
    pointer-events: all;
}

/* Morphing Minimized State */
body.zen .unlock-slider-wrapper.minimized {
    width: 52px;
    height: 52px;
    right: 96px;
    bottom: 32px;
    transform: translateX(0) translateY(0);
    border-radius: 50%;
    opacity: 1;
    pointer-events: all;
    background: rgba(255, 255, 255, 0.1);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
}

.unlock-slider-wrapper.minimized .unlock-slider-text-container {
    opacity: 0;
    visibility: hidden;
}

.unlock-slider-wrapper.minimized .unlock-slider-handle {
    transform: translateX(0) !important;
    left: 4px;
    top: 3px;
    width: 52px;
    height: 52px;
    background: var(--accent);
    color: #fff;
    cursor: pointer;
}

.unlock-slider-wrapper.minimized .unlock-slider-track {
    padding: 0;
    display: flex;
    justify-content: center;
    align-items: center;
}

.unlock-slider-track {
    position: relative;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    padding: 6px;
}

.unlock-slider-text-container {
    position: absolute;
    left: 0;
    right: 0;
    width: 100%;
    display: flex;
    justify-content: center;
    pointer-events: none;
    transition: padding 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}

.unlock-slider-text {
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.12em;
    color: rgba(255, 255, 255, 0.25);
    user-select: none;
    text-transform: uppercase;
    background: linear-gradient(90deg, rgba(255, 255, 255, 0) 0%, rgba(255, 255, 255, 0.8) 50%, rgba(255, 255, 255, 0) 100%);
    background-size: 200% 100%;
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    animation: shine 6s infinite linear;
}

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

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

.unlock-slider-handle {
    width: 52px;
    height: 52px;
    background: #fff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--bg-dark);
    cursor: grab;
    z-index: 10;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.25);
    transition: transform 0.1s ease;
    touch-action: none;
}

.unlock-slider-handle:active {
    cursor: grabbing;
}

/* Animations & Locked State Feedback */
@keyframes shakeError {

    0%,
    100% {
        transform: translateX(0);
        box-shadow: none;
    }

    20% {
        transform: translateX(-8px);
        box-shadow: 0 0 20px rgba(244, 63, 94, 0.4);
    }

    40% {
        transform: translateX(8px);
        box-shadow: 0 0 20px rgba(244, 63, 94, 0.4);
    }

    60% {
        transform: translateX(-5px);
        box-shadow: 0 0 15px rgba(244, 63, 94, 0.3);
    }

    80% {
        transform: translateX(5px);
        box-shadow: 0 0 15px rgba(244, 63, 94, 0.3);
    }
}

.locked-error {
    animation: shakeError 0.45s cubic-bezier(0.36, 0.07, 0.19, 0.97) both;
    border-color: rgba(244, 63, 94, 0.5) !important;
}

body.is-locked .timer-display,
body.is-locked .stopwatch-display,
body.is-locked .pomo-indicators {
    opacity: 0.7;
    transition: opacity 0.5s ease;
}

/* Pointer events are now managed via JS to allow :active states while blocking logic */

/* Override pointer-events for feedback detection via parent if needed, 
   but for now we'll handle it in JS by adding class to the body or capturing globally */

/* ==========================================
   MODALS
   ========================================== */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    /* Darker overlay for better contrast */
    backdrop-filter: blur(25px);
    -webkit-backdrop-filter: blur(25px);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: all 0.4s ease;
}

.modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

.modal-card {
    background: rgba(20, 20, 35, 0.85);
    border: 1px solid rgba(255, 255, 255, 0.08);
    padding: 40px;
    border-radius: var(--radius-lg);
    width: 90%;
    max-width: 440px;
    transform: translateY(40px) scale(0.92);
    transition: all 0.5s cubic-bezier(0.16, 1, 0.3, 1);
    box-shadow: 0 24px 80px rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(60px);
    -webkit-backdrop-filter: blur(60px);
    position: relative;
}

.modal-close-btn {
    position: absolute;
    top: 20px;
    right: 20px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.08);
    color: var(--text-muted);
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    z-index: 10;
}

.modal-close-btn:hover {
    background: rgba(255, 255, 255, 0.08);
    color: #fff;
    transform: rotate(90deg);
}

.modal-overlay.active .modal-card {
    transform: translateY(0) scale(1);
}

.modal-card h2 {
    font-size: 22px;
    font-weight: 600;
    margin-bottom: 30px;
    letter-spacing: -0.01em;
}

.input-field {
    margin-bottom: 22px;
}

.input-field label {
    display: block;
    font-size: 12px;
    color: var(--text-muted);
    margin-bottom: 10px;
    font-weight: 500;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

.input-field input,
.input-field select {
    width: 100%;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    padding: 16px;
    border-radius: var(--radius-sm);
    color: #fff;
    font-family: var(--font);
    font-size: 15px;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
    outline: none;
    appearance: none;
}

.input-field input:focus,
.input-field select:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-glow);
}

.theme-grid {
    display: flex;
    gap: 12px;
    margin-top: 5px;
}

.theme-opt {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: 2px solid transparent;
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
    padding: 0;
}

.theme-opt:hover {
    transform: scale(1.15);
}

.theme-opt.active {
    border-color: #fff;
    transform: scale(1.1);
    box-shadow: 0 0 10px rgba(255, 255, 255, 0.3);
}

.theme-opt.active::after {
    content: '✓';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: #fff;
    font-size: 14px;
    font-weight: bold;
}

.input-field select option {
    background: var(--bg-dark);
    color: #fff;
}

.modal-btns {
    display: flex;
    gap: 12px;
    margin-top: 32px;
}

.modal-btns button,
.full-width {
    flex: 1;
    padding: 16px;
    border-radius: var(--radius-sm);
    font-weight: 600;
    font-family: var(--font);
    font-size: 14px;
    cursor: pointer;
    border: none;
    transition: all 0.25s ease;
}

.save-btn {
    background: var(--accent);
    color: #fff;
    box-shadow: 0 4px 16px rgba(124, 108, 240, 0.3);
}

.save-btn:hover {
    background: #8b7cf5;
    transform: translateY(-1px);
    box-shadow: 0 6px 24px rgba(124, 108, 240, 0.4);
}

.cancel-btn {
    background: rgba(255, 255, 255, 0.06);
    color: var(--text-white);
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.cancel-btn:hover {
    background: rgba(255, 255, 255, 0.1);
}

/* Confirmation Modal Specifics */
.mini-modal {
    max-width: 360px !important;
    text-align: center;
    padding: 36px 28px 28px !important;
}

.confirm-content {
    margin-bottom: 24px;
}

.confirm-icon {
    color: #ff4757;
    background: rgba(255, 71, 87, 0.1);
    width: 64px;
    height: 64px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 20px;
}

#confirm-message {
    color: var(--text-muted);
    font-size: 14px;
    line-height: 1.5;
    margin-top: 10px;
}

.save-btn.danger {
    background: #ff4757;
    box-shadow: 0 4px 16px rgba(255, 71, 87, 0.3);
}

.save-btn.danger:hover {
    background: #ff6b81;
    box-shadow: 0 6px 24px rgba(255, 71, 87, 0.4);
}

/* iOS Style Slider */
.ios-slider {
    flex: 1;
    width: 100%;
    height: 56px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 28px;
    position: relative;
    padding: 4px;
    overflow: hidden;
    cursor: pointer;
    user-select: none;
    backdrop-filter: blur(10px);
    margin-top: 10px;
}

.modal-btns.centered {
    justify-content: center;
    margin-top: 24px;
}

.slider-track {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.slider-text {
    font-size: 13px;
    font-weight: 500;
    letter-spacing: 0.03em;
    background: linear-gradient(90deg,
            rgba(255, 255, 255, 0.3) 0%,
            rgba(255, 255, 255, 0.3) 35%,
            rgba(255, 255, 255, 0.9) 50%,
            rgba(255, 255, 255, 0.3) 65%,
            rgba(255, 255, 255, 0.3) 100%);
    background-size: 200% 100%;
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    animation: sliderShimmer 2.5s infinite linear;
}

@keyframes sliderShimmer {
    0% {
        background-position: -100% 0;
    }

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

.slider-handle {
    position: absolute;
    top: 50%;
    left: 4px;
    transform: translateY(-50%);
    width: 48px;
    height: 48px;
    background: #fff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #ff4757;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.25);
    transition: left 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    z-index: 2;
}

.ios-slider.active .slider-handle {
    transition: none;
}


/* ==========================================
   BRANDING
   ========================================== */
.app-brand {
    position: absolute;
    top: 32px;
    left: 32px;
    z-index: 150;
    transition: opacity 0.4s ease;
}

.brand-logo {
    font-size: 20px;
    font-weight: 700;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    background: linear-gradient(135deg, #fff 0%, rgba(255, 255, 255, 0.6) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    opacity: 0.3;
    transition: opacity 0.3s ease;
}

.app-brand:hover .brand-logo {
    opacity: 0.8;
}


/* ==========================================
   STOPWATCH LAPS
   ========================================== */
.laps-container {
    width: 100%;
    max-width: 500px;
    max-height: 200px;
    overflow-y: auto;
    margin-top: 30px;
    padding: 10px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 255, 255, 0.1) transparent;
    transition: all 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

.laps-container::-webkit-scrollbar {
    width: 4px;
}

.laps-container::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
}

.lap-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 20px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    animation: slideInUp 0.3s ease;
}

.lap-number {
    font-size: 13px;
    font-weight: 600;
    color: var(--accent);
    width: 40px;
}

.lap-time {
    font-size: 15px;
    font-weight: 500;
    color: var(--text-white);
    font-variant-numeric: tabular-nums;
}

.lap-total {
    font-size: 13px;
    color: var(--text-muted);
    font-variant-numeric: tabular-nums;
}

@keyframes slideInUp {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ==========================================
   TIMER PRESETS
   ========================================== */
.timer-presets {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 8px;
    margin-top: 45px;
    opacity: 1;
    transition: all 0.6s cubic-bezier(0.16, 1, 0.3, 1);
    background: rgba(255, 255, 255, 0.02);
    padding: 10px;
    border-radius: 20px;
    border: 1px solid rgba(255, 255, 255, 0.04);
    max-width: 90%;
    overflow: hidden;
}

#btn-toggle-presets {
    display: none;
    margin-top: 20px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: var(--text-muted);
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
}

#btn-toggle-presets:hover {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-white);
}

@media (max-width: 600px) {
    #btn-toggle-presets {
        display: flex;
        align-items: center;
        gap: 6px;
    }

    .timer-presets {
        max-height: 0;
        margin-top: 0;
        opacity: 0;
        padding: 0;
        border: none;
        pointer-events: none;
        transition: all 0.5s cubic-bezier(0.16, 1, 0.3, 1);
    }

    .timer-presets.active {
        max-height: 200px;
        margin-top: 20px;
        opacity: 1;
        padding: 10px;
        border: 1px solid rgba(255, 255, 255, 0.04);
        pointer-events: auto;
    }

    /* Custom Date Picker Mobile Optimizations for 600px */
    .picker-dropdown {
        width: 100vw;
        left: 50% !important;
        transform: translateX(-50%) !important;
        border-radius: 20px 20px 0 0;
        bottom: 0;
        top: auto !important;
        position: fixed;
        padding: 16px 12px calc(16px + env(safe-area-inset-bottom));
        max-height: 80vh;
        overflow-y: auto;
    }

    .picker-dropdown.active {
        animation: slideUpMobile 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    }

    @keyframes slideUpMobile {
        from {
            transform: translate(-50%, 100%);
        }

        to {
            transform: translate(-50%, 0);
        }
    }

    .calendar-grid {
        gap: 2px;
        margin-bottom: 12px;
    }

    .calendar-day {
        font-size: 13px;
        padding: 8px;
        border-radius: 6px;
    }

    .calendar-weekday {
        font-size: 9px;
        padding-bottom: 2px;
    }

    .time-picker {
        gap: 10px;
        padding-top: 10px;
        margin-bottom: 12px;
    }

    .time-picker input {
        width: 80px;
        font-size: 22px;
        padding: 14px;
        border-radius: 10px;
    }

    .picker-confirm-btn {
        padding: 16px;
        font-size: 17px;
        min-height: 52px;
        border-radius: 14px;
    }
}

.preset-btn {
    background: transparent;
    border: 1px solid transparent;
    color: var(--text-muted);
    padding: 10px 20px;
    border-radius: 14px;
    font-size: 13px;
    font-weight: 600;
    letter-spacing: 0.02em;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    display: flex;
    align-items: center;
    gap: 8px;
}

.preset-btn svg {
    opacity: 0.4;
    transition: transform 0.3s ease, opacity 0.3s ease;
}

.preset-btn:hover {
    background: rgba(255, 255, 255, 0.06);
    color: var(--text-white);
    border-color: rgba(255, 255, 255, 0.1);
    transform: translateY(-2px);
}

.preset-btn:hover svg {
    opacity: 1;
    color: var(--accent);
    transform: rotate(15deg);
}

.preset-btn:active {
    transform: scale(0.95);
    background: var(--accent-glow);
}

/* Zen modunda hazir butonlari ve diğer panelleri gizle/daralt (Pomodoro işaretleri hariç) */
body.zen .timer-presets,
body.zen .laps-container,
body.zen .stats-panel {
    max-height: 0;
    margin-top: 0 !important;
    margin-bottom: 0 !important;
    opacity: 0;
    pointer-events: none;
    transform: translateY(30px) scale(0.95);
    visibility: hidden;
    overflow: hidden;
    padding-top: 0 !important;
    padding-bottom: 0 !important;
    border: none !important;
}

/* ==========================================
   COMPLETION EFFECTS
   ========================================== */
@keyframes shake {

    0%,
    100% {
        transform: translateX(0);
    }

    25% {
        transform: translateX(-10px) rotate(-1deg);
    }

    75% {
        transform: translateX(10px) rotate(1deg);
    }
}

.finished-animation {
    animation: shake 0.5s cubic-bezier(.36, .07, .19, .97) both;
    transform: translate3d(0, 0, 0);
    backface-visibility: hidden;
    perspective: 1000px;
}

.timer-display.finished,
.stopwatch-display.finished {
    color: #ff4757 !important;
    text-shadow: 0 0 20px rgba(255, 71, 87, 0.4);
}

/* Pomodoro Specific: Use theme colors instead of red for finished state */
body.mode-pomodoro .stopwatch-display.finished {
    color: var(--accent) !important;
    text-shadow: 0 0 20px var(--accent-glow) !important;
}

/* ==========================================
   POMODORO
   ========================================== */
.pomo-phase-label {
    display: inline-block;
    font-size: inherit;
    font-weight: inherit;
    letter-spacing: inherit;
    text-transform: uppercase;
    color: var(--accent);
    background: transparent;
    padding: 0;
    border-radius: 0;
    border: none;
    transition: all 0.6s cubic-bezier(0.16, 1, 0.3, 1);
    vertical-align: middle;
}

body.zen .pomo-phase-label {
    padding: 0;
    background: transparent;
    box-shadow: none;
    text-shadow: 0 0 15px var(--accent-glow);
}

.pomo-indicators {
    display: flex;
    gap: 10px;
    margin-top: 30px;
    justify-content: center;
    transition: all 0.6s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.5s ease;
}

.pomo-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.05);
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.pomo-dot.active {
    background: var(--accent);
    box-shadow: 0 0 15px var(--accent-glow);
    transform: scale(1.3);
}

.pomo-dot.completed {
    background: var(--accent);
    opacity: 0.6;
}

/* Break Theme Override */
body.pomo-break {
    --accent: #10b981;
    --accent-rgb: 16, 185, 129;
    --accent-glow: rgba(16, 185, 129, 0.3);
}

/* ==========================================
   RESPONSIVE
   ========================================== */
@media (max-width: 768px) {
    :root {
        --radius-xl: 30px;
        /* Smaller radius for display */
    }

    .bottom-controls {
        bottom: 30px;
    }

    body {
        padding-left: 0 !important;
        /* Override sidebar padding if it's open */
    }
}

@media (max-width: 480px) {
    :root {
        --radius-xl: 24px;
    }

    #mode-toggle {
        top: 60px; /* Push down to clear .app-brand */
    }

    .timer-display,
    .stopwatch-display,
    .timer-view-display {
        padding: 15px;
        gap: 8px;
    }

    .label {
        font-size: 10px;
        letter-spacing: 0.1em;
    }

    .mode-option {
        padding: 8px 10px;
        font-size: 12px;
    }

    .digit-ms {
        font-size: clamp(2.5rem, 12vw, 5rem) !important;
    }

    .event-title {
        margin-bottom: 32px;
    }

    .primary-btn {
        padding: 12px 20px;
        font-size: 13px;
    }


    .glass-btn {
        padding: 12px;
    }

    .timer-main-btn {
        width: 70px;
        height: 70px;
    }

    .timer-sec-btn {
        width: 50px;
        height: 50px;
    }

    /* Custom Date Picker Mobile Optimizations */
    .picker-dropdown {
        width: 100vw;
        left: 50% !important;
        transform: translateX(-50%) !important;
        border-radius: 20px 20px 0 0;
        bottom: 0;
        top: auto !important;
        position: fixed;
        padding: 16px 12px calc(16px + env(safe-area-inset-bottom));
        max-height: 80vh;
        overflow-y: auto;
    }

    .picker-dropdown.active {
        animation: slideUpMobile 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    }

    @keyframes slideUpMobile {
        from {
            transform: translate(-50%, 100%);
        }

        to {
            transform: translate(-50%, 0);
        }
    }

    .calendar-grid {
        gap: 2px;
        margin-bottom: 12px;
    }

    .calendar-day {
        font-size: 13px;
        padding: 8px;
        border-radius: 6px;
    }

    .calendar-weekday {
        font-size: 9px;
        padding-bottom: 2px;
    }

    .time-picker {
        gap: 10px;
        padding-top: 10px;
        margin-bottom: 12px;
    }

    .time-picker input {
        width: 80px;
        font-size: 22px;
        padding: 14px;
        border-radius: 10px;
    }

    .picker-confirm-btn {
        padding: 16px;
        font-size: 17px;
        min-height: 52px;
        border-radius: 14px;
    }
}

/* Date Picker Button */
.date-picker-btn {
    width: 100%;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.1);
    padding: 16px;
    border-radius: var(--radius-sm);
    color: var(--text-white);
    font-family: var(--font);
    font-size: 15px;
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: left;
}

.date-picker-btn:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: var(--accent);
}

/* Date Picker Modal */
.date-picker-modal-card {
    max-width: 400px;
    width: 90%;
    padding: 30px;
}

.date-picker-modal-card h2 {
    text-align: center;
    margin-bottom: 20px;
}

/* Custom Date Picker */
.custom-date-picker {
    width: 100%;
}

.calendar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
}

.calendar-header button {
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: var(--text-white);
    cursor: pointer;
    padding: 8px 14px;
    font-size: 18px;
    border-radius: 10px;
    transition: all 0.2s ease;
}

.calendar-header button:hover {
    background: rgba(255, 255, 255, 0.12);
    transform: scale(1.05);
}

#current-month-year {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-white);
}

.calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 4px;
    margin-bottom: 20px;
}

.calendar-day {
    aspect-ratio: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    cursor: pointer;
    border-radius: 10px;
    transition: all 0.2s ease;
    font-weight: 500;
}

.calendar-day:hover:not(.empty) {
    background: rgba(255, 255, 255, 0.12);
    transform: scale(1.1);
}

.calendar-day.active {
    background: var(--accent);
    color: white;
    box-shadow: 0 4px 12px var(--accent-glow);
}

.calendar-day.today {
    border: 2px solid var(--accent);
}

.calendar-day.empty {
    cursor: default;
}

.calendar-weekday {
    font-size: 11px;
    font-weight: 600;
    color: var(--text-muted);
    text-align: center;
    padding-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.time-picker {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding-top: 16px;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    margin-bottom: 20px;
}

.time-picker input {
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.12);
    color: white;
    width: 80px;
    padding: 12px;
    border-radius: 12px;
    text-align: center;
    font-family: inherit;
    font-size: 24px;
    font-weight: 600;
    transition: all 0.2s ease;
}

.time-picker input:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-glow);
}

.time-picker span {
    font-size: 24px;
    font-weight: 600;
    color: var(--text-muted);
}

.picker-confirm-btn {
    width: 100%;
    padding: 16px;
    background: var(--accent);
    border: none;
    border-radius: 14px;
    color: white;
    font-weight: 600;
    font-size: 16px;
    cursor: pointer;
    transition: all 0.2s ease;
    font-family: var(--font);
}

.picker-confirm-btn:hover {
    background: #8b7cf5;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px var(--accent-glow);
}

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

/* Mobile Date Picker Modal */
@media (max-width: 600px) {
    .date-picker-modal-card {
        width: 95%;
        max-height: 90vh;
        overflow-y: auto;
        padding: 20px 16px;
        margin: 10px auto;
    }

    .calendar-grid {
        gap: 3px;
    }

    .calendar-day {
        font-size: 13px;
        padding: 6px;
        border-radius: 8px;
    }

    .calendar-weekday {
        font-size: 10px;
        padding-bottom: 6px;
    }

    .time-picker input {
        width: 70px;
        font-size: 22px;
        padding: 14px;
        border-radius: 10px;
    }

    .picker-confirm-btn {
        padding: 18px;
        font-size: 17px;
        border-radius: 16px;
    }
}

/* Statistics Panel */
.stats-panel {
    width: 100%;
    max-width: 450px;
    max-height: 0;
    opacity: 0;
    overflow: hidden;
    transition: max-height 0.6s cubic-bezier(0.16, 1, 0.3, 1),
        opacity 0.4s ease 0.1s,
        margin-top 0.6s cubic-bezier(0.16, 1, 0.3, 1);
    margin-top: 0;
}

.stats-panel.active {
    max-height: 600px;
    opacity: 1;
    margin-top: 40px;
}

@media (max-width: 600px) {
    .stats-panel {
        position: fixed;
        bottom: calc(90px + env(safe-area-inset-bottom));
        left: 50%;
        transform: translateX(-50%);
        width: 88%;
        max-width: 380px;
        z-index: 1000;
        background: rgba(10, 10, 20, 0.95);
        backdrop-filter: blur(20px);
        border: 1px solid var(--glass-border);
        border-radius: 20px;
        box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4);
    }

    .stats-panel.active {
        max-height: 75vh;
        margin-top: 0;
        padding: 5px;
    }
}

.stats-panel-inner {
    padding: 16px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 16px;
    text-align: center;
}

.stats-header h3 {
    text-align: center;
    margin: 0 0 15px 0;
    font-size: 0.85rem;
    font-weight: 500;
    letter-spacing: 0.05em;
    color: var(--text-muted);
    text-transform: uppercase;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
    margin-bottom: 20px;
}

.stat-item {
    background: rgba(0, 0, 0, 0.12);
    padding: 10px 5px;
    border-radius: 10px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 5px;
    transition: all 0.3s ease;
    cursor: pointer;
    border: 1px solid transparent;
}

.stat-item:hover {
    transform: translateY(-3px);
    background: rgba(0, 0, 0, 0.25);
}

.stat-item.active {
    background: rgba(124, 108, 240, 0.15);
    border-color: rgba(124, 108, 240, 0.3);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.stat-value {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-white);
}

.stat-label {
    font-size: 0.6rem;
    opacity: 0.5;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.stats-reset-btn {
    background: transparent;
    border: 1px solid rgba(255, 100, 100, 0.3);
    color: rgba(255, 100, 100, 0.7);
    padding: 8px 16px;
    border-radius: 10px;
    font-size: 0.75rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-block;
}

.stats-reset-btn:hover {
    background: rgba(255, 100, 100, 0.2);
    color: #ff8a8a;
    border-color: rgba(255, 100, 100, 0.5);
}

/* Specific button state for active toggle */
#btn-pomo-stats.active {
    background: var(--accent);
    color: #fff;
    border-color: var(--accent);
    box-shadow: 0 0 15px var(--accent-glow);
}

/* Chart Container */
.chart-container {
    position: relative;
    height: 140px;
    width: 100%;
    margin-bottom: 15px;
}

/* Settings Section Styles */
.settings-section {
    margin-top: 24px;
    padding-top: 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.section-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.1em;
    margin-bottom: 20px;
}

.settings-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

.input-with-unit {
    display: flex;
    align-items: center;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 12px;
    padding: 2px 8px;
    /* Slightly reduced horizontal padding */
    transition: all 0.2s ease;
}

.input-with-unit:focus-within {
    border-color: var(--accent);
    background: rgba(255, 255, 255, 0.08);
}

.step-btn {
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-size: 16px;
    font-weight: 600;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    border-radius: 6px;
    transition: all 0.2s ease;
    user-select: none;
}

.step-btn:hover {
    background: rgba(255, 255, 255, 0.08);
    color: var(--text-white);
}

.step-btn:active {
    transform: scale(0.9);
}

.input-with-unit input {
    background: transparent;
    border: none;
    color: var(--text-white);
    font-family: var(--font);
    font-size: 14px;
    padding: 8px 0;
    width: 32px;
    /* Fixed width for better layout with buttons */
    outline: none;
    text-align: center;
}

.input-with-unit span {
    font-size: 12px;
    color: var(--text-muted);
    margin-left: 8px;
    font-weight: 500;
}

/* Hide spin buttons */
.input-with-unit input::-webkit-outer-spin-button,
.input-with-unit input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

@media (max-width: 600px) {

    .settings-grid {
        grid-template-columns: 1fr;
    }

    #mode-toggle {
        top: calc(65px + env(safe-area-inset-top)) !important;
        max-width: 95vw;
        padding: 4px;
    }

    .modal-card {
        padding: 20px 12px;
        width: 92%;
        max-height: 90vh;
        overflow-y: auto;
        text-align: center !important;
        background: rgba(10, 10, 20, 0.98) !important;
    }

    .modal-card h2 {
        font-size: 18px;
        margin-bottom: 20px;
    }

    .input-field label {
        text-align: center !important;
        width: 100%;
        display: block;
    }

    .modal-btns {
        flex-direction: column !important;
        gap: 12px !important;
    }

    .modal-btns button {
        width: 100% !important;
        margin: 0 !important;
    }
}

/* Optimization for Extra Tall Displays (19.5:9 and similar) */
@media (max-width: 600px) and (min-aspect-ratio: 9/19) {
    .main-content {
        padding-top: calc(100px + env(safe-area-inset-top));
        justify-content: center;
        gap: 2vh;
    }

    #mode-toggle {
        top: calc(75px + env(safe-area-inset-top)) !important;
    }

    .timer-display,
    .stopwatch-display,
    .timer-view-display {
        margin-bottom: 2vh;
    }

    .bottom-controls {
        bottom: calc(30px + env(safe-area-inset-bottom));
    }

    .zen-exit-btn {
        bottom: calc(32px + env(safe-area-inset-bottom)) !important;
        right: 20px !important;
        width: 44px !important;
        height: 44px !important;
    }

    body.zen .unlock-slider-wrapper {
        bottom: calc(40px + env(safe-area-inset-bottom)) !important;
        height: 52px !important;
        max-width: 280px !important;
    }

    body.zen .unlock-slider-wrapper .unlock-slider-handle {
        width: 44px !important;
        height: 44px !important;
        top: 3px !important;
        left: 3px !important;
    }

    body.zen .unlock-slider-wrapper.minimized {
        bottom: calc(32px + env(safe-area-inset-bottom)) !important;
        right: 74px !important;
        /* 20px edge + 44px btn + 10px gap */
        width: 44px !important;
        height: 44px !important;
    }

    body.zen .unlock-slider-wrapper.minimized .unlock-slider-handle {
        width: 38px !important;
        height: 38px !important;
        left: 2px !important;
        top: 2px !important;
    }
}

/* Ensure background fills entire viewport including safe areas */
html,
body {
    height: 100%;
    overflow-x: hidden;
}

body {
    min-height: 100vh;
    min-height: -webkit-fill-available;
}

/* ==========================================
   RESPONSIVE BRANDING OVERRIDES
   ========================================== */
@media (max-width: 768px) {
    .app-brand {
        top: 20px;
        left: 50%;
        transform: translateX(-50%);
        width: 100%;
        text-align: center;
        display: flex;
        justify-content: center;
    }

    .brand-logo {
        font-size: 18px;
        opacity: 0.5;
    }
}

@media (max-width: 600px) {
    .app-brand {
        top: calc(20px + env(safe-area-inset-top));
        left: 0;
        width: 100%;
        display: flex;
        justify-content: center;
        align-items: center;
        transform: none;
        padding: 0;
    }

    .brand-logo {
        font-size: 16px;
        letter-spacing: 0.1em;
        opacity: 0.6;
        white-space: nowrap;
        text-align: center;
    }
}

@media (max-width: 480px) {
    .app-brand {
        top: 20px;
        left: 50%;
        transform: translateX(-50%);
    }

    .brand-logo {
        font-size: 16px;
    }
}

/* ==========================================
   ADSENSE READINESS: FOOTER, COOKIE, SEO
   ========================================== */

.app-footer {
    padding: 30px 20px 40px 20px;
    background: rgba(0, 0, 0, 0.2);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-top: 1px solid var(--glass-border);
    margin-top: 30px;
}

.footer-content {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 20px;
}

.copyright {
    color: var(--text-muted);
    font-size: 14px;
}

.footer-links {
    display: flex;
    gap: 25px;
}

.footer-links a {
    color: var(--text-muted);
    text-decoration: none;
    font-size: 14px;
    transition: color 0.3s ease;
}

.footer-links a:hover {
    color: var(--accent);
}

/* Cookie Banner */
.cookie-banner {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 9000;
    width: 90%;
    max-width: 500px;
    background: rgba(20, 20, 30, 0.85);
    backdrop-filter: blur(30px);
    -webkit-backdrop-filter: blur(30px);
    border: 1px solid var(--glass-border);
    padding: 20px;
    border-radius: var(--radius-md);
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.4);
    transition: all 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}

.cookie-banner.hidden {
    transform: translate(-50%, 150%);
    opacity: 0;
    pointer-events: none;
}

.cookie-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
}

.cookie-content p {
    font-size: 13px;
    color: rgba(255, 255, 255, 0.8);
    line-height: 1.5;
}

.cookie-btn {
    background: var(--accent);
    color: white;
    border: none;
    padding: 8px 20px;
    border-radius: 10px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    white-space: nowrap;
    transition: transform 0.3s ease;
}

.cookie-btn:active {
    transform: scale(0.95);
}

/* SEO Content */
.seo-content-wrapper {
    padding: 40px 20px;
    max-width: 800px;
    margin: 0 auto;
}

.seo-container h2 {
    font-size: 28px;
    font-weight: 300;
    margin-bottom: 25px;
    color: var(--accent);
}

.seo-container p {
    font-size: 16px;
    color: rgba(255, 255, 255, 0.6);
    line-height: 1.8;
    margin-bottom: 20px;
}

/* Legal Modals */
.legal-modal {
    max-width: 700px !important;
    width: 95% !important;
    max-height: 85vh !important;
    padding: 40px !important;
    display: flex;
    flex-direction: column;
}

.legal-scroll-content {
    margin-top: 20px;
    overflow-y: auto;
    padding-right: 15px;
    text-align: left;
    color: rgba(255, 255, 255, 0.8);
    line-height: 1.7;
    font-size: 15px;
}

.legal-scroll-content h2 {
    font-size: 20px;
    margin: 25px 0 15px 0;
    color: var(--accent);
}

.legal-scroll-content h3 {
    font-size: 17px;
    margin: 20px 0 10px 0;
    color: white;
}

.legal-scroll-content p,
.legal-scroll-content li {
    margin-bottom: 12px;
}

.legal-scroll-content ul {
    margin-left: 20px;
    margin-bottom: 15px;
}

/* ==========================================
   ADSENSE LAYOUTS
   ========================================== */
.desktop-ad-layout {
    display: flex;
    justify-content: space-between;
    width: 100%;
    height: 100%;
    overflow: hidden;
}

.ad-sidebar {
    width: 160px;
    min-width: 160px;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    background: transparent;
    padding: 20px 10px;
    z-index: 5;
}

.mobile-ad-banner {
    display: none;
    width: 100%;
    max-width: 800px;
    margin: 0 auto 20px auto;
    text-align: center;
    padding: 0 20px;
}

@media (max-width: 1024px) {
    .ad-sidebar {
        display: none !important;
    }
    .mobile-ad-banner {
        display: block;
    }
}

/* Hide footer, SEO, and ads in Zen mode */
body.zen .app-footer,
body.zen .seo-content-wrapper,
body.zen .ad-sidebar,
body.zen .mobile-ad-banner {
    display: none;
}

@media (max-width: 600px) {
    .footer-content {
        justify-content: center;
        text-align: center;
    }

    .footer-links {
        width: 100%;
        justify-content: center;
    }

    .cookie-content {
        flex-direction: column;
        text-align: center;
    }

    .cookie-btn {
        width: 100%;
    }
}

/* Mobile Slider Adjustments */
@media (max-width: 768px) {
    .unlock-slider-wrapper:not(.minimized) {
        height: 54px;
        max-width: 270px;
        /* Hatta biraz da sol tarafa doğu çekebiliriz */
        transform: translateX(calc(50% - 15px)) translateY(100px);
    }

    body.zen .unlock-slider-wrapper.visible:not(.minimized) {
        transform: translateX(calc(50% - 15px)) translateY(0);
    }

    .unlock-slider-wrapper:not(.minimized) .unlock-slider-handle {
        width: 42px;
        height: 42px;
    }

    .unlock-slider-wrapper:not(.minimized) .unlock-slider-text {
        font-size: 9px;
    }
}