/* ==========================================================================
   cook_mode.css – Cook Mode overlay and floating timer
   ========================================================================== */

/* ── COOK MODE OVERLAY ───────────────────────────────────────────────────── */
.cook-mode-overlay {
    position: fixed;
    inset: 0;
    z-index: 3000;
    background: #0f172a;
    color: #f1f5f9;
    display: flex;
    flex-direction: column;
    font-family: 'Inter', Arial, sans-serif;
    /* Mobile: slide up from bottom */
    transform: translateY(0);
}
.cook-mode-overlay[hidden] {
    display: none;
}

/* ── HEADER ──────────────────────────────────────────────────────────────── */
.cook-mode-header {
    padding: 1rem 1.5rem 0.75rem;
    border-bottom: 1px solid rgba(255,255,255,0.08);
    flex-shrink: 0;
}
.cook-mode-progress-bar {
    height: 4px;
    background: rgba(255,255,255,0.12);
    border-radius: 2px;
    margin-bottom: 0.85rem;
    overflow: hidden;
}
.cook-mode-progress-fill {
    height: 100%;
    background: #3b82f6;
    border-radius: 2px;
    transition: width 0.3s ease;
    width: 0%;
}
.cook-mode-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
}
.cook-mode-recipe-name {
    font-size: 0.8rem;
    font-weight: 600;
    color: rgba(241,245,249,0.6);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 55%;
}
.cook-mode-step-counter {
    font-size: 0.85rem;
    font-weight: 700;
    color: #94a3b8;
    white-space: nowrap;
}
.cook-mode-close {
    background: rgba(255,255,255,0.08);
    border: none;
    color: #f1f5f9;
    font-size: 1.1rem;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    margin-left: auto;
    transition: background 0.15s;
}
.cook-mode-close:hover {
    background: rgba(255,255,255,0.16);
}

/* ── BODY: Step text ─────────────────────────────────────────────────────── */
.cook-mode-body {
    flex: 1;
    padding: 2rem 1.5rem;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 1.5rem;
    overflow-y: auto;
}
.cook-mode-step-text {
    font-size: clamp(1.1rem, 4vw, 1.5rem);
    line-height: 1.65;
    color: #f1f5f9;
    font-weight: 400;
}
.cook-mode-timer-btn {
    align-self: flex-start;
    background: #1e40af;
    color: #fff;
    border: none;
    border-radius: 24px;
    padding: 0.6rem 1.25rem;
    font-size: 0.9rem;
    font-weight: 700;
    cursor: pointer;
    font-family: 'Inter', sans-serif;
    transition: background 0.15s;
    display: flex;
    align-items: center;
    gap: 0.4rem;
    min-height: 44px;
}
.cook-mode-timer-btn:hover {
    background: #1d4ed8;
}
.cook-mode-timer-btn[hidden] { display: none; }

/* ── FOOTER: Navigation ──────────────────────────────────────────────────── */
.cook-mode-footer {
    padding: 1rem 1.5rem calc(1rem + env(safe-area-inset-bottom, 0px));
    border-top: 1px solid rgba(255,255,255,0.08);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    flex-shrink: 0;
}
.cook-mode-nav {
    background: rgba(255,255,255,0.08);
    color: #f1f5f9;
    border: 1px solid rgba(255,255,255,0.12);
    border-radius: 12px;
    padding: 0.8rem 1.5rem;
    font-size: 0.95rem;
    font-weight: 700;
    cursor: pointer;
    font-family: 'Inter', sans-serif;
    transition: background 0.15s;
    min-height: 56px;
    min-width: 100px;
}
.cook-mode-nav:hover {
    background: rgba(255,255,255,0.14);
}
.cook-mode-nav:disabled {
    opacity: 0.35;
    cursor: default;
}
.cook-mode-nav--next {
    background: #3b82f6;
    border-color: #3b82f6;
    color: #fff;
    flex: 1;
    max-width: 180px;
}
.cook-mode-nav--next:hover {
    background: #2563eb;
    border-color: #2563eb;
}

/* ── "MADE THIS?" PROMPT ─────────────────────────────────────────────────── */
.cook-mode-made-this {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    flex: 1;
    text-align: center;
}
.cook-mode-made-this[hidden] { display: none; }
.cook-mode-made-this p {
    font-size: 0.85rem;
    color: #94a3b8;
    margin: 0;
    font-weight: 600;
}
.cook-mode-quick-stars {
    display: flex;
    gap: 0.25rem;
}
.cook-mode-quick-stars span {
    font-size: 1.8rem;
    color: #475569;
    cursor: pointer;
    transition: color 0.12s, transform 0.1s;
    line-height: 1;
}
.cook-mode-quick-stars span:hover {
    color: #f59e0b;
    transform: scale(1.15);
}

/* ── DESKTOP: centered modal style ──────────────────────────────────────────*/
@media (min-width: 769px) {
    .cook-mode-overlay {
        /* Centered modal on desktop */
        inset: auto;
        top: 50%;
        left: 50%;
        transform: translate(-50%, -50%);
        width: min(680px, 90vw);
        height: min(560px, 90vh);
        border-radius: 20px;
        box-shadow: 0 24px 64px rgba(0,0,0,0.55);
    }
    .cook-mode-overlay[hidden] {
        display: none;
    }
    /* Backdrop for desktop */
    .cook-mode-overlay:not([hidden])::before {
        content: '';
        position: fixed;
        inset: 0;
        background: rgba(0,0,0,0.65);
        z-index: -1;
        backdrop-filter: blur(4px);
    }
    .cook-mode-step-text {
        font-size: 1.25rem;
    }
}

/* ── FLOATING TIMER PILL ─────────────────────────────────────────────────── */
.step-timer-pill {
    position: fixed;
    bottom: 80px; /* above mobile action bar */
    left: 1rem;
    z-index: 400;
    background: #1e293b;
    color: #f1f5f9;
    border-radius: 28px;
    padding: 0.5rem 0.9rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    box-shadow: 0 4px 16px rgba(0,0,0,0.3);
    font-family: 'Inter', monospace;
    min-width: 90px;
}
.step-timer-pill[hidden] { display: none; }
.step-timer-pill__display {
    font-size: 1.1rem;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    letter-spacing: 0.05em;
    color: #60a5fa;
}
.step-timer-pill__stop {
    background: rgba(255,255,255,0.1);
    border: none;
    color: #94a3b8;
    font-size: 0.8rem;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    line-height: 1;
    transition: background 0.14s;
}
.step-timer-pill__stop:hover {
    background: rgba(255,255,255,0.2);
    color: #f1f5f9;
}
@media (min-width: 769px) {
    .step-timer-pill {
        bottom: 1.5rem;
    }
}

/* ── ACCESSIBILITY ───────────────────────────────────────────────────────── */
.cook-mode-overlay:focus-within .cook-mode-close:focus,
.cook-mode-nav:focus-visible,
.cook-mode-timer-btn:focus-visible,
.cook-mode-quick-stars span:focus-visible {
    outline: 2px solid #60a5fa;
    outline-offset: 2px;
}

/* ── REDUCED MOTION ──────────────────────────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
    .cook-mode-progress-fill,
    .cook-mode-nav,
    .cook-mode-timer-btn,
    .cook-mode-quick-stars span { transition: none; }
}
