/* Основные переменные и сброс */
:root {
    --bg-dark: #0f172a;
    --glass-bg: rgba(30, 41, 59, 0.7);
    --glass-border: rgba(255, 255, 255, 0.1);
    --accent: #2f81f7;
    --text-primary: #f0f6fc;
    --text-secondary: #8b949e;
    --success: #2ea043;
    --danger: #da3633;
    --card-radius: 20px;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
body {
    margin: 0; padding: 0;
    font-family: 'Inter', sans-serif;
    background-color: var(--bg-dark);
    color: var(--text-primary);
    overflow: hidden;
    height: 100vh;
}

/* Видео фон */
.video-background {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%; z-index: -1; overflow: hidden;
}
.video-background video {
    min-width: 100%; min-height: 100%; width: auto; height: auto;
    position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%);
    object-fit: cover;
}
.video-overlay {
    position: absolute; top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(15, 23, 42, 0.85); backdrop-filter: blur(5px);
}

/* Контейнер */
.app-container {
    display: flex; flex-direction: column; height: 100%; max-width: 600px; margin: 0 auto; position: relative;
}

/* HEADER */
.header {
    padding: 15px 20px; display: flex; justify-content: space-between; align-items: center; z-index: 10;
}
.brand-logo { font-size: 28px; font-weight: 700; margin: 0; letter-spacing: -1px; }
.toggle-view {
    width: 50px; height: 28px; background: rgba(255,255,255,0.1); border-radius: 14px;
    position: relative; cursor: pointer; transition: 0.3s;
}
.toggle-handle {
    width: 24px; height: 24px; background: var(--text-primary); border-radius: 50%;
    position: absolute; top: 2px; left: 2px; transition: 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}
.analytics-active .toggle-handle { transform: translateX(22px); background: var(--accent); }

/* CONTENT & SCROLL */
.content { flex: 1; overflow-y: auto; padding-bottom: 90px; scroll-behavior: smooth; position: relative; }
.view-section { display: none; animation: fadeIn 0.3s ease; }
.active-view { display: block; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }

/* Dates Scroll */
.dates-wrapper { padding: 10px 0; margin-bottom: 10px; display: flex; flex-direction: column; align-items: flex-end; padding-right: 20px; }

/* КНОПКА СЕГОДНЯ - Изменена для подъема вверх */
.reset-btn {
    background: transparent; border: 1px solid rgba(255,255,255,0.2); color: var(--text-secondary);
    border-radius: 12px; padding: 4px 12px; font-size: 11px; margin-bottom: 15px; cursor: pointer;
}

.dates-scroll {
    display: flex; gap: 8px; overflow-x: auto; width: 100%; padding: 0 20px;
    scrollbar-width: none; -ms-overflow-style: none; justify-content: flex-start;
}
.dates-scroll::-webkit-scrollbar { display: none; }
.date-chip {
    min-width: 50px; height: 65px; background: var(--glass-bg); border: 1px solid var(--glass-border);
    border-radius: 14px; display: flex; flex-direction: column; align-items: center; justify-content: center;
    flex-shrink: 0; transition: 0.2s; cursor: pointer;
}
.date-chip.active { background: var(--accent); border-color: var(--accent); box-shadow: 0 4px 12px rgba(47, 129, 247, 0.3); }
.date-chip span:first-child { font-size: 11px; opacity: 0.7; margin-bottom: 2px; }
.date-chip span:last-child { font-size: 18px; font-weight: 600; }
.date-chip.sunday-end { margin-right: 15px; position: relative; }
.date-chip.sunday-end::after {
    content: ''; position: absolute; right: -12px; top: 15%; height: 70%; width: 1px; background: rgba(255,255,255,0.1);
}

/* Cards & Dashboard */
.glass-card {
    background: var(--glass-bg); border: 1px solid var(--glass-border);
    backdrop-filter: blur(12px); border-radius: var(--card-radius); margin: 0 20px 20px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.2);
}
.dashboard-card { padding: 25px; text-align: center; }
.dashboard-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 15px; }
.date-big { font-size: 32px; font-weight: 700; }
.score-badge {
    background: rgba(47, 129, 247, 0.2); color: var(--accent); padding: 5px 12px;
    border-radius: 20px; font-weight: 600; font-size: 14px;
}
.score-bar-container { height: 8px; background: rgba(255,255,255,0.1); border-radius: 4px; overflow: hidden; margin: 15px 0 8px; }
.score-bar-fill { height: 100%; background: linear-gradient(90deg, #2f81f7, #a29bfe); transition: 1s cubic-bezier(0.4, 0, 0.2, 1); }
.score-details { display: flex; justify-content: space-between; font-size: 12px; color: var(--text-secondary); margin-bottom: 15px; }

/* === НОВОЕ: Widget Целей === */
.goals-widget { padding: 15px; display: flex; flex-direction: column; gap: 12px; min-height: 80px; }
.goal-item { cursor: pointer; border-bottom: 1px solid rgba(255,255,255,0.05); padding-bottom: 10px; margin-bottom: 4px; }
.goal-item:last-child { border-bottom: none; margin-bottom: 0; padding-bottom: 0; }
.goal-header { display: flex; justify-content: space-between; font-size: 13px; margin-bottom: 6px; }
.goal-name { font-weight: 600; font-size: 14px; }
.goal-progress-track { height: 6px; background: rgba(255,255,255,0.05); border-radius: 4px; overflow: hidden; }
.goal-progress-fill { height: 100%; background: linear-gradient(90deg, #2f81f7, #2ed573); transition: width 0.6s cubic-bezier(0.4, 0, 0.2, 1); }
.goal-meta { font-size: 11px; color: var(--text-secondary); margin-top: 5px; display: flex; justify-content: space-between; }


/* AI Summary */
.ai-summary-block {
    background: linear-gradient(135deg, rgba(47, 129, 247, 0.15) 0%, rgba(47, 129, 247, 0.05) 100%);
    border: 1px solid rgba(47, 129, 247, 0.3); border-radius: 16px; padding: 16px; margin: 15px 0; display: none;
}
.ai-title { font-size: 11px; font-weight: 700; color: #a29bfe; text-transform: uppercase; margin-bottom: 8px; letter-spacing: 0.5px; }
.ai-text { font-size: 13px; line-height: 1.5; color: #e6edf3; text-align: left; white-space: pre-line; }

.voice-btn {
    width: 100%;
    padding: 16px;
    background: rgba(47, 129, 247, 0.1);
    border: 1px solid rgba(47, 129, 247, 0.3);
    border-radius: 16px;
    color: #2f81f7;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    margin-top: 15px;
}
.voice-btn:active { background: rgba(47, 129, 247, 0.2); transform: scale(0.98); }

/* Activities List */
.section-label { padding: 0 25px 10px; font-size: 13px; color: var(--text-secondary); font-weight: 600; text-transform: uppercase; }
.activities-list { padding-bottom: 20px; }
.activity-item {
    background: var(--glass-bg); margin: 0 20px 10px; padding: 16px; border-radius: 16px;
    display: flex; align-items: center; gap: 15px; border: 1px solid var(--glass-border);
}
.cat-icon-box { width: 40px; height: 40px; border-radius: 12px; display: flex; align-items: center; justify-content: center; font-size: 20px; flex-shrink: 0; }
.act-info { flex: 1; }
.act-title { font-weight: 600; font-size: 15px; margin-bottom: 4px; }
.act-meta { font-size: 12px; color: var(--text-secondary); display: flex; gap: 8px; }
.act-score { font-weight: 600; color: var(--success); }

/* Bottom Nav */
.bottom-nav {
    position: fixed; bottom: 0; left: 0; width: 100%; height: 70px;
    background: rgba(15, 23, 42, 0.95); backdrop-filter: blur(10px);
    display: flex; justify-content: space-around; align-items: center; border-top: 1px solid var(--glass-border);
    z-index: 100; padding-bottom: 10px;
}
.nav-item { opacity: 0.5; transition: 0.3s; padding: 10px; }
.nav-item.active { opacity: 1; color: var(--accent); }

/* ДВЕ ПЛАВАЮЩИЕ КНОПКИ */
.fab-container { pointer-events: none; position: fixed; bottom: 85px; left:0; width:100%; z-index:90; height: 60px; }

.fab-right {
    position: absolute; right: 20px; bottom: 0; pointer-events: auto;
    width: 56px; height: 56px; background: var(--accent); border-radius: 50%; border: none; color: white;
    box-shadow: 0 4px 14px rgba(47, 129, 247, 0.4); cursor: pointer; display: flex; align-items: center; justify-content: center; transition: 0.2s;
}
.fab-left {
    position: absolute; left: 20px; bottom: 0; pointer-events: auto;
    width: 56px; height: 56px; background: #2ed573; border-radius: 50%; border: none; color: white;
    box-shadow: 0 4px 14px rgba(46, 213, 115, 0.4); cursor: pointer; display: flex; align-items: center; justify-content: center; transition: 0.2s; font-size: 30px;
}
.fab-right:active, .fab-left:active { transform: scale(0.9); }

/* === ANALYTICS PRO === */
.analytics-controls { display: flex; gap: 10px; margin-bottom: 20px; }
.analytics-btn { flex: 1; padding: 8px; border-radius: 8px; background: rgba(255,255,255,0.05); border: none; color: #888; font-size: 13px; cursor: pointer; }
.analytics-btn.active { background: #2f81f7; color: white; }
.analytics-range-label { text-align: center; color: var(--text-secondary); font-size: 14px; margin-bottom: 20px; font-weight: 500; }

/* График */
.bar-chart { display: flex; align-items: flex-end; justify-content: space-between; height: 180px; padding-top: 20px; }
.bar-col { display: flex; flex-direction: column; align-items: center; gap: 5px; flex: 1; }
.bar-fill { width: 8px; background: #2f81f7; border-radius: 4px; transition: height 0.5s; opacity: 0.7; }
.bar-fill.active { opacity: 1; background: #2ed573; box-shadow: 0 0 10px rgba(46, 213, 115, 0.4); }
.bar-label { font-size: 10px; color: #888; }

/* Отчеты */
.report-section-title { font-size: 12px; font-weight: 700; color: var(--text-secondary); margin-bottom: 12px; text-transform: uppercase; text-align: left; padding-left: 5px; }
.report-list { text-align: left; }
.report-category-group { margin-bottom: 15px; }
.report-cat-header { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; font-size: 14px; font-weight: 600; color: #fff; }
.report-cat-items { padding-left: 28px; }
.report-item { font-size: 13px; color: #cbd5e1; margin-bottom: 4px; display: flex; justify-content: space-between; }
.report-item-date { color: var(--text-secondary); font-size: 11px; margin-right: 8px; }

.ai-magic-btn {
    width: 100%; margin-top: 20px; background: linear-gradient(135deg, #6c5ce7, #a29bfe);
    border: none; color: white; padding: 15px; border-radius: 16px; font-weight: 700; font-size: 15px;
    box-shadow: 0 4px 15px rgba(108, 92, 231, 0.4); cursor: pointer;
}

/* Calendar & Settings */
.calendar-center-pill {
    position: fixed; left: 50%; bottom: 90px; transform: translateX(-50%); z-index: 1000;
    background: rgba(255, 255, 255, 0.1); backdrop-filter: blur(15px); border: 1px solid rgba(255, 255, 255, 0.2);
    color: white; padding: 10px 32px; border-radius: 40px; font-size: 14px; font-weight: 600;
    cursor: pointer; box-shadow: 0 10px 30px rgba(0,0,0,0.3); pointer-events: auto;
}
.calendar-header { display: flex; justify-content: space-between; align-items: center; padding: 10px 20px 20px; }
.calendar-header h2 { text-transform: capitalize; font-size: 20px; margin: 0; }
.nav-btn { background: rgba(255,255,255,0.1); border: none; color: #fff; width: 36px; height: 36px; border-radius: 12px; cursor: pointer; font-size: 18px; display: flex; align-items: center; justify-content: center; }
.calendar-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 8px; padding: 15px; }
.cal-day-header { text-align: center; font-size: 12px; color: var(--text-secondary); margin-bottom: 5px; }
.cal-day-cell {
    aspect-ratio: 1; border-radius: 10px; background: rgba(255,255,255,0.02);
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    font-size: 13px; cursor: pointer; position: relative; border: 1px solid transparent;
}
.cal-day-cell.has-data { border-color: rgba(47, 129, 247, 0.3); background: rgba(47, 129, 247, 0.1); }
.cal-score-dot { width: 4px; height: 4px; border-radius: 50%; background: var(--success); margin-top: 4px; }

/* Modals */
.modal-overlay {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0,0,0,0.6); backdrop-filter: blur(5px); z-index: 2000;
    display: none; align-items: flex-end; justify-content: center;
}
.modal-card {
    background: #1e293b; width: 100%; max-width: 600px;
    border-radius: 24px 24px 0 0; padding: 25px; animation: slideUp 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    box-shadow: 0 -10px 40px rgba(0,0,0,0.3);
}
@keyframes slideUp { from { transform: translateY(100%); } to { transform: translateY(0); } }
.modal-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 25px; }
.modal-header h3 { margin: 0; font-size: 20px; }
.close-icon { background: none; border: none; color: var(--text-secondary); font-size: 28px; cursor: pointer; }
.soft-label { display: block; font-size: 12px; color: var(--text-secondary); margin-bottom: 8px; margin-left: 4px; }
.soft-input {
    width: 100%; background: rgba(255,255,255,0.05); border: 1px solid rgba(255,255,255,0.1);
    color: white; padding: 14px; border-radius: 14px; font-size: 16px; margin-bottom: 20px; outline: none; font-family: inherit;
}
.category-grid { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 20px; }
.cat-tag {
    padding: 8px 16px; border-radius: 12px; background: rgba(255,255,255,0.05); border: 1px solid transparent;
    cursor: pointer; display: flex; align-items: center; gap: 6px; font-size: 14px; transition: 0.2s;
}
.cat-tag.active { background: rgba(47, 129, 247, 0.2); border-color: var(--accent); color: white; }
.cat-edit-row {
    display: flex; align-items: center; justify-content: space-between; padding: 16px;
    background: rgba(255, 255, 255, 0.03); border: 1px solid rgba(255, 255, 255, 0.08); border-radius: 16px; margin-bottom: 10px;
}
.cat-icon-wrapper {
    width: 40px; height: 40px; border-radius: 12px; background: rgba(255,255,255,0.1);
    display: flex; align-items: center; justify-content: center; font-size: 20px; margin-right: 12px; flex-shrink: 0;
}
.action-btn-solid { width: 100%; background: var(--accent); color: white; border: none; padding: 16px; border-radius: 16px; font-size: 16px; font-weight: 600; cursor: pointer; }
.soft-btn-small { width: 100%; background: rgba(255,255,255,0.05); border: 1px solid rgba(255,255,255,0.1); color: var(--text-secondary); padding: 14px; border-radius: 14px; cursor: pointer; }

/* ЗАДАЧИ */
.task-switch-container { display: flex; background: rgba(255,255,255,0.05); border: 1px solid rgba(255,255,255,0.1); border-radius: 14px; padding: 4px; margin: 15px 20px; }
.task-switch { flex: 1; text-align: center; padding: 10px; border-radius: 10px; font-size: 14px; color: var(--text-secondary); cursor: pointer; transition: 0.3s; font-weight: 500; }
.task-switch.active { background: rgba(255,255,255,0.1); color: #fff; box-shadow: 0 2px 8px rgba(0,0,0,0.2); }
.tasks-list { padding: 0 20px 100px 20px; }
.task-card {
    background: rgba(30, 41, 59, 0.6); backdrop-filter: blur(10px);
    border: 1px solid rgba(255,255,255,0.08); border-radius: 16px; padding: 16px; margin-bottom: 12px;
    border-left: 4px solid transparent; display: flex; flex-direction: column; gap: 10px; transition: transform 0.2s;
}
.task-header { display: flex; align-items: flex-start; gap: 12px; }
.task-checkbox {
    width: 24px; height: 24px; border: 2px solid var(--text-secondary); border-radius: 8px;
    display: flex; align-items: center; justify-content: center; cursor: pointer; flex-shrink: 0; transition: 0.2s; color: transparent;
}
.task-checkbox.checked { background: var(--success); border-color: var(--success); color: white; }
.task-title { font-size: 16px; color: #fff; flex: 1; line-height: 1.4; padding-top: 1px; }
.task-card.done .task-title { text-decoration: line-through; color: var(--text-secondary); }
.task-cat-badge { font-size: 11px; font-weight: 600; padding: 4px 8px; border-radius: 6px; background: rgba(255,255,255,0.05); white-space: nowrap; }

/* Segmented Control */
.segmented-control-styled { display: flex; background: rgba(255,255,255,0.05); padding: 4px; border-radius: 12px; width: 100%; }
.segmented-control-styled input { display: none; }
.segment-label { flex: 1; text-align: center; padding: 8px; font-size: 13px; color: #aaa; cursor: pointer; border-radius: 10px; transition: 0.2s; }
input:checked + .segment-label { background: #444; color: #fff; font-weight: 500; box-shadow: 0 2px 5px rgba(0,0,0,0.2); }
.archive-week-header {
    padding: 12px 15px; background: rgba(255,255,255,0.05); border-radius: 10px; margin-top: 15px;
    font-weight: 600; font-size: 14px; display: flex; justify-content: space-between; cursor: pointer;
}
.archive-tasks-list { display: none; padding-top: 10px; }
.archive-tasks-list.open { display: block; }

/* === НОВОЕ: Стили для кнопки добавления подэтапов === */
.add-btn-mini {
    width: 36px;
    height: 36px;
    background: #2f81f7; /* Синий цвет */
    border-radius: 8px;
    border: none;
    color: white;
    font-size: 20px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: 0.2s;
    flex-shrink: 0;
}
.add-btn-mini:active {
    transform: scale(0.95);
    background: #2563eb;
}

.soft-input-transparent {
    background: transparent;
    border: none;
    color: #fff;
    padding: 8px;
    font-size: 14px;
    width: 100%;
}
.soft-input-transparent:focus {
    outline: none;
}
.soft-input-transparent::placeholder {
    color: rgba(255,255,255,0.4);
}
/* Стили для кнопки "Цель" в шапке */
.goal-header-btn {
    background: rgba(47, 129, 247, 0.15); /* Полупрозрачный фон в цвет акцента */
    color: #2f81f7;                        /* Синий текст */
    border: 1px solid rgba(47, 129, 247, 0.3); /* Тонкая рамка */
    padding: 6px 16px;
    border-radius: 12px;                   /* Скругление как у остальных элементов */
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    text-transform: uppercase;             /* Немного стиля заголовков */
    letter-spacing: 0.5px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
}

.goal-header-btn:active {
    background: rgba(47, 129, 247, 0.25);
    transform: scale(0.96); /* Эффект нажатия */
}
