/* calories.css — Kalori Takip Modülü */

/* Layout */
.cal-wrapper {
    display: flex;
    flex-direction: column;
    gap: 20px;
    padding-bottom: 40px;
}

/* Toolbar */
.cal-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px;
}

.cal-toolbar-left {
    display: flex;
    align-items: center;
    gap: 12px;
}

.cal-toolbar-left h2 {
    margin: 0;
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--text);
}

.cal-toolbar-left h2 i {
    color: #f97316;
}

.cal-date-filter {
    padding: 8px 14px;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    background: var(--bg-panel);
    color: var(--text);
    font-size: 0.85rem;
    cursor: pointer;
}

.cal-add-btn {
    padding: 10px 20px;
    border: none;
    border-radius: var(--radius-md);
    background: linear-gradient(135deg, #f97316, #f59e0b);
    color: white;
    font-weight: 700;
    font-size: 0.85rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.2s;
}

.cal-add-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(249, 115, 22, 0.3);
}

/* Summary Row */
.cal-summary-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 12px;
}

.cal-summary-card {
    background: var(--bg-panel);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 16px;
}

.cal-summary-icon {
    width: 48px;
    height: 48px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    flex-shrink: 0;
}

.cal-summary-info .cal-summary-value {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--text);
    line-height: 1.2;
}

.cal-summary-info .cal-summary-label {
    font-size: 0.78rem;
    color: var(--text-mute);
    font-weight: 600;
}

/* Goal Progress */
.cal-goal-bar {
    width: 100%;
    height: 8px;
    background: var(--bg-secondary);
    border-radius: 4px;
    margin-top: 8px;
    overflow: hidden;
}

.cal-goal-fill {
    height: 100%;
    border-radius: 4px;
    background: linear-gradient(90deg, #10b981, #f59e0b, #ef4444);
    transition: width 0.5s ease;
}

/* Form Panel */
.cal-form-panel {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.35s ease, opacity 0.3s;
    opacity: 0;
}

.cal-form-panel.open {
    max-height: 700px;
    opacity: 1;
}

.cal-form-inner {
    background: var(--bg-panel);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 24px;
}

.cal-form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 14px;
    margin-bottom: 16px;
}

.cal-form-field label {
    display: block;
    font-size: 0.78rem;
    font-weight: 700;
    color: var(--text-mute);
    text-transform: uppercase;
    letter-spacing: 0.3px;
    margin-bottom: 6px;
}

.cal-form-field label i {
    margin-right: 4px;
}

/* Image Upload */
.cal-photo-area {
    display: flex;
    align-items: center;
    gap: 12px;
}

.cal-photo-btn {
    padding: 10px 16px;
    border: 2px dashed var(--border);
    border-radius: var(--radius-md);
    background: var(--bg-secondary);
    color: var(--text-mute);
    cursor: pointer;
    font-size: 0.82rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.2s;
}

.cal-photo-btn:hover {
    border-color: var(--primary);
    color: var(--primary);
}

.cal-photo-preview {
    width: 56px;
    height: 56px;
    border-radius: var(--radius-md);
    object-fit: cover;
    border: 2px solid var(--border);
    display: none;
}

.cal-form-actions {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
}

.cal-form-cancel {
    padding: 10px 20px;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    background: var(--bg-secondary);
    color: var(--text);
    cursor: pointer;
    font-weight: 600;
    font-size: 0.85rem;
}

/* Charts */
.cal-charts-row {
    display: grid;
    grid-template-columns: 1fr 1.5fr;
    gap: 16px;
}

.cal-chart-card {
    background: var(--bg-panel);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 20px;
}

.cal-chart-title {
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.cal-chart-title i {
    color: #f97316;
}

.cal-chart-wrap {
    position: relative;
    height: 220px;
}

.cal-chart-wrap.wide {
    height: 200px;
}

/* Meal List */
.cal-list-section {
    background: var(--bg-panel);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 20px;
}

.cal-list-header {
    margin-bottom: 16px;
}

.cal-list-header h3 {
    margin: 0;
    font-size: 1rem;
    font-weight: 700;
    color: var(--text);
    display: flex;
    align-items: center;
    gap: 8px;
}

.cal-list-header h3 i {
    color: #f97316;
}

.cal-meal-item {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px;
    background: var(--bg-main);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    margin-bottom: 10px;
    transition: all 0.2s;
}

.cal-meal-item:hover {
    border-color: var(--primary-light);
    box-shadow: var(--shadow-sm);
}

.cal-meal-img {
    width: 52px;
    height: 52px;
    border-radius: var(--radius-md);
    object-fit: cover;
    flex-shrink: 0;
    border: 1px solid var(--border);
}

.cal-meal-img-placeholder {
    width: 52px;
    height: 52px;
    border-radius: var(--radius-md);
    background: rgba(249, 115, 22, 0.1);
    color: #f97316;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.3rem;
    flex-shrink: 0;
}

.cal-meal-info {
    flex: 1;
}

.cal-meal-name {
    font-weight: 700;
    color: var(--text);
    font-size: 0.95rem;
    display: flex;
    align-items: center;
    gap: 8px;
}

.cal-meal-type-badge {
    padding: 2px 8px;
    border-radius: 6px;
    font-size: 0.68rem;
    font-weight: 700;
    text-transform: uppercase;
}

.cal-meal-meta {
    font-size: 0.78rem;
    color: var(--text-mute);
    margin-top: 2px;
}

.cal-meal-kcal {
    font-size: 1.1rem;
    font-weight: 800;
    color: #f97316;
    white-space: nowrap;
}

.cal-meal-actions {
    display: flex;
    gap: 10px;
    align-items: center;
}

.cal-meal-actions i {
    cursor: pointer;
    padding: 6px;
    transition: color 0.2s;
}

/* Responsive */
@media (max-width: 768px) {
    .cal-toolbar {
        flex-direction: column;
        align-items: stretch;
    }

    .cal-summary-row {
        grid-template-columns: 1fr 1fr;
    }

    .cal-charts-row {
        grid-template-columns: 1fr;
    }

    .cal-form-grid {
        grid-template-columns: 1fr;
    }

    .cal-meal-item {
        flex-wrap: wrap;
    }
}

@media (max-width: 480px) {
    .cal-summary-row {
        grid-template-columns: 1fr;
    }
}