/* Calorie Calculator - calcount.org */
:root {
    --bg-primary: #f8fafc;
    --bg-secondary: #ffffff;
    --bg-tertiary: #f1f5f9;
    --text-primary: #1e293b;
    --text-secondary: #64748b;
    --text-muted: #94a3b8;
    --border-color: #e2e8f0;
    --accent-primary: #8b5cf6;
    --accent-secondary: #ec4899;
    --accent-gradient: linear-gradient(135deg, #8b5cf6 0%, #ec4899 100%);
    --success-color: #10b981;
    --warning-color: #f59e0b;
    --error-color: #ef4444;
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    --radius-sm: 6px;
    --radius-md: 12px;
    --radius-lg: 16px;
}

[data-theme="dark"] {
    --bg-primary: #0f172a;
    --bg-secondary: #1e293b;
    --bg-tertiary: #334155;
    --text-primary: #f1f5f9;
    --text-secondary: #94a3b8;
    --text-muted: #64748b;
    --border-color: #334155;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
}

.theme-toggle {
    position: fixed; bottom: 20px; right: 20px;
    width: 50px; height: 50px; border-radius: 50%;
    border: none; background: var(--bg-secondary);
    box-shadow: var(--shadow-md); cursor: pointer; z-index: 1000;
    display: flex; align-items: center; justify-content: center;
}
.theme-toggle:hover { transform: scale(1.1); }
.sun-icon, .moon-icon { font-size: 1.5rem; position: absolute; transition: opacity 0.3s; }
.moon-icon { opacity: 0; }
[data-theme="dark"] .sun-icon { opacity: 0; }
[data-theme="dark"] .moon-icon { opacity: 1; }

.container { max-width: 800px; margin: 0 auto; padding: 40px 20px; }

header { text-align: center; margin-bottom: 40px; }
h1 {
    font-size: 2.5rem; font-weight: 800;
    background: var(--accent-gradient);
    -webkit-background-clip: text; -webkit-text-fill-color: transparent;
    margin-bottom: 10px;
}
.subtitle { color: var(--text-secondary); font-size: 1.1rem; }

.calculator-card {
    background: var(--bg-secondary);
    border-radius: var(--radius-lg);
    padding: 30px;
    box-shadow: var(--shadow-md);
}

.form-group { margin-bottom: 20px; }
.form-group label { display: block; font-weight: 600; margin-bottom: 8px; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }

.radio-group { display: flex; gap: 15px; }
.radio-option { flex: 1; cursor: pointer; }
.radio-option input { display: none; }
.radio-label {
    display: block; padding: 12px 20px; text-align: center;
    border: 2px solid var(--border-color); border-radius: var(--radius-md);
    transition: all 0.2s; font-weight: 500;
}
.radio-option input:checked + .radio-label {
    border-color: var(--accent-primary);
    background: rgba(139, 92, 246, 0.1);
    color: var(--accent-primary);
}

.goal-options { display: flex; gap: 10px; }
.goal-option { flex: 1; cursor: pointer; }
.goal-option input { display: none; }
.goal-label {
    display: flex; flex-direction: column; align-items: center;
    padding: 15px; border: 2px solid var(--border-color);
    border-radius: var(--radius-md); transition: all 0.2s;
}
.goal-option input:checked + .goal-label {
    border-color: var(--accent-primary);
    background: rgba(139, 92, 246, 0.1);
}
.goal-icon { font-size: 1.5rem; margin-bottom: 5px; }
.goal-text { font-size: 0.85rem; font-weight: 600; color: var(--text-primary); }

.input-with-unit { display: flex; gap: 10px; }
.input-with-unit input { flex: 1; }
.input-with-unit select { width: 70px; }

input[type="number"], select {
    width: 100%; padding: 12px 15px;
    border: 2px solid var(--border-color);
    border-radius: var(--radius-sm);
    font-size: 1rem;
    background: var(--bg-primary);
    color: var(--text-primary);
}
input:focus, select:focus { outline: none; border-color: var(--accent-primary); }

.btn {
    padding: 15px 24px; border: none; border-radius: var(--radius-sm);
    font-size: 1.1rem; font-weight: 600; cursor: pointer;
}
.btn-primary { background: var(--accent-gradient); color: white; }
.btn-primary:hover { opacity: 0.9; transform: translateY(-2px); }
.calculate-btn { width: 100%; margin-top: 10px; }

.results { display: none; margin-top: 30px; padding-top: 30px; border-top: 1px solid var(--border-color); }
.results h2 { text-align: center; margin-bottom: 20px; }

.result-main {
    text-align: center; padding: 30px;
    background: var(--accent-gradient);
    border-radius: var(--radius-md); color: white; margin-bottom: 25px;
}
.result-value { font-size: 3.5rem; font-weight: 800; }
.result-unit { font-size: 1rem; opacity: 0.9; }
.result-goal { font-size: 0.9rem; opacity: 0.8; margin-top: 5px; }

.breakdown h3, .weekly-projection h3, .meal-plan h3 {
    font-size: 1rem; margin-bottom: 15px; color: var(--text-primary);
}

.breakdown-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 15px; }
.breakdown-item {
    text-align: center; padding: 15px;
    background: var(--bg-tertiary); border-radius: var(--radius-md);
}
.breakdown-item.highlight { background: rgba(139, 92, 246, 0.15); }
.breakdown-label { display: block; font-size: 0.8rem; color: var(--text-secondary); margin-bottom: 5px; }
.breakdown-value { display: block; font-size: 1.3rem; font-weight: 700; color: var(--text-primary); }
.breakdown-desc { font-size: 0.75rem; color: var(--text-muted); }

.weekly-projection {
    background: var(--bg-tertiary); padding: 20px;
    border-radius: var(--radius-md); margin: 20px 0;
}
.weekly-projection p { color: var(--text-secondary); }

.meals-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.meal-item {
    text-align: center; padding: 15px;
    background: var(--bg-tertiary); border-radius: var(--radius-md);
}
.meal-icon { font-size: 1.5rem; display: block; margin-bottom: 5px; }
.meal-name { display: block; font-size: 0.8rem; color: var(--text-secondary); margin-bottom: 5px; }
.meal-calories { display: block; font-weight: 700; color: var(--text-primary); }

.trust-badges {
    display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 20px; margin: 50px 0;
}
.badge {
    text-align: center; padding: 20px 15px;
    background: var(--bg-secondary); border-radius: var(--radius-md);
}
.badge-icon { font-size: 2rem; display: block; margin-bottom: 10px; }
.badge-text { display: block; font-weight: 700; margin-bottom: 5px; }
.badge-desc { font-size: 0.85rem; color: var(--text-secondary); }

.faq-section { margin: 50px 0; }
.faq-section h2 { text-align: center; font-size: 1.8rem; margin-bottom: 30px; }
.faq-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 20px; }
.faq-item { background: var(--bg-secondary); padding: 25px; border-radius: var(--radius-md); }
.faq-item h3 { font-size: 1rem; margin-bottom: 12px; }
.faq-item p { color: var(--text-secondary); font-size: 0.9rem; }

footer { text-align: center; padding: 40px 20px; border-top: 1px solid var(--border-color); }
footer p { color: var(--text-secondary); font-size: 0.9rem; margin-bottom: 10px; }
footer a { color: var(--accent-primary); text-decoration: none; }
.copyright { font-size: 0.8rem; color: var(--text-muted); }

@media (max-width: 768px) {
    h1 { font-size: 2rem; }
    .form-row, .breakdown-grid, .meals-grid { grid-template-columns: 1fr; }
    .goal-options { flex-direction: column; }
    .result-value { font-size: 2.5rem; }
}
