/* profile.css */
#profile {
    background: var(--bg-dashboard) !important;
}

.profile-section {
    margin-bottom: 16px;
    background: var(--white);
    border-radius: var(--border-radius);
    padding: 14px;
    box-shadow: var(--shadow-card);
    border: 1px solid rgba(0, 0, 0, 0.04);
}

/* Делаем экраны профиля скроллируемыми */
#profile .main-content,
#edit-profile .main-content {
    overflow-y: auto;
    padding-bottom: 100px;
    scrollbar-width: none;
    -ms-overflow-style: none;
}

#profile .main-content::-webkit-scrollbar,
#edit-profile .main-content::-webkit-scrollbar {
    display: none;
}

.profile-section h3 {
    font-size: 16px;
    font-weight: 600;
    color: var(--dark);
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 8px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--gray-light);
}

.days-grid-edit {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 8px;
    margin-top: 8px;
}

.day-card-edit {
    background: var(--white);
    border: 1.5px solid var(--gray-light);
    border-radius: 12px;
    padding: 8px 4px;
    text-align: center;
    cursor: pointer;
    transition: var(--transition);
    position: relative;
    user-select: none;
}

.day-card-edit:hover {
    border-color: var(--primary);
    transform: translateY(-2px);
    box-shadow: var(--shadow);
}

.day-card-edit.selected {
    border-color: var(--primary);
    background: var(--primary);
    color: white;
    box-shadow: var(--shadow-lg);
}

.day-card-edit .day-short {
    font-size: 12px;
    font-weight: 700;
    margin-bottom: 2px;
}

.day-card-edit .day-full {
    font-size: 8px;
    opacity: 0.8;
}

.form-group {
    margin-bottom: 16px;
}

.form-label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: var(--dark);
    margin-bottom: 6px;
}

.form-input, .form-select {
    width: 100%;
    padding: 10px 14px;
    border: 1.5px solid var(--gray-light);
    border-radius: 10px;
    font-size: 14px;
    transition: var(--transition);
    background: var(--white);
}

.form-input:focus, .form-select:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(var(--primary-rgb), 0.1);
}

.profile-header {
    text-align: center;
    margin-bottom: 12px;
}

.avatar {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: var(--primary);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    font-weight: 700;
    margin: 0 auto 8px;
}

.profile-name {
    font-size: 22px;
    font-weight: 700;
    color: var(--dark);
    margin-bottom: 2px;
}

.profile-subtitle {
    color: var(--gray);
    font-size: 13px;
}

.profile-item {
    background: var(--white);
    border-radius: var(--border-radius);
    padding: 14px;
    margin-bottom: 6px;
    box-shadow: var(--shadow-card);
    border: 1px solid rgba(0, 0, 0, 0.04);
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.profile-item:hover {
    border-color: rgba(var(--primary-rgb), 0.2);
    background: rgba(var(--primary-rgb), 0.02);
}

.profile-item-left {
    display: flex;
    align-items: center;
    gap: 10px;
}

.profile-item-icon {
    width: 36px;
    height: 36px;
    border-radius: 8px;
    background: var(--light);
    display: flex;
    align-items: center;
    justify-content: center;
}

.profile-item-icon svg {
    color: var(--primary);
}

.profile-item-text {
    flex: 1;
}

.profile-item-title {
    font-weight: 600;
    color: var(--dark);
    margin-bottom: 1px;
    font-size: 14px;
}

.profile-item-subtitle {
    font-size: 11px;
    color: var(--gray);
}

.profile-item-arrow {
    color: var(--gray);
    font-size: 16px;
}

/* Сетка оборудования в профиле */
.equipment-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-top: 8px;
}

.equipment-item {
    background: var(--white);
    border: 1.5px solid var(--gray-light);
    border-radius: 12px;
    padding: 10px 8px;
    text-align: center;
    cursor: pointer;
    transition: var(--transition);
    font-size: 13px;
    font-weight: 500;
    color: var(--dark);
    min-height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.equipment-item:hover {
    border-color: var(--primary);
    transform: translateY(-1px);
    box-shadow: var(--shadow);
}

.equipment-item.selected {
    border-color: var(--primary);
    background: rgba(var(--primary-rgb), 0.05);
    color: var(--primary);
    font-weight: 600;
}


.profile-disliked-foods-grid {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.profile-disliked-foods-grid .disliked-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.profile-disliked-item {
    padding: 10px 12px;
    min-height: auto;
    font-size: 14px;
}

/* =============== PALETTE PICKER =============== */
.palette-picker { padding: 8px 14px 4px; }
.palette-label { font-size: 13px; font-weight: 600; color: var(--dark); margin-bottom: 10px; }
.palette-options { display: flex; gap: 10px; flex-wrap: wrap; }
.palette-dot {
    width: 34px; height: 34px; border-radius: 50%;
    background: var(--dot-clr); border: 2px solid transparent;
    cursor: pointer; transition: transform 0.2s, box-shadow 0.2s;
    padding: 0; position: relative;
}
.palette-dot.active {
    box-shadow: 0 0 0 2px var(--surface), 0 0 0 4px var(--dot-clr);
}
.palette-dot:active { transform: scale(0.93); }
.palette-custom {
    background: var(--gray-light); display: flex;
    align-items: center; justify-content: center;
    font-size: 18px; color: var(--gray); cursor: pointer;
}
.palette-custom input { position: absolute; opacity: 0; width: 0; height: 0; }

/* =============== DARK THEME OVERRIDES =============== */
[data-theme="dark"] .profile-section,
[data-theme="dark"] .profile-item {
    border-color: var(--border);
}
[data-theme="dark"] .profile-item-icon {
    background: rgba(var(--primary-rgb), 0.15);
}

/* === P1 Журнал тренировок === */
#workout-journal .main-content {
    padding-bottom: 90px;
    overflow-y: auto;
    scrollbar-width: none;
    -ms-overflow-style: none;
}
#workout-journal .main-content::-webkit-scrollbar { display: none; }
.wj-group {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-secondary, #8a8a8a);
    margin: 18px 4px 10px;
}
.wj-group:first-child { margin-top: 4px; }
.wj-card {
    background: var(--surface, #fff);
    border-radius: var(--border-radius-small, 14px);
    padding: 14px 16px;
    margin-bottom: 10px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    border: 1px solid var(--border, rgba(0,0,0,0.04));
}
.wj-date {
    font-size: 11px;
    color: var(--text-secondary, #9a9a9a);
    margin-bottom: 4px;
}
.wj-name {
    font-size: 15px;
    font-weight: 600;
    color: var(--text, #2a2a2a);
    margin-bottom: 10px;
}
.wj-meta {
    display: flex;
    align-items: center;
    gap: 10px;
}
.wj-bar {
    flex: 1;
    height: 6px;
    background: var(--gray-light, #ececec);
    border-radius: 3px;
    overflow: hidden;
}
.wj-bar-fill {
    height: 100%;
    background: var(--gradient-primary, var(--primary, #C0643E));
    border-radius: 3px;
}
.wj-pct {
    font-size: 12px;
    font-weight: 600;
    color: var(--primary, #C0643E);
    min-width: 34px;
    text-align: right;
}
.wj-dur {
    font-size: 12px;
    color: var(--text-secondary, #9a9a9a);
}
.wj-state {
    margin-top: 8px;
    font-size: 13px;
    color: var(--text-secondary, #7a7a7a);
}
.wj-empty, .wj-empty-hint {
    text-align: center;
    color: var(--text-secondary, #9a9a9a);
    padding: 40px 20px;
}
.wj-empty-icon { font-size: 40px; margin-bottom: 14px; }
.wj-empty-text { font-size: 14px; line-height: 1.5; margin-bottom: 18px; }

/* === P3 Достижения === */
#achievements .main-content { overflow-y: auto; scrollbar-width: none; -ms-overflow-style: none; padding-bottom: 90px; }
#achievements .main-content::-webkit-scrollbar { display: none; }
.ach-dot { position: absolute; top: -2px; right: -2px; width: 9px; height: 9px; border-radius: 50%; background: var(--primary, #C0643E); border: 2px solid var(--surface, #fff); }
.ach-tabs { display: flex; gap: 8px; margin-bottom: 16px; }
.ach-tab {
    flex: 1; padding: 9px;
    border: 1px solid var(--border, rgba(0,0,0,0.08));
    border-radius: var(--border-radius-small, 14px);
    background: transparent; color: var(--text-secondary, #8a8a8a);
    font-size: 13px; font-weight: 600; cursor: pointer;
}
.ach-tab.active { background: var(--gradient-primary, var(--primary, #C0643E)); color: #fff; border-color: transparent; }
.ach-card {
    display: flex; align-items: center; gap: 14px;
    background: var(--surface, #fff);
    border-radius: var(--border-radius-small, 14px);
    padding: 14px; margin-bottom: 10px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
    border: 1px solid var(--border, rgba(0,0,0,0.04));
}
.ach-card.locked { opacity: 0.55; }
.ach-card.locked .ach-icon { filter: grayscale(1); opacity: 0.5; }
.ach-icon { font-size: 32px; line-height: 1; width: 44px; text-align: center; flex-shrink: 0; }
.ach-info { min-width: 0; }
.ach-title { font-size: 15px; font-weight: 600; color: var(--text, #2a2a2a); margin-bottom: 3px; }
.ach-sub { font-size: 13px; color: var(--text-secondary, #8a8a8a); line-height: 1.35; }

/* Экран награды */
.ach-reward-overlay {
    position: fixed; inset: 0; z-index: 9999;
    display: flex; align-items: center; justify-content: center; padding: 28px;
    background: var(--gradient-primary, var(--primary, #C0643E));
    animation: fadeIn 0.3s ease-out;
}
.ach-reward-card { text-align: center; max-width: 340px; }
.ach-reward-icon { font-size: 72px; line-height: 1; margin-bottom: 18px; animation: achPop 0.45s cubic-bezier(0.34,1.56,0.64,1); }
.ach-reward-title { font-size: 22px; font-weight: 700; color: #fff; margin-bottom: 14px; }
.ach-reward-text { font-size: 16px; line-height: 1.5; color: rgba(255,255,255,0.92); margin-bottom: 18px; }
.ach-reward-caption { font-size: 13px; color: rgba(255,255,255,0.6); margin-bottom: 28px; }
.ach-reward-btn {
    padding: 13px 28px; border: 1.5px solid rgba(255,255,255,0.85);
    border-radius: var(--border-radius-small, 14px);
    background: transparent; color: #fff; font-size: 15px; font-weight: 600; cursor: pointer;
}
.ach-reward-btn:active { background: rgba(255,255,255,0.15); }
@keyframes achPop { 0% { transform: scale(0.5); opacity: 0; } 100% { transform: scale(1); opacity: 1; } }

/* === P2 Графики прогресса === */
#progress-screen .main-content { overflow-y: auto; scrollbar-width: none; -ms-overflow-style: none; padding-bottom: 90px; }
#progress-screen .main-content::-webkit-scrollbar { display: none; }
.prog-period { display: flex; gap: 8px; margin-bottom: 16px; }
.prog-period-tab {
    flex: 1; padding: 9px;
    border: 1px solid var(--border, rgba(0,0,0,0.08));
    border-radius: var(--border-radius-small, 14px);
    background: transparent; color: var(--text-secondary, #8a8a8a);
    font-size: 13px; font-weight: 600; cursor: pointer;
}
.prog-period-tab.active { background: var(--gradient-primary, var(--primary, #C0643E)); color: #fff; border-color: transparent; }
.prog-card {
    background: var(--surface, #fff);
    border-radius: var(--border-radius, 18px);
    padding: 16px; margin-bottom: 12px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
    border: 1px solid var(--border, rgba(0,0,0,0.04));
}
.prog-card-head { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 10px; }
.prog-card-title { font-size: 15px; font-weight: 600; color: var(--text, #2a2a2a); }
.prog-card-val { font-size: 14px; font-weight: 600; color: var(--primary, #C0643E); }
.chart-svg { width: 100%; height: auto; display: block; }
.chart-empty { text-align: center; color: var(--text-secondary, #9a9a9a); font-size: 13px; padding: 22px 8px; line-height: 1.4; }
.prog-weight-btn {
    width: 100%; margin-top: 12px; padding: 11px; border: none;
    border-radius: var(--border-radius-small, 14px);
    background: var(--gradient-primary, var(--primary, #C0643E));
    color: #fff; font-size: 14px; font-weight: 600; cursor: pointer;
}
.prog-card-note { font-size: 12px; color: var(--text-secondary, #8a8a8a); margin-top: 8px; text-align: center; }

/* Инлайн-ввод веса */
.prog-weight-edit { display: flex; gap: 8px; margin-top: 12px; }
.prog-weight-input {
    flex: 1; padding: 10px 12px;
    border: 1.5px solid var(--gray-light, #ddd);
    border-radius: var(--border-radius-small, 14px);
    font-size: 14px; background: var(--surface, #fff); color: var(--text, #2a2a2a);
}
.prog-weight-input:focus { outline: none; border-color: var(--primary, #C0643E); }
.prog-weight-save {
    padding: 10px 18px; border: none;
    border-radius: var(--border-radius-small, 14px);
    background: var(--gradient-primary, var(--primary, #C0643E));
    color: #fff; font-weight: 600; font-size: 14px; cursor: pointer;
}

/* Подпись дат под графиком + журнал внутри карточки прогресса */
.prog-card-axis { display: flex; justify-content: space-between; font-size: 11px; color: var(--text-secondary, #9a9a9a); margin-top: 6px; }
.prog-card-axis span:only-child { margin: 0 auto; }
#progJournalCard .wj-card { box-shadow: none; border: none; border-bottom: 1px solid var(--border, rgba(0,0,0,0.06)); border-radius: 0; padding: 12px 0; margin: 0; }
#progJournalCard .wj-card:last-child { border-bottom: none; padding-bottom: 0; }
#progJournalCard .wj-group { margin: 12px 0 6px; }
#progJournalCard .wj-group:first-of-type { margin-top: 4px; }

/* Ограничения по здоровью в профиле — тот же вид, что в первой анкете:
   мультивыбор карточками из полного справочника (Тимур, 19.08.2026). */
.profile-health-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin-top: 6px;
}
.profile-health-grid .choice-card {
    min-height: 56px;
    margin: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 10px;
    border: 1px solid var(--border, #E0D7CA);
    border-radius: 12px;
    background: var(--surface, #fff);
    cursor: pointer;
}
.profile-health-grid .choice-card.selected {
    border-color: var(--primary, #C0643E);
    background: var(--primary-very-light, rgba(192, 100, 62, .1));
}
.profile-health-grid .choice-card.selected .choice-text { color: var(--text-primary); }
.profile-health-grid .profile-health-none { grid-column: 1 / -1; }
