/* calc/assets/css/calculators/christmas-tree.css */

/* --- Christmas Theme --- */
:root {
    --tree-green: #166534;
    --tree-bg: #F0FDF4;
    --tree-accent: #15803D;
    
    --gold: #F59E0B;
    --red: #DC2626;
    --silver: #94A3B8;
}

.calc-header { margin-bottom: 32px; }
.subtitle { color: var(--text-secondary); margin-top: 8px; }

/* Grid Layout */
.calc-grid { display: grid; grid-template-columns: 1fr; gap: 24px; align-items: start; }
@media (min-width: 900px) { .calc-grid { grid-template-columns: 1fr 1fr; } }

/* Inputs */
.calc-inputs { padding: 24px; }
.input-group { margin-bottom: 24px; }
.label-row { display: flex; justify-content: space-between; margin-bottom: 12px; }
.input-group label { font-size: 14px; font-weight: 600; color: var(--text-primary); }
.range-val { font-weight: 700; color: var(--tree-accent); }

/* Custom Range Slider */
input[type=range] { -webkit-appearance: none; width: 100%; background: transparent; }
input[type=range]::-webkit-slider-thumb {
    -webkit-appearance: none; height: 24px; width: 24px; border-radius: 50%;
    background: var(--tree-accent); cursor: pointer; margin-top: -10px;
    box-shadow: 0 2px 6px rgba(0,0,0,0.2); border: 2px solid #fff;
}
input[type=range]::-webkit-slider-runnable-track {
    width: 100%; height: 4px; cursor: pointer; background: #E5E7EB; border-radius: 2px;
}
.range-steps { display: flex; justify-content: space-between; margin-top: 8px; font-size: 11px; color: var(--text-secondary); }

/* Select & Radios */
.input-wrapper { position: relative; }
.input-wrapper select {
    width: 100%; padding: 14px; padding-right: 40px;
    font-size: 16px; font-weight: 500;
    border: 1px solid #E5E7EB; border-radius: 12px;
    outline: none; transition: border 0.2s; appearance: none; background: #fff;
}
.input-wrapper select:focus { border-color: var(--tree-accent); box-shadow: 0 0 0 3px rgba(21, 128, 61, 0.1); }
.select-arrow { position: absolute; right: 14px; top: 50%; transform: translateY(-50%); pointer-events: none; color: var(--text-secondary); display: flex; }

.style-selector { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 10px; }
.style-option input { display: none; }
.style-box {
    display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px;
    border: 2px solid #E5E7EB; border-radius: 12px; padding: 12px 4px;
    cursor: pointer; transition: all 0.2s; color: var(--text-secondary);
}
.style-icon { font-size: 20px; line-height: 1; }
.style-name { font-size: 11px; font-weight: 600; }
.style-option input:checked + .style-box {
    border-color: var(--tree-accent); background: var(--tree-bg); color: var(--tree-accent);
}

/* --- VISUALIZER --- */
.tree-visualizer {
    background: radial-gradient(circle at 50% 10%, #F8FAFC 0%, #E2E8F0 100%);
    border: 1px solid rgba(0,0,0,0.06);
    border-radius: 20px; padding: 30px; margin-bottom: 20px;
    position: relative; overflow: hidden; min-height: 320px;
    display: flex; align-items: flex-end; justify-content: center;
}

.tree-container {
    position: relative; 
    /* ЦЕНТРИРОВАНИЕ ЕЛКИ */
    width: auto; 
    transition: all 0.3s ease;
    display: flex; flex-direction: column; align-items: center; 
    z-index: 2;
    margin: 0 auto;
}

.tree-star {
    font-size: 32px; color: #FCD34D; text-shadow: 0 2px 4px rgba(0,0,0,0.1);
    margin-bottom: -5px; z-index: 5; animation: float 3s ease-in-out infinite;
}
@keyframes float { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-5px); } }

.tree-body {
    width: 0; height: 0;
    border-left: 80px solid transparent;
    border-right: 80px solid transparent;
    border-bottom: 200px solid #15803D;
    position: relative;
    filter: drop-shadow(0 10px 20px rgba(0,0,0,0.1));
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}
.tree-body::after {
    content: ''; position: absolute; left: -80px; top: 0;
    border-left: 80px solid transparent; border-right: 80px solid transparent; 
    border-bottom: 200px solid rgba(255,255,255,0.15);
    pointer-events: none;
}

.tree-stump {
    width: 30px; height: 20px; background: #78350F; margin-top: 0; border-radius: 0 0 4px 4px;
}

.vis-bauble {
    position: absolute; border-radius: 50%;
    box-shadow: 1px 1px 2px rgba(0,0,0,0.2);
}
.vis-bauble.type-large { width: 12px; height: 12px; background: #DC2626; z-index: 4; }
.vis-bauble.type-medium { width: 8px; height: 8px; background: #FCD34D; z-index: 3; }
.vis-bauble.type-small { width: 5px; height: 5px; background: #E2E8F0; z-index: 3; }

.tree-stats-overlay {
    position: absolute; top: 20px; left: 20px; right: 20px;
    display: flex; justify-content: space-between; z-index: 10;
}
.overlay-item { color: var(--text-primary); display: flex; flex-direction: column; }
.overlay-val { font-size: 24px; font-weight: 800; }
.overlay-label { font-size: 11px; opacity: 0.7; text-transform: uppercase; letter-spacing: 0.05em; font-weight: 700; }

/* Results Grid */
.results-grid { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 12px; margin-bottom: 20px; }
.result-mini-card {
    background: #fff; padding: 12px; border-radius: 12px;
    border: 1px solid rgba(0,0,0,0.04); box-shadow: var(--shadow-soft);
    display: flex; flex-direction: column; align-items: center; text-align: center; gap: 8px;
}
.mini-icon {
    width: 32px; height: 32px; border-radius: 50%; background: #F3F4F6;
    display: flex; align-items: center; justify-content: center; font-size: 16px; color: var(--text-secondary);
}
.icon-lights { background: #FEF3C7; color: #D97706; }
.icon-tinsel { background: #E0E7FF; color: #4F46E5; }
.icon-star { background: #FEE2E2; color: #DC2626; }

.mini-data { display: flex; flex-direction: column; }
.mini-label { font-size: 10px; color: var(--text-secondary); text-transform: uppercase; font-weight: 700; margin-bottom: 2px; }
.mini-value { font-size: 14px; font-weight: 800; color: var(--text-primary); }

/* Baubles Breakdown */
.card--baubles { background: #fff; padding: 20px; border-radius: 16px; border: 1px solid rgba(0,0,0,0.04); box-shadow: var(--shadow-soft); }
.card--baubles h3 { font-size: 15px; margin: 0 0 16px 0; font-weight: 700; }
.baubles-breakdown { display: flex; justify-content: space-around; align-items: flex-end; }
.bauble-group { display: flex; flex-direction: column; align-items: center; gap: 8px; }

/* --- ИСПРАВЛЕННЫЕ ЦВЕТА ШАРОВ --- */
.bauble-circle {
    border-radius: 50%; display: flex; align-items: center; justify-content: center;
    font-weight: 800; font-size: 13px; box-shadow: 0 4px 10px rgba(0,0,0,0.1);
}
/* Красный: белый текст */
.bauble-circle.b-large { 
    width: 56px; height: 56px; 
    background: linear-gradient(135deg, #EF4444 0%, #B91C1C 100%);
    color: #fff !important; 
    text-shadow: 0 1px 2px rgba(0,0,0,0.2);
}
/* Золотой: ТЕМНЫЙ ТЕКСТ (#353c49) */
.bauble-circle.b-medium { 
    width: 44px; height: 44px; 
    background: linear-gradient(135deg, #FCD34D 0%, #F59E0B 100%);
    color: #353c49 !important; 
    text-shadow: none !important;
}
/* Серебряный: ТЕМНЫЙ ТЕКСТ (#353c49) */
.bauble-circle.b-small { 
    width: 32px; height: 32px; 
    background: linear-gradient(135deg, #F1F5F9 0%, #CBD5E1 100%);
    color: #353c49 !important;
    text-shadow: none !important;
}

.bauble-group span { font-size: 12px; color: var(--text-secondary); font-weight: 600; }

/* --- BOTTOM INFO STYLES --- */
.info-wrapper {
    padding: 60px 0 60px 0;
    margin-top: 60px;
    border-top: 1px solid rgba(0,0,0,0.06);
    width: 100%;
}
.info-wrapper .container { max-width: 800px; margin: 0 auto; }

/* Заголовки */
.icon-heading {
    display: flex; align-items: flex-start; gap: 16px;
    margin-bottom: 24px; font-size: 24px; font-weight: 800;
    color: var(--text-primary); line-height: 1.3;
}
.header-icon {
    display: flex; align-items: center; justify-content: center;
    width: 48px; height: 48px; border-radius: 14px;
    background: #fff; box-shadow: 0 4px 12px rgba(0,0,0,0.04);
    flex-shrink: 0; margin-top: -4px;
}
.header-icon svg { width: 24px; height: 24px; stroke-width: 2px; }

/* Цвета иконок */
.green-icon svg { color: #10B981; }
.blue-icon svg { color: #2563EB; }
.red-icon svg { color: #DC2626; }

/* Секция формул */
.formulas-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; margin-bottom: 48px; }

.formula-card {
    background: #fff; border: 1px solid rgba(0,0,0,0.04);
    box-shadow: var(--shadow-soft); border-radius: var(--radius-lg); 
    padding: 24px; transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    display: flex; flex-direction: column;
}
.formula-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-hover); }

.formula-header {
    display: flex; flex-direction: column; align-items: flex-start;
    gap: 12px; margin-bottom: 16px;
}
.formula-card h3 { margin: 0; font-size: 18px; font-weight: 700; color: var(--text-primary); line-height: 1.3; }

.badge-green, .badge-blue {
    padding: 6px 12px; border-radius: 99px;
    font-size: 11px; font-weight: 700;
    text-transform: uppercase; letter-spacing: 0.05em; color: #fff;
}
.badge-green { background: #10B981; }
.badge-blue { background: #2563EB; }

.math-expression {
    background: #F9FAFB; border: 1px solid #E5E7EB;
    padding: 12px 16px; border-radius: 12px;
    font-weight: 700; color: var(--tree-accent);
    text-align: center; margin-bottom: 16px; font-size: 15px;
}
.formula-card p { font-size: 14px; color: var(--text-secondary); margin: 0; line-height: 1.5; font-weight: 500; }

.soft-divider {
    border: none; height: 1px;
    background: linear-gradient(90deg, transparent, #E5E7EB, transparent);
    margin: 48px 0;
}

/* Описание */
.calc-description p { font-size: 16px; line-height: 1.7; color: var(--text-secondary); margin-bottom: 24px; }
.calc-description strong { color: var(--text-primary); }
.calc-description ul { padding-left: 20px; line-height: 1.6; color: var(--text-secondary); margin-bottom: 24px; }
.calc-description li { margin-bottom: 8px; }

/* FAQ (Fuel Style) */
.faq-fuel-style .faq-item {
    background: #fff; border: 1px solid #E5E7EB;
    border-radius: 12px; margin-bottom: 12px;
    overflow: hidden; transition: all 0.2s ease;
}
.faq-fuel-style .faq-item[open] {
    border-color: var(--tree-accent); 
    box-shadow: 0 4px 20px rgba(21, 128, 61, 0.1);
}

.faq-fuel-style summary.faq-question {
    padding: 16px 20px; cursor: pointer;
    font-weight: 600; color: var(--text-primary);
    list-style: none; position: relative;
    display: flex; justify-content: space-between;
    align-items: center; transition: background 0.2s;
}
.faq-fuel-style summary.faq-question:hover { background-color: #F9FAFB; }
.faq-fuel-style .faq-item[open] summary.faq-question {
    color: var(--tree-accent); background: #F0FDF4;
}

.faq-question::after {
    content: '+'; font-size: 20px;
    color: var(--text-secondary); font-weight: 400; line-height: 1;
}
.faq-question .icon-plus { display: none; }
.faq-fuel-style .faq-item[open] summary.faq-question::after {
    content: '−'; color: var(--tree-accent);
}
.faq-answer {
    padding: 20px; color: var(--text-secondary);
    line-height: 1.6; font-size: 15px; border-top: 1px solid #F3F4F6;
}

/* --- MOBILE ADAPTATION --- */
/* ИСПРАВЛЕНО: Вернул строчное отображение (row), но с центрированием */
@media (max-width: 900px) {
    .formulas-grid { grid-template-columns: 1fr; gap: 16px; margin-bottom: 32px; }
    
    .icon-heading { 
        display: flex !important;
        flex-direction: row !important; /* <--- Иконка и текст рядом */
        justify-content: center !important; /* Центрируем весь блок */
        align-items: center !important;
        text-align: left; /* Текст внутри блока выровнен естественно */
        
        font-size: 20px; gap: 12px; margin-bottom: 20px;
        width: 100%;
    }
    
    .header-icon { 
        width: 40px; height: 40px; border-radius: 12px; margin-top: 0; margin-bottom: 0;
    }
    .header-icon svg { width: 20px; height: 20px; }
    
    .formula-card { padding: 24px; text-align: center; align-items: center; }
    .formula-header { align-items: center; width: 100%; }
    .math-expression { width: 100%; max-width: 300px; margin-left: auto; margin-right: auto; }
    
    .info-wrapper { margin-top: 40px; padding-top: 40px; }
}