/* ============================================================
   DAILY NUTRITION CALCULATOR — PROFILE PAGE
   V2 UI
============================================================ */


/* ============================================================
   MAIN LAYOUT
============================================================ */

.profile-main {
    width: min(1240px, calc(100% - 32px));

    margin: 12px auto 22px;

    box-sizing: border-box;
}


/* ============================================================
   PAGE HEADER
============================================================ */

.profile-header {
    margin-bottom: 12px;
}

.profile-header h1 {
    margin: 0;

    color: var(--text);

    font-size: 24px;
    line-height: 1.2;
}

.profile-header p {
    margin: 4px 0 0;

    color: var(--muted);

    font-size: 11px;
}


/* ============================================================
   TOP PROFILE AREA
============================================================ */

.profile-top-grid {
    display: grid;

    grid-template-columns:
        minmax(0, 1.15fr)
        minmax(0, .85fr);

    gap: 10px;

    margin-bottom: 10px;
}


/* ============================================================
   PROFILE CARD
============================================================ */

.profile-card {
    min-width: 0;

    background: var(--surface);

    border: 1px solid var(--border);

    border-radius: 11px;

    padding: 12px;

    box-sizing: border-box;

    box-shadow: var(--shadow);
}

.profile-card h2 {
    margin: 0;

    color: var(--text);

    font-size: 16px;
    line-height: 1.2;
}

.profile-card-description {
    margin: 3px 0 0;

    color: var(--muted);

    font-size: 10px;
    line-height: 1.4;
}


/* ============================================================
   CARD HEADING
============================================================ */

.profile-card-heading {
    margin-bottom: 10px;
}


/* ============================================================
   PROFILE FORM
============================================================ */

.profile-grid {
    display: grid;

    grid-template-columns:
        repeat(2, minmax(0, 1fr));

    gap: 9px;
}

.profile-field {
    display: flex;

    flex-direction: column;

    gap: 4px;

    min-width: 0;
}

.profile-field label {
    color: var(--text);

    font-size: 11px;

    font-weight: 600;
}

.profile-field input,
.profile-field select {
    width: 100%;
    min-width: 0;

    height: 32px;

    padding: 5px 7px;

    box-sizing: border-box;

    border: 1px solid var(--border);

    border-radius: 7px;

    background: var(--input-bg);
    color: var(--text);

    font: inherit;
    font-size: 12px;
}

.profile-field input::placeholder {
    color: var(--muted);
}

.profile-field input:focus,
.profile-field select:focus {
    outline: none;

    border-color: var(--primary);

    box-shadow:
        0 0 0 3px var(--focus);
}


/* ============================================================
   FORM ACTIONS
============================================================ */

.profile-actions {
    display: flex;

    align-items: center;

    gap: 8px;

    margin-top: 11px;
}

.primary-button {
    width: auto;

    margin: 0;

    padding: 8px 12px;

    background: var(--primary);

    color: #172033;

    border: 0;

    border-radius: 8px;

    font-size: 11px;

    font-weight: 800;

    cursor: pointer;
}

.primary-button:hover {
    background: var(--primary-dark);

    color: #ffffff;

    transform: translateY(-1px);

    box-shadow:
        0 4px 10px rgba(244, 180, 0, .16);
}

.primary-button:focus-visible {
    outline: 3px solid var(--focus);

    outline-offset: 2px;
}

.profile-message {
    min-height: 15px;

    color: var(--success);

    font-size: 10px;
}

.profile-message.error {
    color: var(--error);
}


/* ============================================================
   CURRENT STATS
============================================================ */

.profile-stats-grid {
    display: grid;

    grid-template-columns:
        repeat(2, minmax(0, 1fr));

    gap: 7px;
}

.profile-stat {
    min-width: 0;

    padding: 9px;

    border: 1px solid var(--border);

    border-radius: 8px;

    background: var(--input-bg);
}

.profile-stat span {
    display: block;

    margin-bottom: 3px;

    color: var(--muted);

    font-size: 9px;
}

.profile-stat strong {
    display: block;

    color: var(--text);

    font-size: 15px;

    line-height: 1.2;

    font-weight: 800;
}


/* ============================================================
   WEEKLY PROGRESS
============================================================ */

.weekly-progress-card {
    margin-bottom: 0;
}

.profile-section-header {
    display: flex;

    align-items: flex-start;

    justify-content: space-between;

    gap: 12px;

    margin-bottom: 10px;
}

.profile-section-header h2 {
    margin: 0;

    color: var(--text);

    font-size: 16px;

    line-height: 1.2;
}

.profile-section-header p {
    margin: 3px 0 0;

    color: var(--muted);

    font-size: 10px;
}


/* ============================================================
   WEEKLY PROGRESS LIST
============================================================ */

.weekly-progress-list {
    display: flex;

    flex-direction: column;

    gap: 7px;
}


/* ============================================================
   WEEKLY PROGRESS ITEM
============================================================ */

.weekly-progress-item {
    box-sizing: border-box;

    padding: 10px 11px;

    border: 1px solid var(--border);

    border-radius: 8px;

    background: var(--input-bg);

    transition:
        border-color .18s ease,
        background-color .18s ease;
}

.weekly-progress-item:hover {
    border-color: var(--mint-border);
}


/* ============================================================
   WEEK HEADER
============================================================ */

.weekly-progress-heading {
    display: flex;

    align-items: center;

    justify-content: space-between;

    gap: 12px;

    margin-bottom: 8px;
}

.weekly-progress-heading > div {
    display: flex;

    align-items: center;

    gap: 8px;

    min-width: 0;
}

.weekly-progress-heading strong {
    color: var(--text);

    font-size: 11px;

    white-space: nowrap;
}

.weekly-progress-heading span {
    color: var(--muted);

    font-size: 10px;
}

.weekly-progress-heading small {
    color: var(--muted);

    font-size: 9px;

    white-space: nowrap;
}


/* ============================================================
   WEEKLY METRICS
============================================================ */

.weekly-progress-metrics {
    display: grid;

    grid-template-columns:
        repeat(3, minmax(0, 1fr));

    gap: 7px;
}

.weekly-metric {
    display: flex;

    align-items: center;

    justify-content: space-between;

    gap: 8px;

    padding: 7px 9px;

    border-radius: 7px;

    background: var(--surface);
}

.weekly-metric span {
    color: var(--muted);

    font-size: 9px;
}

.weekly-metric strong {
    color: var(--text);

    font-size: 11px;
}


/* ============================================================
   WEEK STATUS
============================================================ */

.weekly-progress-item.no-data {
    opacity: .72;
}

.weekly-progress-item.future {
    opacity: .5;
}


/* ============================================================
   DARK MODE
============================================================ */

html[data-theme="dark"] .profile-stat,
html[data-theme="dark"] .weekly-progress-item {
    background: var(--input-bg);
}

html[data-theme="dark"] .weekly-metric {
    background: var(--surface);
}


/* ============================================================
   TABLET
============================================================ */

@media (max-width: 1000px) {

    .profile-top-grid {
        grid-template-columns: 1fr;
    }

}


/* ============================================================
   MOBILE
============================================================ */

@media (max-width: 700px) {

    .profile-main {
        width: calc(100% - 24px);

        margin-top: 10px;
    }

    .profile-header h1 {
        font-size: 21px;
    }

    .profile-grid {
        grid-template-columns:
            repeat(2, minmax(0, 1fr));
    }

}


/* ============================================================
   SMALL MOBILE
============================================================ */

@media (max-width: 600px) {

    .profile-main {
        width: calc(100% - 16px);

        margin-top: 8px;
    }

    .profile-card {
        padding: 10px;

        border-radius: 10px;
    }

    .profile-header {
        margin-bottom: 10px;
    }

    .profile-header h1 {
        font-size: 19px;
    }

    .profile-header p {
        font-size: 10px;
    }

    .profile-grid {
        grid-template-columns: 1fr;
    }

    .profile-actions {
        align-items: flex-start;

        flex-direction: column;
    }

    .profile-message {
        min-height: 14px;
    }

    .profile-stats-grid {
        grid-template-columns:
            repeat(2, minmax(0, 1fr));
    }

    .weekly-progress-heading {
        align-items: flex-start;

        flex-direction: column;

        gap: 3px;
    }

    .weekly-progress-metrics {
        grid-template-columns: 1fr;
    }

}


/* ============================================================
   VERY SMALL PHONES
============================================================ */

@media (max-width: 380px) {

    .profile-main {
        width: calc(100% - 12px);
    }

    .profile-stats-grid {
        grid-template-columns: 1fr;
    }

}