/* calc/assets/css/calculators/absolute_value.css */

:root {
    --bg-pearl: #FFFFFF;
    --text-pearl-main: #0F172A; 
    --text-pearl-muted: #64748B;
    
    /* Elegant Accents */
    --accent-teal: #0F766E; /* Deep Emerald/Teal */
    --accent-mint: #10B981; /* Bright Mint for highlights */
    
    /* Сверхмягкая "дорогая" тень */
    --shadow-pearl: 0 20px 40px -15px rgba(15, 118, 110, 0.15), 
                    0 0 20px rgba(0, 0, 0, 0.02);
    --border-pearl: #F1F5F9;
}

/* =========================================
   ОСНОВНАЯ СЕТКА И КАРКАС
   ========================================= */
.calc-header { margin-bottom: 32px; }
.subtitle { color: var(--text-secondary); margin-top: 8px; }

.calc-grid { display: grid; grid-template-columns: 1fr; gap: 24px; align-items: start; }
@media (min-width: 900px) { .calc-grid { grid-template-columns: 1fr 1fr; } }

.calc-inputs { gap: 16px; }

/* Custom Tabs для переключения режимов */
.operation-tabs {
    display: flex; background: #F8FAFC; border-radius: 14px;
    padding: 6px; margin-bottom: 24px; border: 1px solid #E2E8F0;
}
.tab-btn {
    flex: 1; padding: 12px; border: none; background: transparent;
    border-radius: 10px; font-weight: 700; font-size: 14px;
    color: #64748B; cursor: pointer; transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}
.tab-btn.active {
    background: #fff; color: var(--accent-teal);
    box-shadow: 0 4px 10px rgba(0,0,0,0.05);
}

.input-group { margin-bottom: 16px; }
.input-group label { display: block; font-size: 13px; font-weight: 600; margin-bottom: 6px; color: var(--text-primary); transition: color 0.3s;}

.input-wrapper { position: relative; display: flex; align-items: center; }
input[type="number"]::-webkit-outer-spin-button,
input[type="number"]::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
input[type="number"] { -moz-appearance: textfield; }

.input-wrapper input {
    width: 100%; padding: 14px 16px; font-size: 16px; font-weight: 600;
    border: 2px solid transparent; border-radius: 12px;
    background: #F1F5F9; outline: none; transition: all 0.3s;
    font-family: inherit; color: #0F172A;
}
.input-wrapper input:focus { 
    background: #fff; border-color: #5EEAD4; 
    box-shadow: 0 0 0 4px rgba(20, 184, 166, 0.1); 
}

.row-2-col { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }

.info-alert {
    display: flex; align-items: flex-start; gap: 12px;
    background: #F0FDFA; border: 1px solid #CCFBF1;
    padding: 16px; border-radius: 12px; margin-top: 24px;
    color: #0F766E; font-size: 13px; line-height: 1.5;
}
.info-alert svg { flex-shrink: 0; color: var(--accent-teal); margin-top: -2px; }

/* =========================================
   ПРАВАЯ КАРТОЧКА (Pearl & Teal Theme)
   ========================================= */
.card--teal-pearl { 
    background: var(--bg-pearl); 
    color: var(--text-pearl-main); 
    border: 1px solid var(--border-pearl); border-radius: 24px;
    box-shadow: var(--shadow-pearl);
    overflow: hidden; padding: 24px 0 0 0; 
}
@media (min-width: 900px) { .sticky-card { position: sticky; top: 24px; } }

.pearl-title { 
    color: var(--text-pearl-muted); margin: 0 24px 16px; 
    font-size: 12px; text-align: center; 
    font-weight: 800; letter-spacing: 0.15em; text-transform: uppercase;
}

/* Canvas Container */
.canvas-container-wrapper {
    width: 100%; height: 150px; 
    display: flex; align-items: center; justify-content: center;
    background: #F8FAFC; border-top: 1px solid #F1F5F9; border-bottom: 1px solid #F1F5F9;
    margin-bottom: 24px; position: relative;
}
#math-canvas { max-width: 100%; max-height: 100%; }

/* Главный результат */
.pearl-display { 
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    padding: 0 24px 24px; gap: 8px;
}
.math-expr-large {
    font-size: 36px; font-weight: 700; color: var(--accent-teal);
    letter-spacing: 1px; line-height: 1.2; text-align: center;
}
.math-steps {
    font-size: 16px; color: var(--text-pearl-muted); font-weight: 600;
}

.pearl-explanation {
    margin: 0 24px 24px; padding: 12px 16px;
    background: #F0FDFA; border-radius: 12px; border: 1px dashed #99F6E4;
    font-size: 14px; color: #0F766E; text-align: center;
    line-height: 1.5; font-weight: 500;
}

.error-msg {
    margin: 0 24px 24px; background: #FEF2F2; color: #E11D48;
    padding: 16px; border-radius: 12px; font-size: 14px; font-weight: 700;
    border: 1px solid #FECDD3; text-align: center;
}
.hidden { display: none !important; }

/* =========================================
   SEO ИНФОБЛОКИ И ТАБЛИЦА
   ========================================= */
.info-wrapper { padding: 60px 0; margin-top: 60px; border-top: 1px solid rgba(0,0,0,0.06); margin-bottom: 20px; }
.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; }

.teal-icon svg { color: var(--accent-teal); }
.slate-icon svg { color: #475569; }

.intro-text { font-size: 16px; color: var(--text-secondary); margin-bottom: 32px; line-height: 1.6; }

.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; }
.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-teal { background: #CCFBF1; color: #0F766E; padding: 6px 12px; border-radius: 99px; font-size: 11px; font-weight: 800; text-transform: uppercase; }
.badge-mint { background: #D1FAE5; color: #047857; padding: 6px 12px; border-radius: 99px; font-size: 11px; font-weight: 800; text-transform: uppercase; }

.formula-card p { font-size: 14px; color: var(--text-secondary); margin: 0; line-height: 1.5; font-weight: 500; }
.math-expression { background: #F8FAFC; border: 1px solid #E2E8F0; padding: 12px 16px; border-radius: 12px; text-align: center; margin-bottom: 16px; }

/* ТАБЛИЦА */
.seo-table-container { background: #fff; border: 1px solid #E5E7EB; border-radius: 16px; padding: 24px; margin-bottom: 40px; box-shadow: 0 4px 15px rgba(0,0,0,0.02); }
.seo-table-container h3 { margin-top: 0; margin-bottom: 20px; color: #1E293B; font-size: 18px; }
.seo-table { width: 100%; border-collapse: collapse; text-align: left; }
.seo-table th { background: #F8FAFC; padding: 12px 16px; font-weight: 700; color: #475569; border-bottom: 2px solid #E2E8F0; }
.seo-table td { padding: 16px; border-bottom: 1px solid #E2E8F0; color: #1E293B; font-weight: 500; }
.seo-table tr:last-child td { border-bottom: none; }

.soft-divider { border: none; height: 1px; background: linear-gradient(90deg, transparent, #E5E7EB, transparent); margin: 48px 0; }

/* FAQ */
.faq-section .faq-item { background: #fff; border: 1px solid #E5E7EB; border-radius: 12px; margin-bottom: 12px; overflow: hidden; transition: all 0.2s ease; }
.faq-section .faq-item[open] { border-color: #0F766E; box-shadow: 0 4px 20px rgba(15, 118, 110, 0.1); }
summary.faq-question { padding: 16px 20px; cursor: pointer; font-weight: 600; color: var(--text-primary); list-style: none; display: flex; justify-content: space-between; align-items: center; transition: background 0.2s; }
summary.faq-question:hover { background-color: #F0FDFA; }
.faq-section .faq-item[open] summary.faq-question { color: #0F766E; background: #F0FDFA; }
.faq-question::after { content: '+'; font-size: 20px; color: var(--text-secondary); font-weight: 400; line-height: 1; }
.faq-question .icon-plus { display: none; }
.faq-section .faq-item[open] summary.faq-question::after { content: '−'; color: #0F766E; }
.faq-answer, .faq-item div[itemprop="text"] { padding: 20px; color: var(--text-secondary); line-height: 1.6; font-size: 15px; }

/* =========================================
   МОБИЛЬНАЯ АДАПТАЦИЯ (ИСПРАВЛЕНО)
   ========================================= */
@media (max-width: 900px) {
    .row-2-col { grid-template-columns: 1fr; }
    .formulas-grid { grid-template-columns: 1fr; gap: 16px; margin-bottom: 32px; }
    .seo-table-container { padding: 16px; overflow-x: auto; }
    .seo-table th, .seo-table td { padding: 12px 10px; font-size: 14px; }
    .math-expr-large { font-size: 28px; }
    
    /* Делаем вкладки (табы) столбиком, чтобы они не сжимались и нормально кликались */
    .operation-tabs {
        flex-direction: column;
        gap: 8px;
    }
    .tab-btn {
        width: 100%;
        font-size: 15px;
        padding: 14px;
    }
}