/* =====================================================
   RESPONSIVE
   Breakpoints: 375px (mobile), 768px (tablet), 1440px (desktop)
===================================================== */

/* ─── Mobile base (375px) ────────────────────────── */
/* Default styles live in base.css / components.css   */

.phone-wrapper {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 0;
    background: var(--off-white, #f9fafb);
}

.phone-shell {
    width: 100%;
    max-width: 430px;
    min-height: 100vh;
    position: relative;
    background: var(--warm-white, #FAFAF7);
    overflow: hidden;
}

/* Chat / message containers */
#chat-messages {
    max-height: 55vh;
    overflow-y: auto;
    padding: 12px;
    scroll-behavior: smooth;
}

/* Phase bar compact on mobile */
.phase-bar {
    padding: 8px 12px;
    gap: 6px;
}

.phase-label {
    font-size: 0.7rem;
}

/* Daily question card — full width on mobile */
.daily-question-card {
    margin: 12px;
    padding: 16px;
}

/* Approach chips — wrap on mobile */
.approach-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

/* Toast container — full width minus margin */
#toast-container {
    width: calc(100vw - 32px);
    max-width: 360px;
}

/* ─── Tablet (768px+) ────────────────────────────── */
@media (min-width: 768px) {
    .phone-wrapper {
        padding: 40px;
        background: var(--cream, #F5F0E8);
    }

    .phone-shell {
        border-radius: 24px;
        min-height: unset;
        height: 812px;      /* iPhone-ish portrait height */
        box-shadow: 0 24px 64px rgba(0, 0, 0, 0.18);
    }

    #chat-messages {
        max-height: 60vh;
    }

    .phase-label {
        font-size: 0.75rem;
    }

    .daily-question-card {
        margin: 16px;
        padding: 20px;
    }

    /* Score page: two-column layout on tablet */
    .score-grid {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 16px;
    }
}

/* ─── Desktop (1440px+) ──────────────────────────── */
@media (min-width: 1440px) {
    .phone-wrapper {
        padding: 60px;
    }

    .phone-shell {
        /* Maintain phone shell ratio at desktop */
        width: 390px;
        height: 844px;
        border-radius: 32px;
        box-shadow: 0 32px 80px rgba(0, 0, 0, 0.22);
    }

    /* Optionally show sidebar context at desktop */
    .desktop-sidebar {
        display: flex;
        flex-direction: column;
        gap: 16px;
        width: 280px;
        position: fixed;
        top: 60px;
        left: calc(50% + 220px);
    }
}

/* ─── Very small screens (<375px) ───────────────── */
@media (max-width: 430px) {
    .phone-shell {
        max-width: 100%;
        height: 100svh;   /* small viewport height — avoids address bar overlap */
        max-height: 100svh;
        border-radius: 0;
        box-shadow: none;
    }

    .phone-wrapper {
        padding: 0;
    }

    .phase-bar {
        overflow-x: auto;
        scrollbar-width: none;
    }

    .phase-bar::-webkit-scrollbar { display: none; }
}

/* ─── Accessibility — reduce motion ─────────────── */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}
