/* calc/assets/css/calculators/trigonometry-calculator.css */

:root {
    --trig-primary: #6D28D9; /* Фиолетовый */
    --trig-bg: #F5F3FF;      /* Светло-фиолетовый */
    --trig-dark: #2E1065;    /* Темно-фиолетовый */
    
    --c-sin: #EF4444; /* Красный */
    --c-cos: #3B82F6; /* Синий */
    --c-tg:  #F59E0B; /* Желтый */
    --c-ctg: #10B981; /* Зеленый */
}

/* --- ВЕРХНЯЯ ЧАСТЬ --- */
.calc-header { margin-bottom: 40px; }
.subtitle { color: var(--text-secondary); margin-top: 12px; font-size: 16px; line-height: 1.5; }

.calc-grid { display: grid; grid-template-columns: 1fr; gap: 32px; align-items: start; }
@media (min-width: 992px) { .calc-grid { grid-template-columns: 1fr 1.1fr; gap: 48px; } }

/* Вкладки (Tabs) */
.tabs-trig { display: flex; background: #F3F4F6; padding: 6px; border-radius: 14px; margin-bottom: 24px; }
.t-tab { flex: 1; padding: 12px; border: none; background: transparent; font-size: 14px; font-weight: 700; color: #6B7280; border-radius: 10px; cursor: pointer; transition: all 0.3s; }
.t-tab.active { background: #fff; color: var(--trig-primary); box-shadow: 0 4px 10px rgba(0,0,0,0.05); }

.trig-mode-box { display: none; animation: fadeIn 0.3s ease; }
.trig-mode-box.active { display: block; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(5px); } to { opacity: 1; transform: translateY(0); } }

/* Инпуты */
.input-group { margin-bottom: 24px; }
.label-with-icon { display: flex; align-items: center; gap: 8px; color: var(--trig-primary) !important; font-size: 16px !important; font-weight: 700 !important; }

.input-wrapper { position: relative; display: flex; align-items: center; }
.input-wrapper input {
    width: 100%; padding: 14px 16px; padding-right: 90px;
    font-size: 18px; font-weight: 700; font-family: 'Courier New', Courier, monospace;
    border: 1px solid #D1D5DB; border-radius: 12px;
    transition: all 0.2s; outline: none; background: #fff;
    color: #1F2937;
}
.input-wrapper input:focus { border-color: var(--trig-primary); box-shadow: 0 0 0 4px rgba(109, 40, 217, 0.15); }
.suffix { position: absolute; right: 14px; color: #9CA3AF; font-weight: 600; pointer-events: none; font-size: 14px; top: 50%; transform: translateY(-50%); }

.row-2-col { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }

.highlight-group { background: var(--trig-bg); padding: 20px; border-radius: 16px; border: 1px dashed var(--trig-primary); }
.helper-text { font-size: 13px; color: #6B7280; margin-top: 8px; line-height: 1.4; }

/* Быстрые углы */
.quick-angles { margin-top: 16px; }
.qa-title { font-size: 12px; font-weight: 700; color: #9CA3AF; text-transform: uppercase; margin-bottom: 8px; display: block; }
.qa-btns { display: flex; flex-wrap: wrap; gap: 8px; }
.qa-btn { padding: 6px 12px; background: #F3F4F6; border: 1px solid #E5E7EB; border-radius: 8px; font-size: 13px; font-weight: 700; color: #4B5563; cursor: pointer; transition: all 0.2s; }
.qa-btn:hover { background: var(--trig-bg); color: var(--trig-primary); border-color: var(--trig-primary); }

/* Range Slider */
.mt-3 { margin-top: 24px !important; }
.trig-slider { width: 100%; -webkit-appearance: none; height: 6px; background: #E5E7EB; border-radius: 3px; outline: none; cursor: pointer; }
.trig-slider::-webkit-slider-thumb { -webkit-appearance: none; width: 22px; height: 22px; background: var(--trig-primary); border-radius: 50%; cursor: grab; border: 2px solid #fff; box-shadow: 0 2px 4px rgba(0,0,0,0.15); transition: transform 0.1s; }
.trig-slider::-webkit-slider-thumb:active { transform: scale(1.1); cursor: grabbing; }
.rs-labels { display: flex; justify-content: space-between; font-size: 11px; font-weight: 700; color: #9CA3AF; margin-top: 8px; }

/* Сегмент контрол */
.group-label { display: block; font-size: 14px; font-weight: 700; margin-bottom: 12px; color: #1F2937; opacity: 0.9; }
.segment-control { display: flex; gap: 8px; background: #F3F4F6; padding: 5px; border-radius: 12px; }
.segment-item { flex: 1; position: relative; }
.segment-item input { position: absolute; opacity: 0; cursor: pointer; height: 0; width: 0; }
.segment-box {
    display: flex; align-items: center; justify-content: center; gap: 6px;
    padding: 10px 8px; border-radius: 9px; font-size: 13px; font-weight: 600;
    color: #6B7280; transition: all 0.2s; cursor: pointer; text-align: center; border: 1px solid transparent; user-select: none;
}
.segment-item input:checked + .segment-box { background: #fff; color: var(--trig-primary); border-color: #E5E7EB; box-shadow: 0 4px 6px -1px rgba(0,0,0,0.05); }

.btn-clear-outline { width: 100%; padding: 14px; background: #fff; border: 1px dashed #EF4444; color: #EF4444; font-weight: 700; font-size: 14px; border-radius: 12px; cursor: pointer; transition: all 0.2s; display: flex; align-items: center; justify-content: center; gap: 8px; margin-top: 16px; }
.btn-clear-outline:hover { background: #FEF2F2; }


/* --- ПРАВАЯ ЧАСТЬ: РЕЗУЛЬТАТ (KILLER FEATURE) --- */
@media (min-width: 992px) { .sticky-card { position: sticky; top: 24px; transition: top 0.3s; } }

.trig-result-card {
    background: #111827; /* Черный матовый */
    border: 2px solid #374151; padding: 32px;
    border-top: 6px solid var(--trig-primary); border-radius: 24px;
    box-shadow: 0 20px 40px -10px rgba(0,0,0,0.5);
    color: #F9FAFB;
}

.result-header-neon { text-align: center; margin-bottom: 24px; }
.result-header-neon h2 { font-size: 14px; font-weight: 800; color: #9CA3AF; margin: 0; text-transform: uppercase; letter-spacing: 1px; }

/* KILLER FEATURE 1: Единичная Окружность */
.trig-visual-wrapper { display: flex; justify-content: center; margin-bottom: 32px; }

.unit-circle-box { position: relative; width: 200px; height: 200px; }
.uc-circle {
    width: 100%; height: 100%; border-radius: 50%;
    border: 2px dashed #4B5563; position: relative;
    box-shadow: inset 0 0 20px rgba(0,0,0,0.5); background: #1F2937;
}

.uc-axis-x, .uc-axis-y { position: absolute; background: #6B7280; }
.uc-axis-x { height: 1px; width: 110%; top: 50%; left: -5%; }
.uc-axis-y { width: 1px; height: 110%; left: 50%; top: -5%; }

.uc-lbl-x { position: absolute; right: -30px; top: -10px; font-size: 10px; color: var(--c-cos); font-weight: 800; }
.uc-lbl-y { position: absolute; top: -20px; left: -10px; font-size: 10px; color: var(--c-sin); font-weight: 800; }

.uc-angle-line {
    position: absolute; top: 50%; left: 50%; width: 50%; height: 2px;
    background: var(--trig-primary); transform-origin: left center;
    transition: transform 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    box-shadow: 0 0 10px var(--trig-primary);
}
.uc-point {
    position: absolute; right: -6px; top: -5px; width: 12px; height: 12px;
    background: #fff; border-radius: 50%; border: 3px solid var(--trig-primary);
    box-shadow: 0 0 10px #fff;
}
.uc-degree-lbl {
    position: absolute; top: -30px; left: 50%; transform: translateX(-50%);
    font-size: 18px; font-weight: 800; color: #fff; background: rgba(0,0,0,0.5); padding: 4px 10px; border-radius: 8px; border: 1px solid #4B5563;
}

/* KILLER FEATURE 2: Треугольник */
.triangle-box { width: 100%; height: 200px; display: flex; justify-content: center; align-items: center; }
.tri-canvas { width: 100%; height: 100%; }
#tri-poly { transition: all 0.3s; }
.tri-canvas text { font-family: 'Courier New', Courier, monospace; font-size: 16px; }

/* ИТОГОВАЯ ПАНЕЛЬ (Неон) */
.trig-dashboard { background: #1F2937; border: 1px solid #374151; border-radius: 16px; padding: 20px; }
.dash-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-bottom: 16px; }
.dash-row:last-child { margin-bottom: 0; }

.dash-item { display: flex; flex-direction: column; align-items: center; padding: 12px; border-radius: 12px; border: 1px solid #374151; background: #111827; position: relative; overflow: hidden; }
.di-lbl { font-size: 11px; font-weight: 700; text-transform: uppercase; color: #9CA3AF; margin-bottom: 4px; }
.di-val { font-size: 24px; font-weight: 800; line-height: 1; margin-bottom: 6px; font-family: 'Courier New', Courier, monospace; }
.di-frac { font-size: 13px; font-weight: 800; background: rgba(255,255,255,0.1); padding: 2px 8px; border-radius: 6px; font-family: 'Courier New', Courier, monospace; }

/* Цвета градиентов / Неона */
.box-sin { border-top: 3px solid var(--c-sin); } .box-sin .di-val { color: var(--c-sin); }
.box-cos { border-top: 3px solid var(--c-cos); } .box-cos .di-val { color: var(--c-cos); }
.box-tg  { border-top: 3px solid var(--c-tg); }  .box-tg .di-val { color: var(--c-tg); }
.box-ctg { border-top: 3px solid var(--c-ctg); } .box-ctg .di-val { color: var(--c-ctg); }

.box-alpha { border-top: 3px solid #10B981; } .box-alpha .di-val { color: #10B981; }
.box-beta { border-top: 3px solid #8B5CF6; }  .box-beta .di-val { color: #8B5CF6; }

.conversion-box { display: flex; justify-content: space-between; align-items: center; background: #111827; padding: 12px 16px; border-radius: 12px; border: 1px dashed #4B5563; }
.cb-lbl { font-size: 13px; color: #9CA3AF; font-weight: 600; }
.cb-val { font-size: 16px; color: #fff; font-weight: 800; font-family: 'Courier New', Courier, monospace; }
.cb-frac { font-size: 14px; font-weight: 800; color: var(--trig-primary); font-family: 'Courier New', Courier, monospace; }

.side-calc-res { display: flex; flex-direction: column; align-items: center; background: #111827; padding: 16px; border-radius: 12px; border: 1px solid var(--trig-primary); }
.scr-lbl { font-size: 12px; color: #9CA3AF; text-transform: uppercase; margin-bottom: 4px; font-weight: 700; }
.scr-val { font-size: 24px; color: #fff; font-weight: 800; font-family: 'Courier New', Courier, monospace; }


/* --- НИЖНЯЯ ЧАСТЬ (SEO, INFO) --- */
.info-wrapper { padding: 80px 0; margin-top: 60px; border-top: 1px solid #E5E7EB; }

.author-badge { display: flex; align-items: flex-start; gap: 16px; margin-bottom: 40px; padding: 20px; background: #F8FAFC; border-radius: 16px; border: 1px solid #E2E8F0; }
.author-avatar { width: 48px; height: 48px; background: var(--trig-primary); color: #fff; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 22px; flex-shrink: 0; }
.author-info { display: flex; flex-direction: column; min-width: 0; }
.author-name { font-size: 15px; font-weight: 700; color: #111827; line-height: 1.4; margin-bottom: 4px; }
.author-date { font-size: 13px; color: #6B7280; }

.icon-heading { display: flex; align-items: flex-start; gap: 16px; margin-bottom: 32px; font-size: 26px; font-weight: 800; color: #111827; line-height: 1.25; letter-spacing: -0.02em; }
.header-icon { display: flex; align-items: center; justify-content: center; width: 52px; height: 52px; border-radius: 14px; background: #fff; box-shadow: 0 4px 12px rgba(0,0,0,0.06); flex-shrink: 0; margin-top: -6px; font-size: 26px; }

.purple-icon { color: var(--trig-primary); }
.dark-icon { color: #1F2937; }

.formulas-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 32px; margin-bottom: 56px; }
.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: 32px; transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1); display: flex; flex-direction: column; }
.formula-card:hover { transform: translateY(-6px); box-shadow: 0 12px 32px rgba(109, 40, 217, 0.1); border-color: rgba(109, 40, 217, 0.1); }
.formula-header { display: flex; flex-direction: column; align-items: flex-start; gap: 14px; margin-bottom: 20px; }
.formula-card h3 { margin: 0; font-size: 20px; font-weight: 700; color: var(--text-primary); line-height: 1.3; }

.badge-purple { background: var(--trig-primary); color: #fff; padding: 6px 12px; border-radius: 99px; font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.5px; display: inline-block; }
.badge-dark { background: #1F2937; color: #fff; padding: 6px 12px; border-radius: 99px; font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.5px; display: inline-block; }

.formula-card p { font-size: 15px; color: var(--text-secondary); margin: 0; line-height: 1.6; font-weight: 500; }
.math-expression { background: var(--trig-bg); border: 1px dashed var(--trig-primary); padding: 18px; border-radius: 14px; font-weight: 700; color: var(--trig-dark); text-align: center; margin-bottom: 20px; font-size: 17px; font-family: 'Courier New', Courier, monospace; letter-spacing: 0.5px; }

.soft-divider { border: none; height: 1px; background: linear-gradient(90deg, transparent, #E5E7EB, transparent); margin: 56px 0; opacity: 0.7; }
.intro-text { font-size: 16px; color: var(--text-secondary); line-height: 1.6; margin-bottom: 40px; }
.calc-description p { font-size: 17px; line-height: 1.7; color: #4B5563; margin-bottom: 24px; }
.calc-description strong { color: #1F2937; font-weight: 700; }

/* Перелинковка */
.internal-links-box { margin-top: 32px; background: #F3F4F6; padding: 24px; border-radius: 16px; border-left: 4px solid var(--trig-primary); }
.internal-links-box h4 { margin: 0 0 12px 0; font-size: 17px; color: #111827; }
.internal-links-box ul { margin: 0; padding-left: 20px; color: #4B5563; }
.internal-links-box li { margin-bottom: 8px; font-size: 15px; }
.internal-links-box a { color: var(--trig-primary); text-decoration: underline; font-weight: 600; }

/* SEO Таблица (Центрирование) */
.seo-table-wrapper { overflow-x: auto; margin-bottom: 48px; background: #fff; border-radius: 16px; border: 1px solid #E5E7EB; box-shadow: 0 4px 10px rgba(0,0,0,0.02); }
.seo-table-wrapper::-webkit-scrollbar { height: 6px; }
.seo-table-wrapper::-webkit-scrollbar-thumb { background: #D1D5DB; border-radius: 3px; }
.seo-table { width: 100%; border-collapse: collapse; min-width: 500px; text-align: left; }
.seo-table th { background: #F9FAFB; padding: 18px 24px; font-size: 13px; font-weight: 800; color: #6B7280; text-transform: uppercase; border-bottom: 1px solid #E5E7EB; letter-spacing: 0.5px; }
.seo-table td { padding: 18px 24px; font-size: 16px; font-family: 'Courier New', Courier, monospace; font-weight: 700; border-bottom: 1px solid #F3F4F6; color: #374151; vertical-align: middle; }
.seo-table tr:last-child td { border-bottom: none; }
.text-center-table th, .text-center-table td { text-align: center; }

.text-danger { color: #EF4444; }
.text-success { color: #10B981; }
.text-purple { color: #8B5CF6; }
.text-secondary { color: #9CA3AF; font-size: 14px !important; }

.faq-section .faq-item { background: #fff; border: 1px solid #E5E7EB; border-radius: 16px; margin-bottom: 16px; overflow: hidden; transition: all 0.2s ease; }
.faq-section .faq-item:hover { border-color: #D1D5DB; }
.faq-section .faq-item[open] { border-color: var(--trig-primary); box-shadow: 0 8px 20px rgba(109, 40, 217, 0.08); }
summary.faq-question { padding: 22px 28px; cursor: pointer; font-weight: 700; color: var(--text-primary); font-size: 17px; list-style: none; position: relative; display: flex; justify-content: space-between; align-items: center; transition: background 0.2s; }
.faq-section .faq-item[open] summary.faq-question { color: var(--trig-primary); background: var(--trig-bg); border-bottom: 1px solid #E5E7EB; }
.faq-question::after { content: '+'; font-size: 26px; color: #9CA3AF; font-weight: 400; line-height: 1; transition: transform 0.3s; }
.faq-section .faq-item[open] summary.faq-question::after { content: '−'; color: var(--trig-primary); }
.faq-answer, .faq-item div[itemprop="text"] { padding: 28px; color: var(--text-secondary); line-height: 1.7; font-size: 16px; background: #fff; }
.faq-answer p { margin: 0; }

@media (max-width: 900px) {
    .calc-header { margin-bottom: 32px; }
    .formulas-grid { grid-template-columns: 1fr; gap: 20px; }
    .icon-heading { font-size: 22px; gap: 12px; }
    .header-icon { width: 44px; height: 44px; font-size: 22px; }
    .formula-card { padding: 24px; }
    summary.faq-question { padding: 18px 20px; font-size: 16px; }
    .faq-answer, .faq-item div[itemprop="text"] { padding: 20px; font-size: 15px; }
}

@media (max-width: 480px) {
    .author-badge { padding: 16px; gap: 12px; align-items: flex-start; flex-direction: row; }
    .author-avatar { width: 40px; height: 40px; font-size: 18px; }
    
    .row-2-col { grid-template-columns: 1fr; gap: 16px; }
    .trig-result-card { padding: 24px 16px; }
    .dash-row { grid-template-columns: 1fr; gap: 12px; }
}