/* ─────────────────────────────────────────────
   ZOE ZONES — Clean Wellness
   System fonts only — fully offline-safe.
   Serif: Georgia (universal)
   Sans:  "Nunito" if installed, else rounded
          system stack (looks great on all OS)
   ───────────────────────────────────────────── */

/* Font variables — change here to restyle globally */
:root {
    --font-serif: Georgia, 'Times New Roman', serif;
    --font-sans:  'Nunito', 'Varela Round', ui-rounded,
                  -apple-system, BlinkMacSystemFont,
                  'Segoe UI', system-ui, sans-serif;
}

:root {
    --blue:    #4a8fd4;
    --blue-lt: #e8f2fb;
    --green:   #5ea84a;
    --green-lt:#e8f5e3;
    --yellow:  #d4a017;
    --yellow-lt:#fdf6e3;
    --red:     #d44a3a;
    --red-lt:  #fdecea;

    --bg:      #f6f6f3;
    --white:   #ffffff;
    --border:  #e4e4e0;
    --border-lt: #ededea;

    --ink:     #1a1a18;
    --ink-2:   #484844;
    --ink-3:   #909088;

    --shadow-sm: 0 1px 4px rgba(0,0,0,0.05), 0 2px 10px rgba(0,0,0,0.04);
    --shadow:    0 4px 20px rgba(0,0,0,0.07), 0 1px 4px rgba(0,0,0,0.04);
    --shadow-lg: 0 8px 32px rgba(0,0,0,0.09);

    --radius:    16px;
    --radius-sm: 10px;
    --radius-xs: 6px;
}

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

body {
    font-family: var(--font-sans);
    background: var(--bg);
    color: var(--ink);
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
}

/* ─────────────────── Present Button ─────────────────── */

.present-btn {
    position: fixed;
    top: 16px;
    right: 16px;
    z-index: 100;
    display: flex;
    align-items: center;
    gap: 6px;
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: 20px;
    padding: 7px 13px 7px 10px;
    font-family: var(--font-sans);
    font-size: 0.82rem;
    font-weight: 500;
    color: var(--ink-3);
    cursor: pointer;
    box-shadow: var(--shadow-sm);
    transition: color 0.15s, box-shadow 0.15s, background 0.15s, border-color 0.15s;
    user-select: none;
}
.present-btn:hover { color: var(--ink); box-shadow: var(--shadow); }
.present-btn.active {
    background: var(--ink);
    color: var(--white);
    border-color: var(--ink);
}

/* ─────────────────── Layout ─────────────────── */

.layout {
    display: flex;
    min-height: 100vh;
}

/* ─────────────────── App Panel ─────────────────── */

.app-panel {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 60px 28px 48px;
    transition: padding 0.35s ease;
}

/* ─────────────────── Header ─────────────────── */

.app-header {
    text-align: center;
    margin-bottom: 48px;
}

.wordmark {
    font-family: var(--font-serif);
    font-size: 3rem;
    font-weight: 400;
    letter-spacing: -0.5px;
    color: var(--ink);
    line-height: 1;
    margin-bottom: 10px;
}
.wordmark span { color: var(--green); }

.wordmark-sub {
    font-size: 1rem;
    color: var(--ink-3);
    font-weight: 300;
}

/* ─────────────────── Zone Grid ─────────────────── */

.zone-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    width: 100%;
    max-width: 520px;
}

.zone-btn {
    background: var(--white);
    border: 1.5px solid var(--border);
    border-radius: var(--radius);
    padding: 28px 18px 22px;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    box-shadow: var(--shadow-sm);
    transition: transform 0.2s ease, box-shadow 0.2s ease,
                border-color 0.2s ease, background 0.2s ease;
}

.zone-btn:hover { transform: translateY(-4px); box-shadow: var(--shadow); }
.zone-btn[data-zone="blue"]:hover   { border-color: var(--blue);   background: var(--blue-lt); }
.zone-btn[data-zone="green"]:hover  { border-color: var(--green);  background: var(--green-lt); }
.zone-btn[data-zone="yellow"]:hover { border-color: var(--yellow); background: var(--yellow-lt); }
.zone-btn[data-zone="red"]:hover    { border-color: var(--red);    background: var(--red-lt); }

.zone-dot-wrap {
    width: 52px;
    height: 52px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.zone-dot {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    transition: transform 0.2s ease;
}
.zone-btn:hover .zone-dot { transform: scale(1.08); }

.zone-name {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--ink);
    letter-spacing: -0.1px;
}

.zone-desc {
    font-size: 0.76rem;
    color: var(--ink-3);
    font-weight: 400;
    text-align: center;
    line-height: 1.4;
}

/* ─────────────────── Strategy View ─────────────────── */

.strategy-view {
    width: 100%;
    max-width: 520px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 14px;
    animation: fadeUp 0.28s ease;
}

@keyframes fadeUp {
    from { opacity: 0; transform: translateY(10px); }
    to   { opacity: 1; transform: translateY(0); }
}

.zone-pip {
    width: 40px;
    height: 5px;
    border-radius: 3px;
}

.strategy-eyebrow {
    font-size: 0.85rem;
    color: var(--ink-3);
    font-weight: 300;
    letter-spacing: 0.2px;
}

.strategy-card {
    width: 100%;
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 28px 26px;
    box-shadow: var(--shadow);
}

.strategy-card h2 {
    font-family: var(--font-serif);
    font-size: 1.65rem;
    font-weight: 400;
    letter-spacing: -0.2px;
    color: var(--ink);
    margin-bottom: 8px;
}

.strategy-card p {
    font-size: 0.93rem;
    color: var(--ink-2);
    line-height: 1.7;
    margin-bottom: 16px;
    font-weight: 300;
}

.strategy-step {
    background: var(--bg);
    border-left: 3px solid var(--green);
    border-radius: 0 var(--radius-xs) var(--radius-xs) 0;
    padding: 13px 16px;
    font-size: 0.92rem;
    line-height: 1.65;
    color: var(--ink);
    font-weight: 400;
}

.action-row {
    display: flex;
    gap: 10px;
    width: 100%;
}

/* ─────────────────── Buttons ─────────────────── */

.btn-primary {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    background: var(--green);
    color: white;
    border: none;
    border-radius: var(--radius-sm);
    padding: 13px 20px;
    font-family: var(--font-sans);
    font-size: 0.93rem;
    font-weight: 500;
    cursor: pointer;
    box-shadow: 0 2px 10px rgba(94,168,74,0.28);
    transition: filter 0.15s, transform 0.15s, box-shadow 0.15s;
}
.btn-primary:hover {
    filter: brightness(1.07);
    transform: translateY(-1px);
    box-shadow: 0 4px 16px rgba(94,168,74,0.35);
}

.btn-ghost {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    background: var(--white);
    color: var(--ink-2);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 13px 20px;
    font-family: var(--font-sans);
    font-size: 0.93rem;
    font-weight: 400;
    cursor: pointer;
    transition: background 0.15s, color 0.15s, border-color 0.15s;
}
.btn-ghost:hover { background: var(--bg); color: var(--ink); }

.btn-text {
    background: none;
    border: none;
    color: var(--ink-3);
    font-family: var(--font-sans);
    font-size: 0.86rem;
    font-weight: 400;
    cursor: pointer;
    padding: 6px;
    transition: color 0.15s;
}
.btn-text:hover { color: var(--ink); }

/* ─────────────────── Success View ─────────────────── */

.success-view {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    text-align: center;
    padding: 48px 20px;
    animation: fadeUp 0.3s ease;
}

.success-mark {
    font-size: 3rem;
    color: var(--green);
    animation: popIn 0.4s cubic-bezier(0.34,1.56,0.64,1);
}
@keyframes popIn {
    from { transform: scale(0.3); opacity: 0; }
    to   { transform: scale(1);   opacity: 1; }
}
.success-view h2 {
    font-family: var(--font-serif);
    font-size: 1.9rem;
    font-weight: 400;
    color: var(--ink);
}
.success-view p {
    font-size: 0.95rem;
    color: var(--ink-3);
    font-weight: 300;
    line-height: 1.6;
}

/* ─────────────────── Brain Panel ─────────────────── */

.brain-panel {
    width: 0;
    min-width: 0;
    overflow: hidden;
    opacity: 0;
    background: var(--white);
    border-left: 1px solid var(--border);
    transition: width 0.38s cubic-bezier(0.4,0,0.2,1),
                min-width 0.38s cubic-bezier(0.4,0,0.2,1),
                opacity 0.28s ease;
    display: flex;
    flex-direction: column;
}

.layout.present-mode .brain-panel {
    width: 360px;
    min-width: 360px;
    opacity: 1;
    overflow-y: auto;
}

.brain-inner {
    padding: 32px 24px 28px;
    display: flex;
    flex-direction: column;
    gap: 16px;
    min-width: 360px; /* prevents content reflow during animation */
}

.brain-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.brain-heading {
    font-size: 0.92rem;
    font-weight: 600;
    color: var(--ink);
    display: flex;
    align-items: center;
    gap: 8px;
}

.brain-count {
    font-size: 0.8rem;
    color: var(--ink-3);
    font-weight: 400;
}

.brain-desc {
    font-size: 0.82rem;
    color: var(--ink-3);
    line-height: 1.65;
    padding: 12px 14px;
    background: var(--bg);
    border-radius: var(--radius-sm);
    font-weight: 300;
}
.brain-desc strong { color: var(--ink-2); font-weight: 500; }

/* Zone blocks */
.brain-zones {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.brain-zone-block {
    border: 1px solid var(--border-lt);
    border-radius: var(--radius-sm);
    padding: 13px 14px;
    background: var(--white);
}

.brain-zone-head {
    display: flex;
    align-items: center;
    gap: 7px;
    margin-bottom: 10px;
}

.brain-zone-pip {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
}

.brain-zone-label {
    font-size: 0.74rem;
    font-weight: 600;
    color: var(--ink-2);
    text-transform: uppercase;
    letter-spacing: 0.8px;
}

/* Strategy rows */
.brain-row {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 6px;
}
.brain-row:last-child { margin-bottom: 0; }

.brain-s-name {
    font-size: 0.76rem;
    color: var(--ink-2);
    font-weight: 500;
    width: 130px;
    flex-shrink: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.brain-bar-track {
    flex: 1;
    height: 7px;
    background: var(--bg);
    border-radius: 4px;
    overflow: hidden;
}

.brain-bar-fill {
    height: 100%;
    border-radius: 4px;
    min-width: 3px;
    transition: width 0.55s cubic-bezier(0.4,0,0.2,1);
}

.brain-weight {
    font-size: 0.7rem;
    color: var(--ink-3);
    font-weight: 500;
    width: 26px;
    text-align: right;
    flex-shrink: 0;
}

/* Log line */
.brain-log {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 11px 13px;
    background: var(--bg);
    border-radius: var(--radius-sm);
    font-size: 0.8rem;
    color: var(--ink-3);
    font-weight: 400;
    min-height: 42px;
}

/* Live dot */
.live-dot {
    display: inline-block;
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--green);
    flex-shrink: 0;
    animation: livePulse 2.2s ease-in-out infinite;
}
@keyframes livePulse {
    0%,100% { opacity:1; transform:scale(1); }
    50%      { opacity:0.4; transform:scale(0.75); }
}

/* ─────────────────── Utility ─────────────────── */

.hidden { display: none !important; }

/* ─────────────────── Responsive ─────────────────── */

@media (max-width: 640px) {
    .app-panel { padding: 40px 18px 36px; }
    .wordmark { font-size: 2.4rem; }
    .present-btn { display: none; }
    .layout.present-mode .brain-panel { display: none; }
}

/* ─────────────────── Student Grid ─────────────────── */

.screen { width: 100%; max-width: 520px; display: flex; flex-direction: column; align-items: center; gap: 16px; }
.screen.hidden { display: none !important; }

.screen-prompt {
    font-size: 1.1rem;
    color: var(--ink-3);
    font-weight: 300;
    letter-spacing: 0.1px;
    align-self: flex-start;
    margin-bottom: 4px;
}

.student-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 8px;
    width: 100%;
}

.student-btn {
    aspect-ratio: 1;
    background: var(--white);
    border: 1.5px solid var(--border);
    border-radius: var(--radius-sm);
    font-family: var(--font-sans);
    font-size: 1rem;
    font-weight: 600;
    color: var(--ink-2);
    cursor: pointer;
    transition: background 0.15s, border-color 0.15s, color 0.15s, transform 0.15s;
    box-shadow: var(--shadow-sm);
}
.student-btn:hover {
    background: var(--green-lt);
    border-color: var(--green);
    color: var(--green);
    transform: scale(1.08);
}
.student-btn.active {
    background: var(--green);
    border-color: var(--green);
    color: white;
}

/* Back button + student chip */
.screen-top-row {
    display: flex;
    align-items: center;
    gap: 10px;
    align-self: flex-start;
}

.btn-back {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--white);
    border: 1px solid var(--border);
    cursor: pointer;
    color: var(--ink-3);
    transition: color 0.15s, border-color 0.15s;
}
.btn-back:hover { color: var(--ink); border-color: var(--ink-3); }

.student-chip {
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--ink-3);
    background: var(--bg);
    border-radius: 20px;
    padding: 4px 12px;
    border: 1px solid var(--border);
}

/* ─────────────────── Brain Panel Additions ─────────────────── */

.brain-toggle {
    display: flex;
    gap: 6px;
    align-items: center;
    background: var(--bg);
    border-radius: var(--radius-sm);
    padding: 4px;
}

.brain-toggle-btn {
    flex: 1;
    background: transparent;
    border: none;
    border-radius: var(--radius-xs);
    padding: 6px 10px;
    font-family: var(--font-sans);
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--ink-3);
    cursor: pointer;
    transition: background 0.15s, color 0.15s;
}
.brain-toggle-btn.active {
    background: var(--white);
    color: var(--ink);
    box-shadow: var(--shadow-sm);
}

.brain-student-select {
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: var(--radius-xs);
    padding: 5px 8px;
    font-family: var(--font-sans);
    font-size: 0.8rem;
    color: var(--ink);
    cursor: pointer;
}
