/* Daily Check-in Page Styles */

/* Hide bottom nav on desktop */
@media (min-width: 768px) {
    nav.bottom-nav, .bottom-nav { display: none !important; visibility: hidden !important; opacity: 0 !important; }
}

:root {
    --primary-grad: linear-gradient(135deg, #0f766e 0%, #115e59 100%);
    --btn-grad: linear-gradient(90deg, #0f766e 0%, #115e59 100%);
    --bg-light: #f8fafc;
    --text-main: #0f172a;
    --text-muted: #64748b;
    --surface: #ffffff;
    --surface-soft: #f8fafc;
    --border-soft: #e2e8f0;
}

html { background-color: #fafafa; }

body {
    /* The old background photo (dailycheckin.jpg) was never in the repo. */
    background: #f1f5f9;
    font-family: var(--mc-font-sans, 'Outfit', sans-serif);
    margin: 0;
    /* No padding reset here: navigationV2.css pads the body on desktop to make room for the sidebar, and a reset put the form under it. */
    color: var(--text-main);
    min-height: 100vh;
}


.checkin-container {
    max-width: 560px;
    margin: 0 auto;
    background: rgba(255, 255, 255, 0.96);
    backdrop-filter: blur(10px);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    position: relative;
    box-shadow: 0 22px 48px rgba(15, 23, 42, 0.12);
}

.header-section {
    background: linear-gradient(180deg, #ffffff 0%, #f8fbff 100%);
    padding: 50px 28px 28px;
    color: #262626;
    text-align: center;
    border-bottom: 1px solid var(--border-soft);
    position: relative;
}

.header-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: absolute;
    top: 25px;
    left: 25px;
    right: 25px;
}

.header-icon-link {
    display: inline-grid;
    place-items: center;
    width: 44px;
    height: 44px;
    margin: -10px;
    border-radius: 12px;
    color: #0f172a;
    text-decoration: none;
    font-size: 1.15rem;
}

.header-icon-link:hover {
    background: #f1f5f9;
}

.header-help-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    min-height: 36px;
    padding: 0 12px;
    border-radius: 999px;
    border: 1px solid #fecaca;
    background: #fff5f5;
    color: #b91c1c;
    font-size: 0.85rem;
    font-weight: 600;
    text-decoration: none;
}

.header-help-link:hover {
    background: #fee2e2;
}

.header-icon-link:focus-visible,
.header-help-link:focus-visible,
.rating-item:focus-visible,
.symptoms-selector:focus-visible,
.submit-btn:focus-visible,
.symptom-item:focus-visible,
.symptom-tag:focus-visible,
.done-btn:focus-visible {
    outline: 3px solid rgba(15, 118, 110, 0.35);
    outline-offset: 2px;
}

.header-section h1 {
    font-size: 1.85rem;
    font-weight: 700;
    margin-bottom: 10px;
    margin-top: 16px;
    letter-spacing: -0.02em;
}

.header-section p {
    font-size: 1.05rem;
    opacity: 1;
    color: var(--text-muted);
    font-weight: 400;
}

.content-section {
    padding: 34px 28px 38px;
    flex-grow: 1;
    margin-top: 0;
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(14px);
    border-top-left-radius: 22px;
    border-top-right-radius: 22px;
    box-shadow: 0 -6px 20px rgba(15, 23, 42, 0.04);
}

.step-progress {
    display: flex;
    gap: 6px;
    justify-content: center;
    margin: 4px 0 20px;
    padding: 0;
    list-style: none;
    flex-wrap: wrap;
}

.step-pill {
    font-size: 0.74rem;
    font-weight: 600;
    color: #64748b;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 999px;
    padding: 5px 10px;
}

.step-pill.done {
    color: #115e59;
    background: #f0fdfa;
    border-color: #ccfbf1;
}

.step-pill.active {
    color: #ffffff;
    background: #0f766e;
    border-color: #0f766e;
}

.section-title {
    color: var(--text-main);
    font-size: 1.28rem;
    font-weight: 700;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 10px;
    letter-spacing: -0.01em;
}

.section-subtitle {
    color: var(--text-muted);
    font-size: 0.94rem;
    margin-bottom: 20px;
    line-height: 1.5;
}

/* Anxiety Rating: 11 equal columns on wider screens, two rows on phones. */
.rating-horizontal {
    display: grid;
    grid-template-columns: repeat(11, minmax(0, 1fr));
    gap: 6px;
    margin: 0 0 8px;
}

.rating-item {
    display: grid;
    place-items: center;
    min-width: 0;
    height: 44px;
    padding: 0;
    border-radius: 12px;
    border: 1.5px solid #d1d5db;
    background: #ffffff;
    font: inherit;
    font-size: 1.1rem;
    font-weight: 700;
    color: #334155;
    cursor: pointer;
    transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease;
    -webkit-tap-highlight-color: transparent;
}

.rating-item:hover {
    border-color: #14b8a6;
}

.rating-item.selected {
    color: #ffffff;
    border-color: #0f766e;
    background: #0f766e;
}

.rating-scale-ends {
    display: flex;
    justify-content: space-between;
    color: #64748b;
    font-size: 0.8rem;
    margin-bottom: 12px;
}

.rating-readout-text {
    min-height: 1.5em;
    margin: 0;
    text-align: center;
    color: #64748b;
    font-size: 0.95rem;
    font-weight: 500;
}

.header-section .rating-readout-text.is-set {
    color: #115e59;
    font-weight: 700;
}

.header-section .rating-readout-text.is-error {
    color: #b91c1c;
    font-weight: 600;
}

.advanced-ratings {
    margin-bottom: 30px;
    display: grid;
    gap: 16px;
}

.rating-box {
    background: var(--surface-soft);
    border: 1px solid var(--border-soft);
    border-radius: 14px;
    padding: 14px;
}

.rating-row {
    display: flex;
    justify-content: space-between;
    margin-bottom: 8px;
}

.rating-label {
    font-weight: 600;
    color: #334155;
    font-size: 0.92rem;
}

.rating-readout {
    color: #115e59;
    font-weight: 700;
    font-size: 0.92rem;
}

.range-input {
    width: 100%;
    cursor: pointer;
    accent-color: #0f766e;
}

.recovery-tracking-panel {
    margin-bottom: 30px;
    padding: 18px;
    border-radius: 18px;
    background: linear-gradient(180deg, rgba(240, 253, 250, 0.96), rgba(255, 255, 255, 0.98));
    border: 1px solid rgba(20, 184, 166, 0.16);
}

.recovery-tracking-head,
.recovery-track-slider-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.recovery-tracking-head {
    margin-bottom: 8px;
}

.recovery-tracking-kicker {
    display: inline-block;
    margin-bottom: 6px;
    font-size: 0.72rem;
    font-weight: 800;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: #0f766e;
}

.recovery-tracking-note,
.recovery-track-label {
    font-size: 0.82rem;
    color: var(--text-muted);
    font-weight: 600;
}

.recovery-tracking-title {
    margin-bottom: 6px;
}

.recovery-tracking-subtitle {
    margin-bottom: 14px;
}

.recovery-track-group {
    margin-bottom: 16px;
}

.recovery-track-group-last {
    margin-bottom: 0;
}

.recovery-track-chip-row {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 10px;
}

.recovery-track-chip {
    padding: 9px 12px;
    border-radius: 999px;
    border: 1px solid rgba(148, 163, 184, 0.2);
    background: #fff;
    color: #475569;
    font-weight: 700;
    font-family: inherit;
    cursor: pointer;
}

.recovery-track-chip.selected {
    background: rgba(20, 184, 166, 0.12);
    color: #0f766e;
    border-color: rgba(20, 184, 166, 0.24);
}

/* Textarea Area */
.textarea-wrapper {
    position: relative;
    margin-bottom: 35px;
}

textarea {
    width: 100%;
    padding: 16px;
    border: 1px solid var(--border-soft);
    border-radius: 14px;
    resize: none;
    font-family: inherit;
    font-size: 1rem;
    outline: none;
    box-sizing: border-box;
    transition: all 0.3s;
    background: #ffffff;
}

textarea:focus {
    border-color: #0f766e;
    background: #fff;
    box-shadow: 0 4px 12px rgba(15, 118, 110, 0.1);
}

.char-count {
    position: absolute;
    bottom: 15px;
    right: 20px;
    font-size: 0.8rem;
    color: var(--text-muted);
    font-weight: 500;
}

/* Symptoms Area */
.symptoms-selector {
    border: 1px dashed #94a3b8;
    border-radius: 14px;
    padding: 18px;
    width: 100%;
    text-align: center;
    cursor: pointer;
    color: #0f766e;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    transition: all 0.3s;
    margin-bottom: 40px;
    background: #fff;
    font-family: inherit;
}

.symptoms-selector:hover {
    border-color: #0f766e;
    background: #f0fdfa;
}

.selected-symptoms {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 25px;
}

.symptom-tag {
    background: #f0fdfa;
    color: #0f766e;
    padding: 8px 16px;
    border-radius: 25px;
    font-size: 0.9rem;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 8px;
    animation: fadeIn 0.3s ease-out;
    border: 1px solid #ccfbf1;
    font-family: inherit;
    cursor: pointer;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(5px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.symptom-tag i {
    cursor: pointer;
    font-size: 0.8rem;
    opacity: 0.7;
    transition: opacity 0.2s;
}

.symptom-tag i:hover {
    opacity: 1;
}

/* Submit Button */
.submit-btn {
    width: 100%;
    padding: 15px;
    border-radius: 14px;
    background: var(--btn-grad);
    color: #fff;
    border: none;
    font-size: 1rem;
    font-weight: 700;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    box-shadow: 0 10px 18px rgba(15, 118, 110, 0.22);
    transition: all 0.3s;
    margin-bottom: 30px;
}

.submit-btn-success {
    background: linear-gradient(90deg, #16a34a 0%, #15803d 100%);
}

.submit-btn:hover:not(:disabled) {
    filter: brightness(1.08);
}

.submit-btn:disabled {
    cursor: default;
}

.submit-feedback {
    display: none;
    border-radius: 12px;
    padding: 12px 14px;
    font-size: 0.9rem;
    font-weight: 500;
    margin-top: -12px;
    margin-bottom: 18px;
}

.submit-feedback.success {
    display: block;
    background: #ecfdf3;
    border: 1px solid #86efac;
    color: #166534;
}

.submit-feedback.error {
    display: block;
    background: #fef2f2;
    border: 1px solid #fecaca;
    color: #b91c1c;
}

/* Modal Styles */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(15, 23, 42, 0.85);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    padding: 20px;
}

.modal-overlay.active {
    display: flex;
}

.symptoms-modal {
    background: #fff;
    border-radius: 30px;
    width: 100%;
    max-width: 480px;
    max-height: 85vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    animation: modalSlide 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@keyframes modalSlide {
    from {
        transform: translateY(30px);
        opacity: 0;
    }

    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.modal-header {
    padding: 25px 30px;
    border-bottom: 1px solid #f1f5f9;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h2 {
    font-size: 1.5rem;
    font-weight: 700;
    margin: 0;
    color: var(--text-main);
}

.symptoms-modal-close {
    cursor: pointer;
    font-size: 1.2rem;
    color: var(--text-muted);
    background: transparent;
    border: none;
    padding: 0;
}

.modal-body {
    padding: 25px 30px;
    overflow-y: auto;
    flex-grow: 1;
}

.symptoms-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.symptom-item {
    padding: 12px 15px;
    border: 1px solid #e2e8f0;
    border-radius: 14px;
    font-size: 0.95rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 10px;
    background: #f8fafc;
    color: var(--text-muted);
    width: 100%;
    text-align: left;
    font-family: inherit;
}

.symptom-item i {
    font-size: 0.8rem;
    opacity: 0;
    transition: opacity 0.2s;
}

.symptom-item.selected {
    background: #f0fdfa;
    border-color: #0f766e;
    color: #0f766e;
}

.symptom-item.selected i {
    opacity: 1;
}

.modal-footer {
    padding: 20px 30px 30px;
    border-top: 1px solid #f1f5f9;
}

.done-btn {
    width: 100%;
    padding: 15px;
    background: var(--btn-grad);
    color: #fff;
    border: none;
    border-radius: 18px;
    font-weight: 700;
    font-size: 1rem;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(15, 118, 110, 0.3);
}

.chat-header-actions {
    display: flex;
    gap: 5px;
}

.clear-chat-btn {
    font-size: 1rem;
}

/* Responsive Fixes */
@media (max-width: 767px) {
    /* The injected menu button sits top-left on phones and covered the back arrow; the menu and bottom nav already handle navigation. */
    .header-icon-link {
        display: none;
    }

    .header-top {
        justify-content: flex-end;
    }
}

@media (max-width: 480px) {
    .header-section {
        padding: 72px 16px 24px;
    }

    .header-top {
        top: 18px;
        left: 16px;
        right: 16px;
    }

    .header-section h1 {
        font-size: 1.55rem;
        line-height: 1.25;
    }

    .content-section {
        padding: 28px 16px 32px;
    }

    /* 0-5 on the first row, 6-10 on the second: every number stays a full-size tap target instead of the row spilling off the screen. */
    .rating-horizontal {
        grid-template-columns: repeat(6, minmax(0, 1fr));
        gap: 8px;
    }

    .rating-item {
        height: 48px;
    }

    .symptoms-grid {
        grid-template-columns: 1fr;
    }

    /* Symptom picker becomes a bottom sheet on phones. */
    .modal-overlay {
        align-items: flex-end;
        padding: 0;
    }

    .symptoms-modal {
        max-width: none;
        max-height: 88dvh;
        border-radius: 22px 22px 0 0;
    }

    .modal-header,
    .modal-body {
        padding: 20px;
    }

    .modal-footer {
        padding: 16px 20px calc(16px + env(safe-area-inset-bottom, 0px));
    }
}

@media (prefers-reduced-motion: reduce) {
    .symptoms-modal,
    .symptom-tag {
        animation: none;
    }
}
