.timer-card {
    background: rgba(15, 23, 42, 0.9);
    /* Slightly more opaque for readability */
    border-radius: 18px;
    padding: 24px;
    margin: 30px auto 10px;
    /* Centered with top margin to separate from buttons */
    color: #e5e7eb;
    width: 100%;
    /* Slightly wider for better mobile tap targets */
    max-width: 350px;
    /* Prevents it from getting too huge on tablets */
    box-sizing: border-box;
    /* Ensures padding doesn't break width */
    backdrop-filter: blur(16px);
}

.timer-card.completed {
    box-shadow:
        0 0 0 1px rgba(34, 197, 94, 0.7),
        0 0 32px rgba(34, 197, 94, 0.7);
    transform: translateY(-1px);
}

.timer-title {
    font-size: 1.1rem;
    font-weight: 600;
    margin: 0 0 4px;
    transition: color 0.2s ease;
}

.timer-card.completed .timer-title {
    color: #4ade80;
}

.timer-subtitle {
    margin: 0 0 16px;
    font-size: 0.85rem;
    color: #9ca3af;
}

.timer-controls {
    gap: 12px;
    align-items: center;
    justify-content: center;
    /* Ensures content stays centered */
}

#secondsInput {
    flex: 0 0 110px;
    max-width: 110px;
    padding: 10px 12px;
    border-radius: 999px;
    border: 1px solid rgba(148, 163, 184, 0.6);
    background: rgba(15, 23, 42, 0.9);
    color: #e5e7eb;
    font-size: 1.3rem;
    outline: none;
    transition: border-color 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
}

#secondsInput::placeholder {
    color: #6b7280;
}

#secondsInput:focus {
    border-color: #38bdf8;
    box-shadow: 0 0 0 1px rgba(56, 189, 248, 0.5);
    background: rgba(15, 23, 42, 1);
}

#timerButton {
    flex: 1 1 auto;
    position: relative;
    padding: 10px 18px;
    border-radius: 999px;
    border: none;
    cursor: pointer;
    font-size: 1.3rem;
    font-weight: 600;
    color: #0b1120;
    background: linear-gradient(135deg, #38bdf8, #22c55e);
    box-shadow:
        0 10px 20px rgba(15, 118, 110, 0.4),
        0 0 0 1px rgba(15, 23, 42, 0.8);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    white-space: nowrap;
    transition:
        transform 0.1s ease-out,
        box-shadow 0.15s ease-out,
        filter 0.15s ease-out,
        background-position 0.2s ease-out;
    background-size: 150% 150%;
    background-position: 0% 50%;
}

#timerButton:hover:not(:disabled) {
    transform: translateY(-1px);
    box-shadow:
        0 14px 30px rgba(15, 118, 110, 0.55),
        0 0 0 1px rgba(15, 23, 42, 0.9);
    filter: brightness(1.03);
    background-position: 100% 50%;
}

#timerButton:active:not(:disabled) {
    transform: translateY(1px);
    box-shadow:
        0 6px 14px rgba(15, 118, 110, 0.4),
        0 0 0 1px rgba(15, 23, 42, 0.9);
    filter: brightness(0.97);
}

#timerButton:disabled {
    cursor: default;
    opacity: 0.8;
    filter: grayscale(0.1) brightness(0.9);
    box-shadow:
        0 8px 18px rgba(15, 23, 42, 0.6),
        0 0 0 1px rgba(15, 23, 42, 0.9);
}

.timer-button-inner {
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.timer-time {
    font-variant-numeric: tabular-nums;
}

.timer-separator {
    opacity: 0.8;
}

.timer-link,
.timer-reset {
    font-size: 0.9rem;
    font-weight: 600;
    opacity: 0.9;
    cursor: pointer;
}

.timer-link:hover,
.timer-reset:hover {
    opacity: 1;
}


/* Fix for mobile: if the screen is too narrow, stack the timer controls */
@media (max-width: 380px) {
    .timer-controls {
        flex-direction: column;
        align-items: stretch;
        width: 100%;
        gap: 15px;
    }

    #secondsInput,
    #timerButton {
        width: 100% !important;
        max-width: none;
        flex: none;
        margin: 0;
    }
}
