/* ========== FONTS ========== */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&family=Playfair+Display:wght@700;800&display=swap');


/* ========== GENERAL STYLES ========== */

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

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    background-color: #0f0f0f;
    color: #e8e8e8;
    padding: 20px;
    max-width: 800px;
    margin: 0 auto;
}

h1 {
    font-family: 'Playfair Display', Georgia, serif;
    text-align: center;
    font-size: 2.2em;
    font-weight: 800;
    letter-spacing: -0.01em;
    margin-bottom: 10px;
}

h2 {
    font-family: 'Playfair Display', Georgia, serif;
    text-align: center;
    font-size: 1.3em;
    font-weight: 700;
    color: #aaa;
    margin-bottom: 20px;
}


/* ========== USER BAR (logged-in state) ========== */

.user-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background-color: #181818;
    border: 1px solid #2a2a2a;
    border-radius: 10px;
    padding: 8px 16px;
    margin-bottom: 20px;
    font-size: 0.9em;
    color: #888;
}

.btn-logout {
    background-color: transparent;
    color: #666;
    font-size: 0.85em;
    padding: 6px 12px;
}

.btn-logout:hover {
    color: #c8102e;
}


/* ========== LOGIN PAGE ========== */

.login-page {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 80vh;
}

.login-form {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
}


/* ========== DASHBOARD APP GRID ========== */

.app-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 16px;
    margin-top: 16px;
}

.app-tile {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    background-color: #181818;
    border: 1px solid #2a2a2a;
    border-radius: 16px;
    padding: 28px 20px;
    text-decoration: none;
    color: inherit;
    transition: border-color 0.2s, background-color 0.2s;
}

.app-tile:hover {
    border-color: #c8102e;
    background-color: #1f0a0c;
}

.app-tile-icon {
    font-size: 2.5em;
}

.app-tile-name {
    font-weight: 700;
    font-size: 1em;
}

.app-tile-desc {
    font-size: 0.8em;
    color: #777;
    text-align: center;
}


/* ========== REQUEST ACCESS FORM ========== */

.request-divider {
    margin-top: 12px;
}

.btn-request-toggle {
    background: none;
    border: none;
    color: #666;
    font-family: 'Inter', sans-serif;
    font-size: 0.85em;
    cursor: pointer;
    text-decoration: underline;
    text-underline-offset: 3px;
    padding: 0;
}

.btn-request-toggle:hover {
    color: #aaa;
}

.request-form {
    display: flex;
    flex-direction: column;
    gap: 10px;
    width: 280px;
    margin-top: 4px;
}

.request-input,
.request-note {
    padding: 10px 12px;
    border: 1px solid #333;
    border-radius: 8px;
    background-color: #1a1a1a;
    color: #e8e8e8;
    font-family: 'Inter', sans-serif;
    font-size: 0.95em;
    resize: none;
}

.request-input::placeholder,
.request-note::placeholder {
    color: #555;
}

.btn-request-submit {
    background-color: #c8102e;
    color: white;
    font-size: 0.95em;
    padding: 10px;
}

.request-status {
    font-size: 0.85em;
    text-align: center;
    min-height: 1.2em;
    color: #888;
}

.request-status.success {
    color: #2ecc71;
}

.request-status.error {
    color: #c8102e;
}


/* ========== AUTH SECTION (login/signup) ========== */

.auth-form {
    max-width: 360px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.btn-google {
    background-color: #db4437;
    color: white;
    font-size: 1em;
    padding: 12px;
    width: 100%;
}

.auth-error {
    color: #c8102e;
    font-size: 0.85em;
    text-align: center;
    min-height: 1.2em;
}


/* ========== BUTTONS ========== */

.btn {
    border: none;
    padding: 10px 20px;
    border-radius: 8px;
    cursor: pointer;
    font-family: 'Inter', sans-serif;
    font-size: 1em;
    font-weight: 600;
    transition: opacity 0.2s;
}

.btn:hover {
    opacity: 0.85;
}

.btn-add {
    background-color: #c8102e;
    color: white;
}

.btn-start {
    background-color: #2ecc71;
    color: white;
    font-size: 1.2em;
    padding: 12px 30px;
}

.btn-stop {
    background-color: #c8102e;
    color: white;
    font-size: 1.1em;
}

.btn-pause {
    background-color: #c8102e;
    color: white;
    font-size: 1.1em;
}

.timer-buttons {
    display: flex;
    justify-content: center;
    gap: 12px;
    margin-top: 30px;
}

/* ---- Pause overlay ---- */
#pause-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.82);
    z-index: 1000;
    align-items: center;
    justify-content: center;
}

.pause-modal {
    background: #1c1c1c;
    border: 2px solid #e8a838;
    border-radius: 16px;
    padding: 40px 52px;
    text-align: center;
    box-shadow: 0 0 40px rgba(232, 168, 56, 0.25);
    min-width: 280px;
}

.pause-modal-title {
    font-size: 1.5em;
    font-weight: 700;
    color: #e8a838;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    margin-bottom: 20px;
}

.pause-stopwatch {
    font-size: 4em;
    font-weight: 800;
    color: #fff;
    font-variant-numeric: tabular-nums;
    letter-spacing: 0.02em;
    line-height: 1;
}

.pause-modal-label {
    font-size: 0.85em;
    color: #888;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    margin-top: 6px;
}

.btn-remove {
    background-color: #2a2a2a;
    color: #bbb;
    font-size: 0.85em;
    padding: 6px 12px;
}

.btn-save {
    background-color: #2d6a4f;
    color: #ccc;
    font-size: 0.85em;
    padding: 6px 12px;
}

.btn-load {
    background-color: #c8102e;
    color: white;
    font-size: 0.85em;
    padding: 6px 14px;
}

.btn-delete {
    background-color: transparent;
    color: #666;
    font-size: 0.85em;
    padding: 6px 10px;
}

.btn-delete:hover {
    color: #c8102e;
}

.btn-add-step {
    background-color: transparent;
    color: #c8102e;
    border: 1px dashed #c8102e;
    font-size: 0.9em;
    margin-top: 8px;
}

.btn-remove-step {
    background-color: transparent;
    color: #666;
    font-size: 1em;
    padding: 5px 8px;
    border-radius: 4px;
}

.btn-remove-step:hover {
    color: #c8102e;
}

.button-row {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin-top: 20px;
}


/* ========== TIMING MODE TOGGLE ========== */

.mode-toggle {
    text-align: center;
    margin-bottom: 24px;
    padding: 20px;
    background-color: #181818;
    border-radius: 12px;
    border: 1px solid #2a2a2a;
}

.mode-label {
    font-weight: 600;
    font-size: 1em;
    margin-right: 10px;
}

.toggle-buttons {
    display: inline-flex;
    gap: 0;
    margin-top: 10px;
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid #2a2a2a;
}

.btn-mode {
    border-radius: 0;
    padding: 10px 20px;
    background-color: #222;
    color: #777;
    font-size: 0.95em;
    border: none;
}

.btn-mode.active {
    background-color: #c8102e;
    color: white;
}

.mode-description {
    margin-top: 10px;
    font-size: 0.85em;
    color: #888;
}

/* "Done By" time picker row */
.done-by-picker {
    margin-top: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.done-by-picker label {
    font-size: 0.95em;
    color: #ccc;
}

.done-by-time-input {
    padding: 8px 12px;
    border: 1px solid #333;
    border-radius: 8px;
    background-color: #222;
    color: white;
    font-size: 1.1em;
    font-family: 'Inter', sans-serif;
}

/* Target time info shown in timer view */
.done-by-info {
    text-align: center;
    font-size: 1.05em;
    color: #c8102e;
    margin-bottom: 16px;
    font-weight: 600;
}


/* ========== DISH CARDS (Setup) ========== */

.dish-card {
    background-color: #181818;
    border: 1px solid #2a2a2a;
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 16px;
}

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

.dish-header-buttons {
    display: flex;
    gap: 6px;
}

.dish-name {
    font-size: 1.1em;
    padding: 8px 12px;
    border: 1px solid #333;
    border-radius: 8px;
    background-color: #222;
    color: white;
    width: 70%;
    font-family: 'Inter', sans-serif;
}

.dish-name::placeholder {
    color: #555;
}


/* ========== STEP ROWS (Setup) ========== */

.step-row {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 6px;
}

.step-action {
    flex: 1;
    padding: 8px 10px;
    border: 1px solid #333;
    border-radius: 8px;
    background-color: #222;
    color: white;
    font-size: 0.95em;
    font-family: 'Inter', sans-serif;
}

.step-action::placeholder {
    color: #555;
}

.step-minutes {
    width: 65px;
    padding: 8px 10px;
    border: 1px solid #333;
    border-radius: 8px;
    background-color: #222;
    color: white;
    font-size: 0.95em;
    text-align: center;
    font-family: 'Inter', sans-serif;
}

.step-label {
    color: #777;
    font-size: 0.9em;
}


/* ========== SAVED DISHES PANEL ========== */

#saved-section {
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px solid #2a2a2a;
}

#saved-section h3 {
    text-align: center;
    font-size: 1.1em;
    color: #999;
    margin-bottom: 14px;
}

.saved-empty {
    text-align: center;
    color: #555;
    font-size: 0.9em;
    padding: 10px;
}

/* ========== SOUND SETTINGS ========== */

.sound-settings {
    background-color: #181818;
    border: 1px solid #2a2a2a;
    border-radius: 10px;
    padding: 14px 18px;
    margin-bottom: 20px;
}

.sound-settings h3 {
    margin: 0 0 12px 0;
    font-size: 0.95em;
    color: #aaa;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.sound-row {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
}

.sound-row:last-child {
    margin-bottom: 0;
}

.sound-label {
    min-width: 130px;
    font-size: 0.9em;
    color: #bbb;
}

.sound-select {
    flex: 1;
    background-color: #222;
    color: #eee;
    border: 1px solid #444;
    border-radius: 6px;
    padding: 6px 8px;
    font-size: 0.9em;
    cursor: pointer;
}

.sound-select:focus {
    outline: none;
    border-color: #e8a838;
}

.btn-test {
    background-color: #2a2a2a;
    color: #e8a838;
    border: 1px solid #444;
    white-space: nowrap;
    font-size: 0.85em;
    padding: 6px 10px;
}

.btn-test:hover {
    background-color: #333;
    border-color: #e8a838;
}

.saved-dish-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background-color: #181818;
    border: 1px solid #2a2a2a;
    border-radius: 10px;
    padding: 10px 14px;
    margin-bottom: 8px;
}

.saved-dish-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.saved-dish-name {
    font-weight: 600;
    font-size: 1em;
}

.saved-dish-summary {
    font-size: 0.8em;
    color: #777;
}

.saved-dish-buttons {
    display: flex;
    gap: 6px;
}

/* Inline edit form — replaces the normal saved dish row content */
.saved-dish-edit {
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.saved-edit-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
}

.saved-edit-header .dish-name {
    flex: 1;
}

.saved-edit-buttons {
    display: flex;
    gap: 6px;
    flex-shrink: 0;
}


/* ========== TIMER CARDS (Cooking View) ========== */

.timer-card {
    border-radius: 12px;
    padding: 24px;
    margin-bottom: 14px;
    text-align: center;
    transition: background-color 0.3s, transform 0.2s;
}

.timer-dish {
    font-size: 0.75em;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    color: #666;
    margin-bottom: 4px;
}

.timer-action {
    font-size: 1.1em;
    margin-bottom: 8px;
}

.timer-countdown {
    font-family: 'Playfair Display', Georgia, serif;
    font-size: 3.5em;
    font-weight: 800;
    font-variant-numeric: tabular-nums;
}

/* Step progress indicator (e.g., "Step 2 of 4") */
.timer-progress {
    font-size: 0.85em;
    color: #888;
    margin-top: 4px;
}

/* Color states for timer cards */

/* Waiting — muted purple, dish hasn't started yet (finish-together mode) */
.timer-card.waiting {
    background-color: #13101e;
    border: 1px dashed #7b6faa;
}
.timer-card.waiting .timer-countdown {
    color: #7b6faa;
}
.timer-card.waiting .timer-action {
    font-style: italic;
    color: #999;
}

/* Upcoming — red border, white countdown, calm */
.timer-card.upcoming {
    background-color: #181818;
    border: 1px solid #c8102e;
}
.timer-card.upcoming .timer-countdown {
    color: #ffffff;
}

/* Imminent — brighter red bg tint, almost time! */
.timer-card.imminent {
    background-color: #220810;
    border: 1px solid #e8193a;
}
.timer-card.imminent .timer-countdown {
    color: #e8193a;
}

/* "Done" button shown on a fired card — tap to start the next step */
.btn-done-step {
    background-color: #2ecc71;
    color: white;
    font-size: 1em;
    padding: 10px 32px;
    margin-top: 14px;
}

.card-btns {
    display: flex;
    gap: 10px;
    justify-content: center;
    margin-top: 14px;
}

.btn-dish-pause {
    background-color: #555;
    color: white;
    font-size: 0.85em;
    padding: 7px 18px;
}

.btn-skip-step {
    background-color: #7a5c00;
    color: white;
    font-size: 0.85em;
    padding: 7px 18px;
}

/* Fired — bright red, action needed NOW */
.timer-card.fired {
    background-color: #2a0810;
    border: 2px solid #c8102e;
    transform: scale(1.03);
}
.timer-card.fired .timer-countdown {
    color: #c8102e;
    animation: pulse 0.5s infinite alternate;
}

/* Done — green, completed */
.timer-card.done {
    background-color: #0a1f0f;
    border: 1px solid #27ae60;
    opacity: 0.6;
}
.timer-card.done .timer-countdown {
    color: #27ae60;
}

/* Paused — dimmed with dashed border, signals "frozen" */
.timer-card.paused {
    opacity: 0.5;
    border-style: dashed;
}

/* Pulse animation for the "NOW!" text */
@keyframes pulse {
    from { opacity: 1; }
    to { opacity: 0.35; }
}


/* ========== RESPONSIVE (phones/small screens) ========== */

@media (max-width: 600px) {
    body {
        padding: 10px;
    }

    .step-row {
        flex-wrap: wrap;
    }

    .step-action {
        width: 100%;
    }

    .timer-countdown {
        font-size: 2.5em;
    }
}
