/* ===== СТИЛИ ДЛЯ РАЗДЕЛА ПИТАНИЯ ===== */

/* Контейнер и табы */
.nutrition-container {
    background: white;
    border-radius: 15px;
    overflow: hidden;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
}

.nutrition-tabs {
    display: flex;
    background: #f8f9fa;
    border-bottom: 1px solid #e0e0e0;
    overflow-x: auto;
}

.nutrition-tab {
    padding: 15px 20px;
    background: none;
    border: none;
    font-family: 'Montserrat', sans-serif;
    font-weight: 500;
    font-size: 0.95rem;
    color: #666;
    cursor: pointer;
    transition: all 0.3s ease;
    white-space: nowrap;
    border-bottom: 3px solid transparent;
}

.nutrition-tab:hover {
    background: #f0f0f0;
    color: #667eea;
}

.nutrition-tab.active {
    background: white;
    color: #667eea;
    border-bottom: 3px solid #667eea;
}

.nutrition-tab-content {
    display: none;
    padding: 25px;
    animation: fadeIn 0.3s ease;
}

.nutrition-tab-content.active {
    display: block;
}

/* Калькулятор калорий */
.calculator-container {
    max-width: 800px;
    margin: 0 auto;
}

.calculator-form {
    background: #f8f9fa;
    border-radius: 12px;
    padding: 25px;
    margin-bottom: 25px;
}

.form-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 20px;
    margin-bottom: 20px;
}

.form-group {
    margin-bottom: 15px;
    position: relative;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: #444;
    font-size: 0.9rem;
}

.form-group input,
.form-group select {
    width: 100%;
    padding: 12px 15px;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    font-size: 1rem;
    font-family: 'Roboto', sans-serif;
    background: white;
}

.form-group input:focus,
.form-group select:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.form-group .unit {
    position: absolute;
    right: 15px;
    top: 50%;
    transform: translateY(-50%);
    color: #666;
    font-size: 0.9rem;
}

.calculator-results {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 12px;
    padding: 30px;
    color: white;
    animation: slideInUp 0.5s ease;
}

@keyframes slideInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.calorie-result {
    text-align: center;
    margin-bottom: 30px;
}

.calorie-value {
    font-size: 3.5rem;
    font-weight: 800;
    line-height: 1;
    margin-bottom: 5px;
    text-shadow: 0 2px 10px rgba(0,0,0,0.2);
}

.calorie-label {
    font-size: 1rem;
    opacity: 0.9;
}

.macros-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 15px;
    margin-bottom: 25px;
}

@media (max-width: 768px) {
    .macros-grid {
        grid-template-columns: 1fr;
    }
}

.macro-card {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 15px;
    transition: transform 0.3s ease;
}

.macro-card:hover {
    transform: translateY(-3px);
    background: rgba(255, 255, 255, 0.15);
}

.macro-card.protein {
    border-left: 4px solid #4CAF50;
}

.macro-card.carbs {
    border-left: 4px solid #FF9800;
}

.macro-card.fats {
    border-left: 4px solid #2196F3;
}

.macro-icon {
    width: 40px;
    height: 40px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
}

.macro-info {
    flex: 1;
}

.macro-value {
    display: block;
    font-size: 1.3rem;
    font-weight: 700;
    margin-bottom: 2px;
}

.macro-label {
    font-size: 0.9rem;
    opacity: 0.9;
}

.macro-percent {
    display: block;
    font-size: 0.85rem;
    opacity: 0.8;
    margin-top: 2px;
}

.goal-buttons {
    display: flex;
    gap: 15px;
    justify-content: center;
}

/* Трекер веса */
.tracker-container {
    max-width: 1200px;
    margin: 0 auto;
}

.tracker-content {
    display: grid;
    grid-template-columns: 1fr 2fr;
    gap: 30px;
    margin-bottom: 30px;
}

@media (max-width: 992px) {
    .tracker-content {
        grid-template-columns: 1fr;
    }
}

.weight-form {
    background: #f8f9fa;
    border-radius: 12px;
    padding: 25px;
}

.weight-chart-container {
    background: white;
    border-radius: 12px;
    padding: 25px;
    box-shadow: 0 3px 15px rgba(0,0,0,0.05);
    border: 1px solid #e0e0e0;
}

.chart-placeholder {
    height: 250px;
    background: #f8f9fa;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    margin-bottom: 20px;
}

.chart-message {
    color: #666;
    font-style: italic;
}

.chart-legend {
    position: absolute;
    bottom: 15px;
    right: 15px;
    display: flex;
    gap: 15px;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.85rem;
    color: #666;
}

.legend-color {
    width: 12px;
    height: 12px;
    border-radius: 2px;
}

.stats-overview {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 15px;
}

@media (max-width: 768px) {
    .stats-overview {
        grid-template-columns: repeat(2, 1fr);
    }
}

.stat-item {
    background: #f8f9fa;
    border-radius: 8px;
    padding: 15px;
    text-align: center;
}

.stat-label {
    display: block;
    font-size: 0.85rem;
    color: #666;
    margin-bottom: 5px;
}

.stat-value {
    display: block;
    font-size: 1.3rem;
    font-weight: 700;
    color: #333;
}

.measurements-history {
    background: white;
    border-radius: 12px;
    padding: 25px;
    box-shadow: 0 3px 15px rgba(0,0,0,0.05);
    border: 1px solid #e0e0e0;
}

.history-table-container {
    overflow-x: auto;
    margin-top: 15px;
}

.history-table {
    width: 100%;
    border-collapse: collapse;
}

.history-table th {
    background: #f8f9fa;
    padding: 12px 15px;
    text-align: left;
    font-weight: 600;
    color: #333;
    border-bottom: 2px solid #e0e0e0;
    font-size: 0.9rem;
}

.history-table td {
    padding: 12px 15px;
    border-bottom: 1px solid #e0e0e0;
    font-size: 0.9rem;
}

.history-table tbody tr:hover {
    background: #f8f9fa;
}

/* Планировщик питания */
.planner-container {
    max-width: 1400px;
    margin: 0 auto;
}

.planner-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    flex-wrap: wrap;
    gap: 15px;
}

.planner-actions {
    display: flex;
    gap: 10px;
}

.meal-plan-week {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 15px;
    margin: 20px 0;
}

@media (max-width: 1200px) {
    .meal-plan-week {
        grid-template-columns: repeat(4, 1fr);
    }
}

@media (max-width: 992px) {
    .meal-plan-week {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 768px) {
    .meal-plan-week {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 576px) {
    .meal-plan-week {
        grid-template-columns: 1fr;
    }
}

.day-meal-plan {
    background: white;
    border: 1px solid #e0e0e0;
    border-radius: 10px;
    overflow: hidden;
    transition: all 0.3s ease;
}

.day-meal-plan:hover {
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
    transform: translateY(-3px);
}

.day-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 15px;
    text-align: center;
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
}

.day-header h4 {
    margin: 0;
    font-size: 1rem;
    font-weight: 600;
}

.day-date {
    font-size: 0.85rem;
    opacity: 0.9;
    margin-top: 5px;
}

.meal-category {
    padding: 15px;
    border-bottom: 1px solid #f0f0f0;
}

.meal-category:last-child {
    border-bottom: none;
}

.category-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.category-header h5 {
    margin: 0;
    font-size: 0.9rem;
    color: #333;
    font-weight: 600;
}

.add-meal-btn {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: #667eea;
    color: white;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
    transition: all 0.3s ease;
}

.add-meal-btn:hover {
    background: #764ba2;
    transform: scale(1.1);
}

.meal-item {
    background: #f8f9fa;
    border-radius: 6px;
    padding: 10px;
    margin-bottom: 8px;
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
}

.meal-item:hover {
    background: #f0f0f0;
}

.meal-name {
    font-weight: 500;
    margin-bottom: 4px;
}

.meal-macros {
    display: flex;
    justify-content: space-between;
    font-size: 0.8rem;
    color: #666;
}

.meal-calories {
    font-weight: 600;
    color: #333;
}

.empty-meal {
    color: #999;
    font-style: italic;
    font-size: 0.85rem;
    padding: 10px;
    text-align: center;
}

.day-summary {
    background: #f8f9fa;
    padding: 10px 15px;
    border-top: 1px solid #e0e0e0;
    font-size: 0.85rem;
}

.day-calories {
    display: flex;
    justify-content: space-between;
    font-weight: 600;
}

.week-summary {
    background: white;
    border-radius: 12px;
    padding: 20px;
    margin-top: 25px;
    box-shadow: 0 3px 15px rgba(0,0,0,0.05);
    border: 1px solid #e0e0e0;
}

.summary-stats {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 15px;
    margin-top: 15px;
}

@media (max-width: 992px) {
    .summary-stats {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 576px) {
    .summary-stats {
        grid-template-columns: repeat(2, 1fr);
    }
}

.summary-stat {
    background: #f8f9fa;
    border-radius: 8px;
    padding: 15px;
    text-align: center;
}

/* Трекер воды */
.water-tracker {
    max-width: 800px;
    margin: 0 auto;
}

.water-goal {
    background: #e3f2fd;
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 30px;
}

.water-slider {
    margin-top: 15px;
}

.water-slider input[type="range"] {
    width: 100%;
    height: 8px;
    border-radius: 4px;
    background: #bbdefb;
    outline: none;
}

.slider-labels {
    display: flex;
    justify-content: space-between;
    margin-top: 8px;
    font-size: 0.85rem;
    color: #666;
}

.water-counter {
    text-align: center;
    margin-bottom: 40px;
}

.water-glass-container {
    display: inline-block;
    position: relative;
    margin-bottom: 30px;
}

.water-glass {
    width: 120px;
    height: 200px;
    background: linear-gradient(to right, #bbdefb, #e3f2fd);
    border: 3px solid #2196F3;
    border-radius: 0 0 40px 40px;
    position: relative;
    overflow: hidden;
}

.glass-fill {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(to top, #2196F3, #64b5f6);
    transition: height 0.5s ease;
}

.water-percentage {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 2rem;
    font-weight: 700;
    color: #1565c0;
    text-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.water-buttons {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin-bottom: 25px;
}

.water-btn {
    padding: 12px 20px;
    border: none;
    border-radius: 8px;
    font-family: 'Montserrat', sans-serif;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.water-btn.small {
    background: #bbdefb;
    color: #1565c0;
}

.water-btn.medium {
    background: #64b5f6;
    color: white;
}

.water-btn.large {
    background: #2196F3;
    color: white;
}

.water-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 5px 15px rgba(33, 150, 243, 0.3);
}

.water-stats {
    display: flex;
    justify-content: center;
    gap: 30px;
}

.water-stat {
    text-align: center;
}

.water-stat .stat-value {
    display: block;
    font-size: 1.8rem;
    font-weight: 700;
    color: #2196F3;
    margin-bottom: 5px;
}

.water-stat .stat-label {
    display: block;
    font-size: 0.9rem;
    color: #666;
}

.water-history {
    background: white;
    border-radius: 12px;
    padding: 25px;
    box-shadow: 0 3px 15px rgba(0,0,0,0.05);
    border: 1px solid #e0e0e0;
}

.history-bars {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    height: 150px;
    margin-top: 20px;
    padding: 0 10px;
}

.water-day-bar {
    flex: 1;
    margin: 0 5px;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.bar-container {
    width: 30px;
    height: 120px;
    background: #e3f2fd;
    border-radius: 4px 4px 0 0;
    position: relative;
    overflow: hidden;
}

.bar-fill {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: #2196F3;
    transition: height 0.5s ease;
}

.bar-label {
    margin-top: 8px;
    font-size: 0.85rem;
    color: #666;
}

.bar-value {
    margin-top: 5px;
    font-weight: 600;
    font-size: 0.9rem;
}

/* Стили для питания */
.meal-plan {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
    margin-bottom: 20px;
}

.meal-card {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    color: white;
    padding: 20px;
    border-radius: 12px;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.1);
}

.meal-card h3 {
    margin-bottom: 10px;
    font-family: 'Montserrat', sans-serif;
    font-size: 1.1rem;
}

.calories {
    display: inline-block;
    background: rgba(255, 255, 255, 0.2);
    padding: 4px 12px;
    border-radius: 15px;
    margin-top: 8px;
    font-size: 0.85rem;
}