/*
 * tef.css — TEF Calculator page-specific styles
 *
 * Requires: calculator.css (shared base)
 * Extracted from: deploy/tef-calculator.php
 */

/* =============================================
   FORM GRID OVERRIDE (3 columns)
   ============================================= */

.tef-page .calc-form-grid {
    grid-template-columns: 1fr 1fr 1fr;
}

/* =============================================
   SUBMIT BUTTON OVERRIDE (extra top margin)
   ============================================= */

.tef-page .calc-submit {
    margin-top: 20px;
}

/* =============================================
   DIVIDER
   ============================================= */

.calc-divider {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: var(--spacing-sm) 0 var(--spacing-md);
    color: var(--color-text-tertiary);
    font-size: var(--text-small);
}
.calc-divider::before,
.calc-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--color-border);
}

/* =============================================
   CALORIE SLIDER SECTION
   ============================================= */

.calc-slider-section { margin-bottom: var(--spacing-md); text-align: center; }
.calc-slider-label { font-size: var(--text-small); color: var(--color-text-secondary); font-weight: 600; display: block; margin-bottom: var(--spacing-sm); }
.calc-slider-value { font-size: clamp(32px, 6vw, 48px); font-weight: 700; letter-spacing: -0.02em; background: var(--gradient-primary); -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text; line-height: 1.2; margin-bottom: 8px; }
.calc-slider-unit { font-size: var(--text-body); font-weight: 400; -webkit-text-fill-color: var(--color-text-tertiary); }
.calc-slider-labels { display: flex; justify-content: space-between; font-size: var(--text-caption); color: var(--color-text-tertiary); margin-top: 4px; }
.calc-slider-hint { font-size: var(--text-caption); color: var(--color-text-tertiary); margin-top: 8px; margin-bottom: var(--spacing-sm); }
.calc-slider-hint a { color: var(--color-accent-green); text-decoration: none; font-weight: 600; }
.calc-slider-hint a:hover { text-decoration: underline; }

/* =============================================
   RANGE INPUT
   ============================================= */

input[type="range"].calc-range { -webkit-appearance: none; width: 100%; height: 10px; border-radius: 5px; background: var(--color-bg-tertiary); border: 1px solid var(--color-border); outline: none; cursor: pointer; }
input[type="range"].calc-range::-webkit-slider-thumb { -webkit-appearance: none; width: 28px; height: 28px; border-radius: 50%; background: var(--gradient-primary); border: 2px solid #fff; box-shadow: var(--shadow-md); cursor: pointer; transition: transform var(--transition-fast); }
input[type="range"].calc-range::-webkit-slider-thumb:hover { transform: scale(1.15); }
input[type="range"].calc-range::-moz-range-thumb { width: 28px; height: 28px; border-radius: 50%; background: #4CAF50; border: 2px solid #fff; box-shadow: var(--shadow-md); cursor: pointer; }

/* =============================================
   DIET PROFILE CARDS
   ============================================= */

.calc-profiles-title { font-size: var(--text-small); font-weight: 600; color: var(--color-text-secondary); margin-bottom: 12px; }
.calc-profiles-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin-bottom: var(--spacing-md); }
.calc-profile { padding: 14px 12px; border-radius: var(--radius-sm); border: 1px solid var(--color-border); background: transparent; color: var(--color-text-secondary); cursor: pointer; transition: all var(--transition-fast); text-align: left; font-family: var(--font-primary); }
.calc-profile:hover { border-color: var(--color-accent-green); color: var(--color-text-primary); }
.calc-profile.active { border-color: var(--color-accent-green); background: rgba(76, 175, 80, 0.12); color: var(--color-accent-green); }
.calc-profile-header { display: flex; align-items: center; gap: 6px; margin-bottom: 4px; }
.calc-profile-emoji { font-size: 18px; line-height: 1; }
.calc-profile-name { font-size: var(--text-small); font-weight: 600; }
.calc-profile-ratio { font-size: 11px; color: var(--color-text-tertiary); font-weight: 600; font-family: var(--font-primary); margin-bottom: 2px; }
.calc-profile-desc { font-size: 11px; color: var(--color-text-tertiary); line-height: 1.3; }
.calc-profile-grams { font-size: 11px; color: var(--color-text-tertiary); margin-top: 6px; padding-top: 6px; border-top: 1px solid var(--color-border); font-weight: 500; }
.calc-profile.active .calc-profile-ratio,
.calc-profile.active .calc-profile-desc { color: rgba(76, 175, 80, 0.7); }
.calc-profile.active .calc-profile-grams { color: rgba(76, 175, 80, 0.8); border-top-color: rgba(76, 175, 80, 0.2); }

/* =============================================
   MANUAL TOGGLE
   ============================================= */

.calc-manual-toggle { font-size: var(--text-small); color: var(--color-text-tertiary); cursor: pointer; text-align: center; padding: 8px; transition: color var(--transition-fast); }
.calc-manual-toggle:hover { color: var(--color-text-secondary); }
.calc-manual-section { display: none; margin-top: var(--spacing-sm); }
.calc-manual-section.open { display: block; }

/* =============================================
   TEF TOTAL CARD
   ============================================= */

.tef-total-card {
    background: var(--color-bg-card);
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    border: 1px solid rgba(76, 175, 80, 0.3);
    border-radius: var(--radius-lg);
    padding: var(--spacing-xl);
    text-align: center;
    margin-bottom: var(--spacing-lg);
    background: rgba(76, 175, 80, 0.05);
}
.tef-total-value {
    font-size: clamp(42px, 8vw, 64px);
    font-weight: 700;
    letter-spacing: -0.02em;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    line-height: 1.1;
}
.tef-total-unit {
    font-size: var(--text-body);
    color: var(--color-text-tertiary);
    font-weight: 400;
    margin-top: 4px;
}
.tef-total-pct {
    font-size: var(--text-body-lg);
    color: var(--color-text-secondary);
    margin-top: 8px;
}

/* =============================================
   MACRO BREAKDOWN CARDS
   ============================================= */

.tef-breakdown {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: var(--spacing-md);
    margin-bottom: var(--spacing-lg);
}
.tef-macro-card {
    background: var(--color-bg-card);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    padding: var(--spacing-md);
    text-align: center;
}
.tef-macro-label {
    font-size: var(--text-caption);
    color: var(--color-text-tertiary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-weight: 600;
    margin-bottom: 8px;
}
.tef-macro-value {
    font-size: clamp(24px, 4vw, 32px);
    font-weight: 700;
    letter-spacing: -0.02em;
    margin-bottom: 4px;
}
.tef-macro-value.protein { color: #4CAF50; }
.tef-macro-value.carbs { color: #FF9800; }
.tef-macro-value.fat { color: #2196F3; }
.tef-macro-pct {
    font-size: var(--text-caption);
    color: var(--color-text-tertiary);
    margin-bottom: 12px;
}

/* =============================================
   TEF BARS
   ============================================= */

.tef-bar-track {
    height: 8px;
    background: var(--color-bg-tertiary);
    border-radius: 4px;
    overflow: hidden;
}
.tef-bar-fill {
    height: 100%;
    border-radius: 4px;
    transition: width 0.4s ease;
}
.tef-bar-fill.protein { background: #4CAF50; }
.tef-bar-fill.carbs { background: #FF9800; }
.tef-bar-fill.fat { background: #2196F3; }

/* =============================================
   FORMULA CARD
   ============================================= */

.tef-formula-card {
    background: var(--color-bg-card);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    padding: var(--spacing-md) var(--spacing-lg);
    margin-bottom: var(--spacing-lg);
}
.tef-formula-title {
    font-size: var(--text-small);
    font-weight: 600;
    color: var(--color-text-secondary);
    margin-bottom: 8px;
}
.tef-formula-line {
    font-family: 'SF Mono', 'Fira Code', 'Consolas', monospace;
    font-size: var(--text-small);
    color: var(--color-text-tertiary);
    line-height: 1.8;
}
.tef-formula-result {
    font-family: 'SF Mono', 'Fira Code', 'Consolas', monospace;
    font-size: var(--text-body);
    color: var(--color-accent-green);
    font-weight: 700;
    margin-top: 4px;
}

/* =============================================
   CROSS-LINK
   ============================================= */

.tef-crosslink {
    display: block;
    text-align: center;
    padding: 16px 24px;
    background: var(--color-bg-card);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    color: var(--color-accent-green);
    font-weight: 600;
    font-size: var(--text-body);
    text-decoration: none;
    transition: all var(--transition-fast);
    margin-bottom: var(--spacing-lg);
}
.tef-crosslink:hover {
    border-color: var(--color-accent-green);
    background: rgba(76, 175, 80, 0.06);
    transform: translateY(-1px);
}

/* =============================================
   CTA OVERRIDE (glass blur instead of gradient)
   ============================================= */

.tef-page .calc-cta {
    background: var(--color-bg-card);
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
}
.tef-page .calc-cta p {
    max-width: 500px;
}
.tef-page .calc-store-badges {
    flex-wrap: wrap;
}
.tef-page .calc-store-badges img {
    border-radius: 8px;
}

/* =============================================
   RESPONSIVE — TEF-SPECIFIC
   ============================================= */

@media (max-width: 768px) {
    .calc-profiles-grid { grid-template-columns: repeat(2, 1fr); }
    .tef-breakdown { grid-template-columns: 1fr; }
}
@media (max-width: 520px) {
    .tef-page .calc-store-badges { flex-direction: column; align-items: center; }
}
