:root {
    --bg-color: #0a0a0a;
    --text-color: #ffffff;
    --accent-color: #ffffff;
    --ring-color: #ffffff;
    --panel-bg: #111111;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--bg-color);
    color: var(--text-color);
    height: 100vh;
    overflow: hidden;
}

.app-container {
    display: flex;
    height: 100%;
    position: relative;
    /* Ensure relative context if not already */
}

.brand-logo {
    position: absolute;
    top: 2rem;
    left: 2rem;
    display: flex;
    align-items: center;
    text-decoration: none;
    z-index: 100;
    transition: opacity 0.3s;
}

.brand-logo:hover {
    opacity: 1;
}

.brand-logo img {
    width: 32px;
    height: 32px;
}

.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    position: relative;
}

/* Mode Selection Buttons */
.mode-selection {
    display: flex;
    justify-content: center;
    gap: 1rem;
    margin-bottom: 0.5rem;
}

.mode-btn {
    background: none;
    border: none;
    border-bottom: 1px solid transparent;
    /* Reserve space for border */
    color: var(--text-color);
    font-family: 'Inter', sans-serif;
    font-size: 0.9rem;
    cursor: pointer;
    opacity: 0.4;
    /* Discrete by default */
    padding: 5px 10px;
    transition: all 0.3s ease;
    border-radius: 0;
    /* Align with underline style */
}

.mode-btn:hover {
    opacity: 0.8;
    background-color: rgba(255, 255, 255, 0.05);
}

.mode-btn.active {
    opacity: 1;
    font-weight: 500;
    /* Keep weight consistent or slightly bolder if it doesn't shift too much. Let's try sticking to 500 (medium) for all or just slight. */
    border-bottom: 1px solid rgba(255, 255, 255, 0.5);
}

/* Restart Button - Discrete */
.restart-container {
    margin-top: 1rem;
    text-align: center;
}

.restart-btn {
    background: none;
    border: none;
    color: var(--text-color);
    font-family: 'Inter', sans-serif;
    font-size: 0.9rem;
    opacity: 0.3;
    /* Very discrete */
    cursor: pointer;
    transition: opacity 0.3s ease;
    padding: 5px 10px;
}

.restart-btn:hover {
    opacity: 0.8;
}

/* Timer Circle */
.timer-container {
    position: relative;
    width: 300px;
    height: 300px;
    display: flex;
    justify-content: center;
    align-items: center;
}

.progress-ring {
    transform: rotate(-90deg);
}

.progress-ring__circle {
    transition: stroke-dashoffset 0.35s;
    transform-origin: 50% 50%;
}

.ticks {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
}

.tick {
    position: absolute;
    width: 2px;
    height: 10px;
    background-color: rgba(255, 255, 255, 0.2);
    left: 50%;
    top: 50%;
    transform-origin: center;
}

.timer-center {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 10;
}

.progress-ring {
    transform: rotate(-90deg);
    pointer-events: none;
}

.play-btn {
    background: none;
    border: none;
    color: white;
    cursor: pointer;
    padding: 20px;
    border-radius: 50%;
    transition: transform 0.2s;
}

.play-btn:hover {
    transform: scale(1.1);
}

.hidden {
    display: none;
}

/* Session Info */
.session-info {
    margin-top: 4rem;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
}

.time-control {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
}

.time-display {
    font-size: 2rem;
    font-weight: 300;
    line-height: 1;
    font-variant-numeric: tabular-nums;
    user-select: none;
}

.time-arrow {
    background: none;
    border: none;
    color: var(--secondary-text);
    /* Uses existing or fallback */
    color: #666;
    /* Fallback */
    cursor: pointer;
    padding: 2px;
    opacity: 0;
    transition: opacity 0.2s, color 0.2s;
}

.time-control:hover .time-arrow {
    opacity: 1;
}

.time-arrow:hover {
    color: white;
}

.mode-pill {
    background-color: #222;
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 30px;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: background-color 0.2s;
}

.mode-pill:hover {
    background-color: #333;
}

/* Timeline (Decorative) */
.timeline {
    position: absolute;
    bottom: 40px;
    width: 80%;
    height: 40px;
    opacity: 0.3;
    display: flex;
    justify-content: center;
    align-items: center;
}

/* Side Panel */
.side-panel {
    width: 300px;
    background-color: var(--panel-bg);
    border-left: 1px solid #222;
    padding: 2rem;
    display: flex;
    flex-direction: column;
    /* Consistent large gap between the 3 main cards */
    gap: 1.5rem;
    height: 100%;
}

/* Carousel */
.music-carousel {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
}

.station-card {
    background-color: #1a1a1a;
    padding: 1.5rem;
    border-radius: 12px;
    text-align: center;
    width: 100%;
}

.station-card h3 {
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    margin-bottom: 1rem;
    color: #888;
}

.nav-arrow-vertical {
    background: none;
    border: none;
    color: #666;
    cursor: pointer;
    padding: 5px;
    transition: color 0.2s, transform 0.2s;
}

.nav-arrow-vertical:hover {
    color: white;
    transform: scale(1.1);
}



/* Reusing existing hidden class */

/* Update specific player styles */
#youtube-player,
#sc-widget {
    /* Keep existing hidden logic, but we might want them partially loaded?
       Actually user wants "hidden audio". 
       So we don't change the fact they are invisible. */
    width: 1px;
    height: 1px;
    opacity: 0;
    position: absolute;
    left: -9999px;
    pointer-events: none;
}

.player-controls {
    display: flex;
    align-items: center;
    gap: 1rem;
    justify-content: center;
    margin-bottom: 0.5rem;
}

.player-btn {
    background: white;
    color: black;
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

input[type="range"] {
    width: 80px;
    accent-color: white;
}

.track-info {
    font-size: 0.8rem;
    color: #666;
    margin-top: 0.5rem;
}

/* Clock Container - Remove dedicated margin-top */
.clock-container {
    background-color: #1a1a1a;
    padding: 1.5rem;
    border-radius: 12px;
    text-align: center;
    margin-top: 0;
    /* Let flex gap handle it */
}

/* Stats */
.stats-container {
    text-align: center;
    margin-top: 0;
    /* Let flex gap handle it */
    font-size: 0.8rem;
    color: var(--text-color);
    font-family: 'Inter', sans-serif;
    opacity: 0.3;
    letter-spacing: normal;
}

/* Install App Link - Bottom Left */
.install-container {
    margin-top: 0;
    /* Let flex gap handle it */
    text-align: center;
    margin-bottom: 0;
}

.install-link {
    color: var(--text-color);
    font-family: 'Inter', sans-serif;
    font-size: 0.8rem;
    opacity: 0.3;
    text-decoration: none;
    transition: opacity 0.3s ease;
}

.install-link:hover {
    opacity: 0.8;
}

/* Mobile Responsiveness */
@media (max-width: 768px) {
    body {
        overflow-y: auto;
        /* Allow scrolling */
    }

    .app-container {
        flex-direction: column;
        height: auto;
        min-height: 100vh;
    }

    .brand-logo {
        position: absolute;
        top: 1rem;
        left: 1rem;
    }

    .main-content {
        min-height: 60vh;
        /* Ensure timer has space */
        padding-top: 4rem;
        /* Space for logo */
        justify-content: flex-start;
    }

    /* Adjust Timer scale for very small screens */
    .timer-container {
        transform: scale(0.85);
        margin-bottom: 0;
    }

    .session-info {
        margin-top: 1rem;
    }

    .timeline {
        display: none;
        /* Hide decorative timeline on mobile to save space */
    }

    .side-panel {
        width: 100%;
        height: auto;
        border-left: none;
        border-top: 1px solid #222;
        padding: 2rem 1rem;
        display: flex;
        flex-direction: column;
        align-items: center;
        /* Force centering of all children */
    }

    .music-carousel,
    .todo-container,
    .clock-container {
        width: 100%;
        max-width: 400px;
        margin: 0 auto;
    }

    .todo-container {
        margin: 1rem auto;
        /* Adjust margin for stack and CENTER IT */
    }

    .clock-container {
        margin: 2rem auto;
    }

    .install-container {
        margin-bottom: 2rem;
    }
}

/* To-Do List */
.todo-container {
    width: 100%;
    /* Flex-grow to fill the middle space */
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;

    /* Remove manual margins, rely on side-panel gap */
    margin: 0;
    /*
       Compensate for the visual height of the music navigation arrow above.
       Negative margin pulls this card up so the Visual Gap (Card to Card) looks equal
       to the bottom gap.
    */
    margin-top: -1rem;

    /* Card Style Matching .station-card and .clock-container */
    background-color: #1a1a1a;
    padding: 1.5rem;
    border-radius: 12px;
    text-align: center;
    overflow: hidden;
}

.todo-container h3 {
    font-size: 0.8rem;
    /* Match station-card h3 */
    font-weight: 600;
    letter-spacing: 2px;
    opacity: 0.5;
    margin: 0;
    text-align: center;
    margin-bottom: 1rem;
    text-transform: uppercase;
}

.todo-input-wrapper {
    display: flex;
    align-items: center;
    padding-bottom: 0.5rem;
    margin: 0;
    /* Remove side margins as we have padding now */
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

#todo-input {
    background: transparent;
    /* TRANSPARENT */
    border: none;
    color: white;
    /* White text */
    font-family: "Inter", sans-serif;
    font-size: 0.85rem;
    width: 100%;
    outline: none;
    padding: 2px 0;
    text-align: left !important;
    /* FORCE LEFT ALIGNMENT */
    display: block;
    /* Ensure block behavior */
}

#todo-input::placeholder {
    color: rgba(255, 255, 255, 0.2);
    /* Very faint placeholder */
    font-size: 0.8rem;
    font-style: normal;
    /* Remove italics for cleaner look */
}

/* ... keep other styles ... */

.todo-list {
    list-style: none;
    padding: 0;
    /* Remove extra padding as container has it */
    margin: 0;
    overflow-y: auto;
    text-align: left;
    /* List items usually look better left-aligned even in centered card */
}

.todo-list::-webkit-scrollbar {
    width: 4px;
}

.todo-list::-webkit-scrollbar-track {
    background: transparent;
}

.todo-list::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 2px;
}

.todo-item {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    padding: 0.3rem 0;
    animation: fadeIn 0.3s ease;
}

.todo-item.completed span {
    text-decoration: line-through;
    opacity: 0.3;
}

.todo-checkbox {
    appearance: none;
    width: 14px;
    height: 14px;
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 4px;
    cursor: pointer;
    position: relative;
    transition: all 0.2s;
    flex-shrink: 0;
    background: transparent;
}

.todo-checkbox:checked {
    background-color: rgba(255, 255, 255, 0.2);
    border-color: transparent;
}

.todo-checkbox:checked::after {
    content: "✓";
    position: absolute;
    color: white;
    font-size: 9px;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

.todo-text {
    font-size: 0.85rem;
    word-break: break-word;
    flex-grow: 1;
    color: rgba(255, 255, 255, 0.8);
}

.delete-task-btn {
    background: none;
    border: none;
    color: white;
    opacity: 0;
    cursor: pointer;
    font-size: 1rem;
    transition: opacity 0.2s;
    padding: 0 5px;
}

.todo-item:hover .delete-task-btn {
    opacity: 0.5;
}

.todo-item:hover .delete-task-btn:hover {
    opacity: 1;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(5px);
    }

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

/* Stats - Matching Install Link Style */
.stats-container {
    text-align: center;
    margin-top: 1rem;
    color: var(--text-color);
    font-family: "Inter", sans-serif;
    font-size: 0.8rem;
    /* Exact match to install-link */
    opacity: 0.3;
    /* Exact match to install-link opacity */
    letter-spacing: normal;
}