/* calc/assets/css/calculators/numeral-system-converter.css */

:root {
    --ns-primary: #10B981; /* Кибер-зеленый (Emerald-500) */
    --ns-bg: #F0FDF4;      /* Изумрудный светлый */
    --ns-dark: #064E3B;    /* Темно-зеленый */
    --ns-cyber: #0F172A;   /* Темно-синий фон (Slate-900) */
    --ns-accent: #34D399;  /* Мятный неон */
    
    --base-bin: #3B82F6; /* Синий */
    --base-oct: #F59E0B; /* Оранжевый */
    --base-dec: #10B981; /* Зеленый */
    --base-hex: #8B5CF6; /* Пурпурный */
}

/* --- ВЕРХНЯЯ ЧАСТЬ --- */
.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; } }

.form-divider { border: none; height: 1px; background: #A7F3D0; margin: 24px 0; opacity: 0.7; }
.group-title-small { font-size: 14px; font-weight: 800; color: var(--ns-primary); text-transform: uppercase; letter-spacing: 0.5px; margin: 0 0 16px 0; border-left: 3px solid var(--ns-primary); padding-left: 8px; }
.helper-text { font-size: 13px; color: #6B7280; line-height: 1.4; margin-top: 8px; font-weight: 500;}
.mt-3 { margin-top: 16px; }

/* Инпуты */
.input-group { margin-bottom: 24px; }
.label-with-icon { display: flex; align-items: center; gap: 8px; color: var(--ns-primary) !important; font-size: 15px !important; font-weight: 800 !important; margin-bottom: 12px; text-transform: uppercase; letter-spacing: 0.5px; }

.input-wrapper { position: relative; display: flex; align-items: center; }
.input-wrapper input {
    width: 100%; padding: 16px 20px;
    font-size: 24px; font-weight: 800; font-family: 'Courier New', Courier, monospace;
    border: 2px solid #D1D5DB; border-radius: 14px;
    transition: all 0.2s; outline: none; background: #fff;
    color: #111827; letter-spacing: 2px;
}
.input-wrapper input:focus { border-color: var(--ns-primary); box-shadow: 0 0 0 4px rgba(16, 185, 129, 0.15); transform: translateY(-2px); }

.highlight-group { background: var(--ns-bg); padding: 24px; border-radius: 16px; border: 2px dashed #6EE7B7; }

/* Сегмент контрол (Откуда) */
.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: #E5E7EB; 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: 12px 8px; border-radius: 9px; font-size: 14px; font-weight: 700;
    color: #4B5563; 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(--ns-primary); border-color: #D1D5DB; box-shadow: 0 4px 6px -1px rgba(0,0,0,0.05); }

/* Вертикальные карточки (Куда) */
.radio-cards-vertical { display: flex; flex-direction: column; gap: 10px; margin-bottom: 24px; }
.radio-card-v { position: relative; cursor: pointer; display: block; }
.radio-card-v input { position: absolute; opacity: 0; height: 0; width: 0; }
.rc-content {
    border: 2px solid #F3F4F6; border-radius: 14px; padding: 14px 18px;
    transition: all 0.2s; background: #fff; display: block;
}
.radio-card-v:hover .rc-content { border-color: #E5E7EB; }
.radio-card-v input:checked + .rc-content { border-color: var(--ns-primary); background: var(--ns-bg); box-shadow: 0 4px 12px rgba(16, 185, 129, 0.08); }
.rc-title { font-weight: 800; color: #1F2937; font-size: 15px; margin-bottom: 4px; }
.rc-desc { font-size: 13px; color: #6B7280; line-height: 1.4; }


/* --- ПРАВАЯ ЧАСТЬ: РЕЗУЛЬТАТ (KILLER FEATURE) --- */
@media (min-width: 992px) { .sticky-card { position: sticky; top: 24px; transition: top 0.3s; } }

.cyber-result-card {
    background: var(--ns-cyber); 
    border: 2px solid #1E293B; padding: 32px;
    border-top: 6px solid var(--ns-primary); border-radius: 20px;
    box-shadow: 0 20px 40px -10px rgba(15, 23, 42, 0.8);
    color: #F8FAFC;
    /* Текстура кода на фоне */
    background-image: radial-gradient(rgba(16, 185, 129, 0.05) 1px, transparent 1px);
    background-size: 20px 20px;
}

.result-header-neon { text-align: center; margin-bottom: 32px; }
.result-header-neon h2 { font-size: 16px; font-weight: 800; color: #94A3B8; margin: 0; text-transform: uppercase; letter-spacing: 2px; }

/* Матрица результатов */
.cyber-matrix { display: flex; flex-direction: column; gap: 12px; margin-bottom: 32px; }
.cm-row { 
    display: flex; justify-content: space-between; align-items: center; 
    background: #1E293B; padding: 16px 20px; border-radius: 12px; 
    border: 1px solid #334155; transition: border-color 0.3s;
}
.cm-row.active { border-color: var(--ns-primary); box-shadow: 0 0 15px rgba(16, 185, 129, 0.2); }

.cm-label { font-size: 14px; font-weight: 800; color: #94A3B8; display: flex; align-items: center; gap: 8px; width: 80px;}
.cm-base { background: #334155; color: #fff; font-size: 10px; padding: 2px 6px; border-radius: 4px; }

.cm-val-box { display: flex; align-items: center; gap: 16px; flex-grow: 1; justify-content: flex-end; overflow: hidden;}
.cm-val { 
    font-size: 24px; font-weight: 800; color: #F8FAFC; 
    font-family: 'Courier New', Courier, monospace; letter-spacing: 1px; 
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
#row-bin .cm-val { color: var(--base-bin); text-shadow: 0 0 10px rgba(59, 130, 246, 0.4); }
#row-oct .cm-val { color: var(--base-oct); text-shadow: 0 0 10px rgba(245, 158, 11, 0.4); }
#row-dec .cm-val { color: var(--base-dec); text-shadow: 0 0 10px rgba(16, 185, 129, 0.4); }
#row-hex .cm-val { color: var(--base-hex); text-shadow: 0 0 10px rgba(139, 92, 246, 0.4); }

.cm-copy { 
    background: transparent; border: 1px solid #475569; color: #94A3B8; 
    width: 36px; height: 36px; border-radius: 8px; cursor: pointer; 
    transition: all 0.2s; display: flex; align-items: center; justify-content: center; font-size: 16px; flex-shrink: 0;
}
.cm-copy:hover { background: #334155; color: #fff; border-color: #94A3B8; }
.cm-copy:active { transform: scale(0.9); }

.cyber-divider { height: 1px; background: #334155; margin: 32px 0; }

/* KILLER FEATURE: Терминал с решением */
.terminal-wrapper { background: #000; border-radius: 12px; border: 1px solid #334155; overflow: hidden; box-shadow: inset 0 0 20px rgba(0,0,0,0.8); }
.term-header { background: #1E293B; padding: 10px 16px; display: flex; align-items: center; gap: 16px; border-bottom: 1px solid #334155; }
.term-dots { display: flex; gap: 6px; }
.term-dots span { width: 12px; height: 12px; border-radius: 50%; }
.dot-red { background: #EF4444; } .dot-yel { background: #F59E0B; } .dot-grn { background: #10B981; }
.term-title { font-size: 12px; color: #94A3B8; font-weight: 700; font-family: monospace; text-transform: uppercase; letter-spacing: 1px;}

.term-body { 
    padding: 20px; font-family: 'Courier New', Courier, monospace; 
    font-size: 15px; color: var(--ns-primary); line-height: 1.6;
    max-height: 350px; overflow-y: auto;
}
/* Стилизация скроллбара в терминале */
.term-body::-webkit-scrollbar { width: 6px; }
.term-body::-webkit-scrollbar-thumb { background: #334155; border-radius: 3px; }

/* Стили элементов решения внутри JS */
.ts-step { margin-bottom: 12px; color: #A7F3D0; }
.ts-math { font-weight: 800; color: #fff; margin-left: 12px; letter-spacing: 1px;}
.ts-res { color: var(--ns-primary); font-weight: 800; }
.ts-rem { color: var(--base-oct); font-weight: 800; border: 1px solid var(--base-oct); padding: 0 4px; border-radius: 4px; margin-left: 4px;}
.ts-final { margin-top: 16px; padding-top: 16px; border-top: 1px dashed #334155; color: #fff; font-weight: 800; font-size: 18px;}

/* Ошибка */
.cyber-error { background: rgba(239, 68, 68, 0.1); border: 1px solid #7F1D1D; color: #FCA5A5; padding: 16px; border-radius: 12px; font-size: 14px; font-weight: 600; display: flex; align-items: center; gap: 12px; margin-top: 24px; }
.cyber-error i { font-size: 24px; color: #EF4444; }


/* --- НИЖНЯЯ ЧАСТЬ (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(--ns-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; }

.green-icon { color: var(--ns-primary); }
.dark-icon { color: var(--ns-cyber); }

.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(16, 185, 129, 0.1); border-color: rgba(16, 185, 129, 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-green { background: var(--ns-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: var(--ns-cyber); 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; }

.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; }

/* Таблица 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: 15px; border-bottom: 1px solid #F3F4F6; color: #374151; vertical-align: top; line-height: 1.5; }
.seo-table tr:last-child td { border-bottom: none; }

.text-success { color: #10B981; font-weight: 700; }
.text-mono { font-family: 'Courier New', Courier, monospace; font-weight: 800; color: var(--ns-primary); background: var(--ns-bg); padding: 4px 8px; border-radius: 6px;}

/* Перелинковка */
.internal-links-box { margin-top: 32px; background: #F3F4F6; padding: 24px; border-radius: 16px; border-left: 4px solid var(--ns-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(--ns-primary); text-decoration: underline; font-weight: 600; }

.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(--ns-primary); box-shadow: 0 8px 20px rgba(16, 185, 129, 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(--ns-primary); background: var(--ns-bg); border-bottom: 1px solid #A7F3D0; }
.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(--ns-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; }
    
    .input-wrapper input { padding: 14px; font-size: 20px; }
    .cyber-result-card { padding: 24px 16px; }
    
    .cm-row { padding: 12px 16px; flex-wrap: wrap; gap: 8px;}
    .cm-val { font-size: 20px; }
    .term-body { font-size: 13px; padding: 16px; }
}