/* ============================================================
   Стили для страницы технической информации о процессорах
   ============================================================ */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Roboto, system-ui, -apple-system, sans-serif;
    background-color: #eef3f8;
    display: flex;
    justify-content: center;
    align-items: flex-start;
    min-height: 100vh;
    padding: 2rem 1.5rem;
    margin: 0;
}

.service-card {
    max-width: 1400px;
    width: 100%;
    background: #ffffff;
    border-radius: 2rem;
    box-shadow: 0 30px 50px -20px rgba(0, 0, 0, 0.25);
    overflow: hidden;
    transition: box-shadow 0.3s ease;
}
.service-card:hover {
    box-shadow: 0 30px 55px -12px rgba(0, 0, 0, 0.25);
}

.service-header {
    background: linear-gradient(105deg, #124c66 0%, #1f6e8c 100%);
    padding: 2rem 3rem;
    color: #ffffff;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}
.service-header h1 {
    font-size: 2.2rem;
    font-weight: 800;
    letter-spacing: -0.02em;
    margin-bottom: 0.2rem;
    color: #ffffff;
}
.service-header p {
    font-size: 1.1rem;
    font-weight: 400;
    opacity: 0.9;
}

.service-content {
    padding: 2rem 2.5rem 2.5rem;
}

/* ===== Табы ===== */
.tabs {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
    border-bottom: 2px solid #d4e2ec;
    padding-bottom: 0.5rem;
    flex-wrap: wrap;
}
.tabs-left {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    flex: 1 1 auto;
}
.tabs-right {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    align-items: center;
    flex-shrink: 0;
}
.tab-button {
    background: none;
    border: none;
    padding: 0.6rem 1.8rem;
    font-size: 1rem;
    font-weight: 600;
    color: #5c7f8c;
    border-radius: 2rem 2rem 0 0;
    cursor: pointer;
    transition: background 0.2s, color 0.2s, border-color 0.2s;
    border-bottom: 3px solid transparent;
    font-family: inherit;
    white-space: nowrap;
}
.tab-button:hover {
    background: #eef3f8;
    color: #0f3b4f;
}
.tab-button.active {
    color: #1d6f8b;
    border-bottom-color: #1d6f8b;
    background: #f8fafc;
}

.btn-reset,
.btn-compare {
    background: transparent;
    border: 1.5px solid #1d6f8b;
    color: #1d6f8b;
    padding: 0.4rem 1.4rem;
    border-radius: 40px;
    font-weight: 600;
    font-size: 0.9rem;
    cursor: pointer;
    transition: background 0.2s, color 0.2s, box-shadow 0.2s;
    font-family: inherit;
    white-space: nowrap;
    flex-shrink: 0;
}
.btn-reset:hover,
.btn-compare:hover {
    background: #1d6f8b;
    color: #ffffff;
    box-shadow: 0 4px 12px rgba(29, 111, 139, 0.25);
}
.btn-reset:active,
.btn-compare:active {
    transform: scale(0.96);
}
.btn-compare {
    background: #1d6f8b;
    color: #ffffff;
    border-color: #1d6f8b;
}
.btn-compare:hover {
    background: #155a73;
    border-color: #155a73;
}

.compare-counter {
    display: inline-block;
    background: #1d6f8b;
    color: #fff;
    font-weight: 700;
    font-size: 0.85rem;
    padding: 0.2rem 0.8rem;
    border-radius: 40px;
    min-width: 28px;
    text-align: center;
    line-height: 1.4;
    box-shadow: 0 2px 8px rgba(29, 111, 139, 0.2);
}

.tab-content {
    display: none;
}
.tab-content.active {
    display: block;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}

/* ===== Таблица ===== */
.table-responsive {
    overflow-x: auto;
    border-radius: 1rem;
    border: 1px solid #e2edf2;
    background: #fff;
}

table.processor-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.85rem;
    table-layout: fixed; /* обеспечивает соблюдение заданных ширин */
    word-break: break-word;
}

table.processor-table thead {
    background: #f8fafc;
}
table.processor-table th {
    text-align: left;
    padding: 0.6rem 0.4rem;
    font-weight: 600;
    color: #0f3b4f;
    border-bottom: 1.5px solid #d4e2ec;
    white-space: nowrap;
    position: sticky;
    top: 0;
    background: #f8fafc;
    z-index: 2;
}
table.processor-table td {
    padding: 0.5rem 0.4rem;
    border-bottom: 1px solid #e2edf2;
    vertical-align: middle;
}
table.processor-table tbody tr:hover {
    background: #fafcff;
}
table.processor-table tbody tr:last-child td {
    border-bottom: none;
}

/* ====== Ширина колонки чекбоксов задаётся в HTML (inline-стили) ====== */
/* Здесь мы не указываем width, min-width, max-width для первой колонки, */
/* чтобы они не конфликтовали с inline-стилями. */
table.processor-table th:first-child,
table.processor-table td:first-child {
    text-align: center;
    padding: 0.2rem 0.1rem;
    box-sizing: border-box;
}

/* Остальные колонки */
table.processor-table th:nth-child(2),
table.processor-table td:nth-child(2) {
    width: 18%;
}
table.processor-table th:nth-child(3),
table.processor-table td:nth-child(3) {
    width: 6%;
}
table.processor-table th:nth-child(4),
table.processor-table td:nth-child(4) {
    width: 8%;
}
table.processor-table th:nth-child(5),
table.processor-table td:nth-child(5) {
    width: 8%;
}
table.processor-table th:nth-child(6),
table.processor-table td:nth-child(6) {
    width: 7%;
}
table.processor-table th:nth-child(7),
table.processor-table td:nth-child(7) {
    width: 7%;
}
table.processor-table th:nth-child(8),
table.processor-table td:nth-child(8) {
    width: 10%;
}
table.processor-table th:nth-child(9),
table.processor-table td:nth-child(9) {
    width: 8%;
}
table.processor-table th:nth-child(10),
table.processor-table td:nth-child(10) {
    width: 7%;
}
table.processor-table th:nth-child(11),
table.processor-table td:nth-child(11) {
    width: 8%;
}

/* Чекбоксы – размер остаётся прежним */
table.processor-table input[type="checkbox"] {
    width: 14px;
    height: 14px;
    cursor: pointer;
    accent-color: #1d6f8b;
    margin: 0 auto;
    display: block;
}

/* ===== Строка фильтров ===== */
.filter-cell {
    padding: 0.35rem 0.3rem !important;
    background: #f9fcfe;
    border-bottom: 2px solid #d4e2ec;
    vertical-align: middle;
}
.filter-cell input,
.filter-cell select {
    width: 100%;
    padding: 0.3rem 0.5rem;
    border: 1.5px solid #d4e2ec;
    border-radius: 40px;
    font-size: 0.7rem;
    font-family: inherit;
    background: #ffffff;
    transition: border-color 0.25s, box-shadow 0.25s;
    outline: none;
    min-height: 28px;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.04);
    box-sizing: border-box;
}
.filter-cell input:focus,
.filter-cell select:focus {
    border-color: #1d6f8b;
    box-shadow: 0 0 0 4px rgba(29, 111, 139, 0.08), 0 2px 8px rgba(0, 0, 0, 0.06);
}
.filter-cell input::placeholder {
    color: #b0c8d4;
    font-size: 0.65rem;
}
.filter-cell select {
    appearance: none;
    cursor: pointer;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8'%3E%3Cpath d='M0 0l6 8 6-8z' fill='%236b8fa0'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.8rem center;
    background-size: 12px 8px;
    padding-right: 2rem;
}
.filter-cell select option {
    font-size: 0.7rem;
}
.filter-cell.empty-filter {
    background: transparent !important;
    border-bottom: none !important;
}

/* Счётчик в футере */
#footer-counter {
    font-weight: 600;
    color: #1d6f8b;
    background: #eef3f8;
    padding: 0.2rem 1rem;
    border-radius: 2rem;
    font-size: 0.9rem;
    white-space: nowrap;
}

.footer-info {
    margin-top: 2rem;
    padding-top: 1.5rem;
    border-top: 2px solid #d4e2ec;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 1rem 2rem;
    font-size: 0.9rem;
    color: #5c7f8c;
}
.footer-info .links {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem 2rem;
    align-items: center;
}
.footer-info .links a {
    color: #1d6f8b;
    text-decoration: none;
    font-weight: 500;
    cursor: pointer;
}
.footer-info .links a:hover {
    text-decoration: underline;
}

/* ===== Модальное окно сравнения ===== */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(18, 76, 102, 0.55);
    backdrop-filter: blur(4px);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    padding: 1.5rem;
}
.modal-overlay.active {
    display: flex;
    animation: fadeIn 0.25s ease;
}
.modal-box {
    background: #fff;
    border-radius: 2rem;
    max-width: 620px;
    width: 100%;
    padding: 2rem 2.5rem 2rem;
    box-shadow: 0 25px 60px rgba(0, 0, 0, 0.18);
    position: relative;
    max-height: 90vh;
    overflow-y: auto;
}
.modal-box h2 {
    font-size: 1.5rem;
    font-weight: 700;
    color: #0f3b4f;
    margin-bottom: 1rem;
}
.close-modal {
    position: absolute;
    top: 1rem;
    right: 1.5rem;
    font-size: 2rem;
    line-height: 1;
    color: #94a3b8;
    cursor: pointer;
    background: none;
    border: none;
    font-family: inherit;
    transition: color 0.15s;
}
.close-modal:hover {
    color: #0f3b4f;
}
.modal-footer {
    margin-top: 1.5rem;
    display: flex;
    justify-content: flex-end;
}
.btn-close-modal {
    background: #eef3f8;
    border: none;
    padding: 0.6rem 2rem;
    border-radius: 40px;
    font-weight: 500;
    font-size: 0.95rem;
    cursor: pointer;
    font-family: inherit;
    transition: background 0.15s;
}
.btn-close-modal:hover {
    background: #e2eaf2;
}

/* Модальное окно сравнения – ширина и пропорциональные колонки */
.modal-compare {
    max-width: 95%;
    width: auto;
    min-width: 80%;
}
@media (min-width: 1200px) {
    .modal-compare {
        max-width: 1400px;
        min-width: 1000px;
    }
}
.modal-compare .table-responsive {
    max-height: 70vh;
    overflow-y: auto;
}
.modal-compare .compare-table {
    width: 100%;
    table-layout: fixed;
    font-size: 0.85rem;
    border-collapse: collapse;
}
.modal-compare .compare-table th,
.modal-compare .compare-table td {
    padding: 0.5rem 0.6rem;
    text-align: center;
    border-bottom: 1px solid #e2edf2;
    word-break: break-word;
}
.modal-compare .compare-table th {
    background: #f8fafc;
    font-weight: 600;
    color: #0f3b4f;
    border-bottom: 2px solid #d4e2ec;
    white-space: nowrap;
}
.modal-compare .compare-table td:first-child,
.modal-compare .compare-table th:first-child {
    width: 12%;
    text-align: left;
    font-weight: 600;
    color: #0f3b4f;
    background: #f9fcfe;
    white-space: nowrap;
    padding-right: 1rem;
}
.modal-compare .compare-table td:not(:first-child),
.modal-compare .compare-table th:not(:first-child) {
    width: auto;
}
.modal-compare .compare-table tbody tr:hover td {
    background: #fafcff;
}

.no-results {
    padding: 2rem;
    text-align: center;
    color: #5c7f8c;
    font-size: 1.1rem;
    font-weight: 500;
}

/* ===== Адаптивность ===== */
@media (max-width: 992px) {
    .service-content {
        padding: 1.5rem 1.2rem 2rem;
    }
    .service-header {
        padding: 1.5rem 1.5rem;
    }
    .service-header h1 {
        font-size: 1.8rem;
    }
    .tabs {
        flex-direction: column;
        align-items: stretch;
    }
    .tabs-left {
        justify-content: center;
    }
    .tabs-right {
        justify-content: center;
    }
    table.processor-table {
        font-size: 0.75rem;
    }
    table.processor-table th,
    table.processor-table td {
        padding: 0.3rem 0.3rem;
    }
    .filter-cell input,
    .filter-cell select {
        font-size: 0.65rem;
        padding: 0.2rem 0.4rem;
        min-height: 24px;
        border-radius: 30px;
    }
    .modal-compare {
        min-width: auto;
        width: 95%;
    }
    .modal-compare .compare-table {
        font-size: 0.7rem;
    }
    .modal-compare .compare-table th,
    .modal-compare .compare-table td {
        padding: 0.3rem 0.4rem;
    }
}

@media (max-width: 768px) {
    body {
        padding: 1rem 0.5rem;
    }
    .service-card {
        border-radius: 1.5rem;
    }
    .service-header h1 {
        font-size: 1.4rem;
    }
    .service-header p {
        font-size: 0.95rem;
    }
    .tab-button {
        padding: 0.4rem 1.2rem;
        font-size: 0.9rem;
    }
    .btn-reset,
    .btn-compare {
        padding: 0.3rem 1rem;
        font-size: 0.8rem;
    }
    table.processor-table {
        font-size: 0.7rem;
    }
    table.processor-table th,
    table.processor-table td {
        padding: 0.25rem 0.2rem;
    }
    /* Ширина первой колонки задаётся в HTML, поэтому здесь не трогаем */
    .filter-cell {
        padding: 0.15rem 0.15rem !important;
    }
    .filter-cell input,
    .filter-cell select {
        font-size: 0.55rem;
        padding: 0.15rem 0.3rem;
        min-height: 20px;
        border-radius: 20px;
    }
    .footer-info {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }
    .modal-compare .compare-table {
        font-size: 0.6rem;
    }
    .modal-compare .compare-table th,
    .modal-compare .compare-table td {
        padding: 0.2rem 0.3rem;
    }
}

@media (max-width: 480px) {
    .service-header h1 {
        font-size: 1.2rem;
    }
    .tab-button {
        font-size: 0.75rem;
        padding: 0.3rem 0.6rem;
    }
    .btn-reset,
    .btn-compare {
        font-size: 0.7rem;
        padding: 0.2rem 0.8rem;
    }
    table.processor-table {
        font-size: 0.6rem;
    }
    table.processor-table th,
    table.processor-table td {
        padding: 0.15rem 0.1rem;
    }
    .service-content {
        padding: 0.8rem 0.3rem 1rem;
    }
    .filter-cell input,
    .filter-cell select {
        font-size: 0.5rem;
        padding: 0.1rem 0.2rem;
        min-height: 18px;
        border-radius: 16px;
    }
    .modal-compare .compare-table {
        font-size: 0.55rem;
    }
    .modal-compare .compare-table th,
    .modal-compare .compare-table td {
        padding: 0.15rem 0.2rem;
    }
}