/* calc/assets/css/calculators/ice-safety.css */

/* --- Theme: Ice --- */
:root {
    --ice-primary: #0284C7; /* Sky 600 */
    --ice-dark: #0C4A6E;    /* Sky 900 */
    --ice-bg: #F0F9FF;      /* Sky 50 */
    --danger-color: #DC2626;
    --safe-color: #16A34A;
}

.calc-header { margin-bottom: 32px; }
.subtitle { color: var(--text-secondary); margin-top: 8px; }

/* Grid */
.calc-grid { display: grid; grid-template-columns: 1fr; gap: 24px; align-items: start; }
@media (min-width: 900px) { .calc-grid { grid-template-columns: 1.2fr 0.8fr; } }

/* Inputs */
.calc-inputs { gap: 24px; }
.input-group { margin-bottom: 24px; }
.input-group label { display: block; font-size: 14px; font-weight: 600; margin-bottom: 8px; color: var(--text-primary); }

.input-wrapper { position: relative; display: flex; align-items: center; }
.input-wrapper input, .input-wrapper select {
    width: 100%; padding: 16px; padding-right: 40px;
    font-size: 16px; font-weight: 500;
    border: 1px solid #E5E7EB; border-radius: 12px;
    outline: none; transition: border 0.2s;
    font-family: var(--font-main); background: #fff; appearance: none;
}
.input-wrapper input:focus, .input-wrapper select:focus {
    border-color: var(--ice-primary); box-shadow: 0 0 0 3px rgba(2, 132, 199, 0.1);
}
.suffix, .select-arrow { position: absolute; right: 16px; color: var(--text-secondary); pointer-events: none; }
.select-arrow { display: flex; align-items: center; }
.helper-text { font-size: 12px; color: var(--text-secondary); margin-top: 6px; }

/* Range Slider */
.range-wrapper { margin-top: 10px; padding: 0 4px; }
input[type=range] { -webkit-appearance: none; width: 100%; background: transparent; }
input[type=range]::-webkit-slider-thumb {
    -webkit-appearance: none; height: 20px; width: 20px; border-radius: 50%;
    background: var(--ice-primary); cursor: pointer; margin-top: -8px;
    border: 2px solid #fff; box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}
input[type=range]::-webkit-slider-runnable-track {
    width: 100%; height: 4px; cursor: pointer; background: #E5E7EB; border-radius: 2px;
}

/* Radio Grid (Cards) */
.radio-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.radio-card {
    position: relative; cursor: pointer;
    border: 1px solid #E5E7EB; border-radius: 12px; padding: 12px;
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    background: #fff; transition: all 0.2s;
}
.radio-card input { display: none; }
.radio-card:hover { border-color: var(--ice-primary); }
.radio-card:has(input:checked) {
    background: var(--ice-bg); border-color: var(--ice-primary); color: var(--ice-primary);
    box-shadow: 0 4px 12px rgba(2, 132, 199, 0.1);
}
.rc-icon { font-size: 24px; margin-bottom: 4px; }
.rc-title { font-size: 13px; font-weight: 600; }

/* --- Result Card --- */
.card--ice { background: linear-gradient(135deg, #E0F2FE 0%, #0EA5E9 100%); color: #fff; border: none; overflow: hidden; position: relative; }
@media (min-width: 900px) { .sticky-card { position: sticky; top: 24px; } }

/* Killer Feature: Ice Visual */
.ice-visual-container {
    height: 220px; position: relative; margin-bottom: 24px;
    background: #0284C7; /* Deep Water */
    border-radius: 16px; overflow: hidden;
    box-shadow: inset 0 0 20px rgba(0,0,0,0.3);
}

.sky { height: 60px; background: linear-gradient(to bottom, #BAE6FD, #E0F2FE); width: 100%; position: absolute; top: 0; }

.ice-surface {
    position: absolute; top: 60px; left: 0; width: 100%;
    height: 20px; /* Dynamic Height */
    background: rgba(255,255,255,0.8);
    backdrop-filter: blur(4px);
    border-bottom: 1px solid rgba(255,255,255,0.5);
    transition: all 0.5s cubic-bezier(0.25, 0.8, 0.25, 1);
    z-index: 2;
    transform-origin: center top;
}
/* Ice Types */
.ice-surface.type-clear { background: rgba(186, 230, 253, 0.6); border-top: 1px solid rgba(255,255,255,0.9); }
.ice-surface.type-snow { background: #FFFFFF; }
.ice-surface.type-melt { background: rgba(203, 213, 225, 0.7); opacity: 0.8; }

/* Object (Car/Person) */
.object-on-ice {
    position: absolute; bottom: 100%; left: 50%; transform: translateX(-50%);
    font-size: 32px; transition: transform 0.5s;
    filter: drop-shadow(0 2px 4px rgba(0,0,0,0.2));
}

/* Cracks */
.cracks {
    position: absolute; top: 0; left: 0; width: 100%; height: 100%;
    display: flex; align-items: center; justify-content: center;
    opacity: 0; transition: opacity 0.3s;
}
.crack-svg { width: 80%; height: 80%; }

/* Animation: Break */
.ice-surface.broken {
    transform: rotate(5deg) translateY(30px);
    background: rgba(255,255,255,0.4);
}
.ice-surface.broken .object-on-ice {
    transform: translateX(-50%) translateY(40px) rotate(-10deg);
    opacity: 0.5;
}

.water { position: absolute; top: 60px; bottom: 0; width: 100%; z-index: 1; }
.bubbles {
    position: absolute; bottom: 0; left: 20%; width: 10px; height: 10px;
    background: rgba(255,255,255,0.3); border-radius: 50%;
    animation: bubble 3s infinite; opacity: 0;
}
@keyframes bubble { 0% { bottom: 0; opacity: 0; } 50% { opacity: 1; } 100% { bottom: 100%; opacity: 0; } }

/* RULER (Исправлено: Добавлен z-index) */
.ruler-vertical {
    position: absolute; 
    right: 20px; 
    top: 60px; /* Start at ice top */
    width: 20px;
    height: 20px; 
    border-right: 2px solid rgba(255,255,255,0.9);
    display: flex; 
    align-items: center; 
    justify-content: flex-end;
    pointer-events: none;
    transition: height 0.5s cubic-bezier(0.25, 0.8, 0.25, 1);
    z-index: 10; /* ВЫШЕ ЛЬДА */
}

.ruler-vertical::before, .ruler-vertical::after {
    content: '';
    position: absolute;
    right: -2px;
    width: 8px;
    height: 2px;
    background: rgba(255,255,255,0.9);
}
.ruler-vertical::before { top: 0; }
.ruler-vertical::after { bottom: 0; }

.ruler-vertical span {
    color: #fff;
    font-size: 12px;
    font-weight: 700;
    margin-right: 8px;
    text-shadow: 0 1px 2px rgba(0,0,0,0.5);
}

/* Result Data */
.result-data { text-align: center; }
.result-data h2 { font-size: 14px; text-transform: uppercase; opacity: 0.9; margin-bottom: 12px; }

.status-badge {
    display: inline-block; padding: 8px 16px; border-radius: 99px;
    background: #fff; color: var(--ice-primary); font-weight: 700; font-size: 18px;
    margin-bottom: 12px; box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}
.status-badge.danger { color: var(--danger-color); background: #FEF2F2; }
.status-badge.risky { color: #EA580C; background: #FFF7ED; }

.status-text { font-size: 15px; opacity: 0.95; line-height: 1.5; }

.summary-divider { height: 1px; background: rgba(255,255,255,0.2); margin: 24px 0; }

.load-info {
    display: flex; justify-content: space-between; align-items: center;
    background: rgba(255,255,255,0.15); padding: 12px; border-radius: 8px;
    font-size: 14px;
}

/* --- INFO WRAPPER STYLES --- */
.info-wrapper {
    padding: 60px 0 60px 0;
    margin-top: 60px;
    border-top: 1px solid rgba(0,0,0,0.06);
    margin-bottom: 20px;
}
.info-wrapper .container { max-width: 800px; margin: 0 auto; }

/* Headings */
.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; }

/* Colors */
.blue-icon svg { color: var(--ice-primary); }
.cyan-icon svg { color: #0891B2; }

/* Formulas */
.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: 0 4px 20px rgba(0,0,0,0.03); border-radius: 24px; padding: 24px;
    display: flex; flex-direction: column; transition: transform 0.3s;
}
.formula-card:hover { transform: translateY(-4px); }

.formula-header { margin-bottom: 16px; display: flex; flex-direction: column; align-items: flex-start; gap: 12px; }
.formula-card h3 { margin: 0; font-size: 18px; font-weight: 700; color: var(--text-primary); }

.badge-blue { background: #E0F2FE; color: #0284C7; padding: 6px 12px; border-radius: 99px; font-size: 11px; font-weight: 700; text-transform: uppercase; }
.badge-dark { background: #F1F5F9; color: #0F172A; padding: 6px 12px; border-radius: 99px; font-size: 11px; font-weight: 700; text-transform: uppercase; }

.formula-card p { font-size: 14px; color: var(--text-secondary); margin: 0; line-height: 1.5; }

/* Soft Divider */
.soft-divider { border: none; height: 1px; background: linear-gradient(90deg, transparent, #E5E7EB, transparent); margin: 48px 0; }

/* Article */
.calc-description p { font-size: 16px; line-height: 1.7; color: var(--text-secondary); margin-bottom: 24px; }
.calc-description ul { color: var(--text-secondary); margin-bottom: 24px; padding-left: 20px; line-height: 1.6; }
.calc-description li { margin-bottom: 8px; }

/* FAQ */
.faq-ice-style .faq-item {
    background: #fff; border: 1px solid #E5E7EB; border-radius: 12px;
    margin-bottom: 12px; overflow: hidden; transition: all 0.2s;
}
.faq-ice-style .faq-item[open] { border-color: var(--ice-primary); box-shadow: 0 4px 12px rgba(2, 132, 199, 0.1); }

.faq-ice-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;
}
.faq-ice-style .faq-item[open] summary.faq-question { color: var(--ice-primary); background: #F0F9FF; }

.faq-question::after { content: '+'; font-size: 20px; color: var(--text-secondary); }
.faq-ice-style .faq-item[open] summary.faq-question::after { content: '−'; color: var(--ice-primary); }

.faq-answer { padding: 20px; color: var(--text-secondary); line-height: 1.6; font-size: 15px; }

/* Mobile Adaptation */
@media (max-width: 900px) {
    .formulas-grid { grid-template-columns: 1fr; gap: 16px; }
    .icon-heading { font-size: 20px; }
    .header-icon { width: 40px; height: 40px; }
    .header-icon svg { width: 20px; height: 20px; }
    
    .formula-card { text-align: center; align-items: center; }
    .formula-header { align-items: center; width: 100%; }
    
    .info-wrapper { margin-top: 40px; padding-top: 40px; }
}