/* TDEE Calculator - calculatetdee.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);
    --shadow-lg: 0 10px 15px -3px 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;
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.5);
}

*, *::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;
    min-height: 100vh;
}

.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;
    transition: transform 0.2s;
}

.theme-toggle:hover { transform: scale(1.1); }

.sun-icon, .moon-icon {
    font-size: 1.5rem;
    position: absolute;
    transition: opacity 0.3s, transform 0.3s;
}

.moon-icon { opacity: 0; transform: rotate(-90deg); }
[data-theme="dark"] .sun-icon { opacity: 0; transform: rotate(90deg); }
[data-theme="dark"] .moon-icon { opacity: 1; transform: rotate(0deg); }

.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;
    background-clip: text;
    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;
    color: var(--text-primary);
}

.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);
}

.input-with-unit {
    display: flex;
    align-items: center;
    gap: 10px;
}

.input-with-unit input {
    flex: 1;
}

.unit {
    color: var(--text-secondary);
    font-size: 0.9rem;
    min-width: 40px;
}

.input-with-toggle {
    display: flex;
    gap: 10px;
}

.input-with-toggle input {
    flex: 1;
}

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);
    transition: border-color 0.2s;
}

input[type="number"]:focus, select:focus {
    outline: none;
    border-color: var(--accent-primary);
}

.unit-toggle {
    display: flex;
    background: var(--bg-tertiary);
    border-radius: var(--radius-sm);
    overflow: hidden;
}

.unit-btn {
    padding: 10px 15px;
    border: none;
    background: transparent;
    color: var(--text-secondary);
    cursor: pointer;
    font-weight: 500;
    transition: all 0.2s;
}

.unit-btn.active {
    background: var(--accent-primary);
    color: white;
}

.feet-inches {
    display: flex;
    gap: 10px;
    margin-top: 10px;
}

.feet-inches input {
    flex: 1;
}

.calculate-btn {
    width: 100%;
    padding: 15px;
    font-size: 1.1rem;
    margin-top: 10px;
}

.btn {
    padding: 12px 24px;
    border: none;
    border-radius: var(--radius-sm);
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-primary {
    background: var(--accent-gradient);
    color: white;
}

.btn-primary:hover {
    opacity: 0.9;
    transform: translateY(-2px);
}

/* Results */
.results {
    display: none;
    margin-top: 30px;
    padding-top: 30px;
    border-top: 1px solid var(--border-color);
}

.results h2 {
    text-align: center;
    margin-bottom: 25px;
    color: var(--text-primary);
}

.result-main {
    text-align: center;
    padding: 30px;
    background: var(--accent-gradient);
    border-radius: var(--radius-md);
    color: white;
    margin-bottom: 20px;
}

.result-label {
    font-size: 0.9rem;
    opacity: 0.9;
    margin-bottom: 5px;
}

.result-value {
    font-size: 3.5rem;
    font-weight: 800;
    line-height: 1.1;
}

.result-unit {
    font-size: 1rem;
    opacity: 0.9;
}

.result-secondary {
    background: var(--bg-tertiary);
    border-radius: var(--radius-md);
    padding: 20px;
    margin-bottom: 25px;
}

.result-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
}

.item-label {
    color: var(--text-secondary);
}

.item-value {
    font-weight: 700;
    font-size: 1.3rem;
    color: var(--text-primary);
}

.item-unit {
    color: var(--text-muted);
    font-size: 0.85rem;
}

.calorie-goals h3, .macros-section h3 {
    font-size: 1.1rem;
    margin-bottom: 15px;
    color: var(--text-primary);
}

.goals-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 15px;
}

.goal-card {
    text-align: center;
    padding: 20px 15px;
    border-radius: var(--radius-md);
    background: var(--bg-tertiary);
}

.goal-card.lose { border-left: 4px solid var(--error-color); }
.goal-card.maintain { border-left: 4px solid var(--success-color); }
.goal-card.gain { border-left: 4px solid var(--warning-color); }

.goal-label {
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--text-primary);
}

.goal-subtitle {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-bottom: 8px;
}

.goal-value {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--text-primary);
}

.goal-unit {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.macros-section {
    margin-top: 25px;
}

.macros-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 15px;
}

.macro-item {
    text-align: center;
    padding: 15px;
    border-radius: var(--radius-md);
    background: var(--bg-tertiary);
}

.macro-item.protein { border-top: 3px solid #ef4444; }
.macro-item.carbs { border-top: 3px solid #3b82f6; }
.macro-item.fats { border-top: 3px solid #f59e0b; }

.macro-label {
    display: block;
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-bottom: 5px;
}

.macro-value {
    display: block;
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--text-primary);
}

.macro-percent {
    font-size: 0.75rem;
    color: var(--text-muted);
}

/* Trust Badges */
.trust-badges {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 20px;
    margin: 50px 0;
}

.badge {
    text-align: center;
    padding: 25px 15px;
    background: var(--bg-secondary);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
}

.badge-icon { font-size: 2rem; display: block; margin-bottom: 10px; }
.badge-text { display: block; font-weight: 700; color: var(--text-primary); margin-bottom: 5px; }
.badge-desc { font-size: 0.85rem; color: var(--text-secondary); }

/* Info Section */
.info-section {
    background: var(--bg-secondary);
    border-radius: var(--radius-lg);
    padding: 30px;
    margin: 40px 0;
    box-shadow: var(--shadow-sm);
}

.info-section h2 {
    font-size: 1.5rem;
    margin-bottom: 15px;
    color: var(--text-primary);
}

.info-section p {
    color: var(--text-secondary);
    margin-bottom: 15px;
}

.info-section ul {
    margin-left: 20px;
    color: var(--text-secondary);
}

.info-section li {
    margin-bottom: 8px;
}

/* FAQ */
.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(300px, 1fr));
    gap: 20px;
}

.faq-item {
    background: var(--bg-secondary);
    padding: 25px;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
}

.faq-item h3 {
    font-size: 1rem;
    color: var(--text-primary);
    margin-bottom: 12px;
}

.faq-item p {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

/* Footer */
footer {
    text-align: center;
    padding: 40px 20px;
    margin-top: 40px;
    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);
}

/* Responsive */
@media (max-width: 768px) {
    h1 { font-size: 2rem; }
    .container { padding: 20px 15px; }
    .goals-grid, .macros-grid { grid-template-columns: 1fr; }
    .goal-card, .macro-item { padding: 15px; }
    .result-value { font-size: 2.5rem; }
    .radio-group { flex-direction: column; }
}
