/* --- 1. Глобальные настройки и Тема (Техно/Мистерия) --- */
:root {
    --bg-color: #0D0F18; /* Глубокий темно-синий/черный */
    --card-bg: #131624; /* Чуть светлее для карточек */
    --text-color: #E0E0E0; /* Светло-серый текст */
    --text-secondary: #7A839E; /* Вторичный приглушенный текст */
    --accent-color: #00F0FF; /* Яркий "техно" циан */
    --danger-color: #FF4A4A; /* Для предупреждений */
    --safe-color: #00FF8C; /* Для "безопасно" */
    
    --font-main: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: var(--font-main);
    background-color: var(--bg-color);
    color: var(--text-color);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* --- 2. Хедер и Навигация --- */
.site-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 1.5rem;
    border-bottom: 1px solid #2a2e42;
}

.logo {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-color);
    text-decoration: none;
}

.logo span {
    color: var(--accent-color);
}

.header-controls {
    display: flex;
    gap: 1rem;
    align-items: center;
}

.nav-button {
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 1.2rem;
    font-weight: 600;
    cursor: pointer;
    padding: 0.5rem;
    transition: color 0.2s;
    line-height: 1; 
}

.nav-button:hover {
    color: var(--accent-color);
}

/* --- 3. Всплывающее меню --- */
.popup-menu {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(13, 15, 24, 0.9);
    backdrop-filter: blur(10px);
    z-index: 1000;
    display: none;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.popup-menu.active {
    display: flex;
    opacity: 1;
}

.popup-menu-close {
    position: absolute;
    top: 1.2rem;
    right: 1.5rem;
    font-size: 2.5rem;
    line-height: 1;
}

.popup-nav {
    list-style: none;
    text-align: center;
}

.popup-nav-item {
    margin: 1.5rem 0;
}

.popup-nav-link {
    color: var(--text-color);
    text-decoration: none;
    font-size: 1.5rem;
    font-weight: 500;
    transition: color 0.2s;
}

.popup-nav-link:hover {
    color: var(--accent-color);
}

.popup-nav-label {
    color: var(--text-secondary);
    font-size: 1rem;
    font-weight: 600;
    text-transform: uppercase;
    margin-bottom: 0.5rem;
    display: block;
}

/* --- 4. Основной контент --- */
.main-content {
    flex-grow: 1;
    padding: 1.5rem;
    width: 100%;
    max-width: 900px;
    margin: 0 auto;
}

.content-block {
    background-color: var(--card-bg);
    border-radius: 12px;
    border: 1px solid #2a2e42;
    margin-bottom: 1.5rem;
    overflow: hidden;
}

.block-header {
    padding: 1rem 1.5rem;
    border-bottom: 1px solid #2a2e42;
}

.block-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-color);
}

.block-content {
    padding: 1.5rem;
}

/* --- 5. Блок 1: Скоринг --- */
.anonymity-score {
    text-align: center;
}

.score-gauge {
    font-size: 4rem;
    font-weight: 700;
    margin: 1rem 0;
    color: var(--danger-color); 
    text-shadow: 0 0 15px var(--danger-color);
    transition: color 0.3s, text-shadow 0.3s;
}

.score-status {
    font-size: 1.25rem;
    font-weight: 500;
    margin-bottom: 1rem;
}

.score-details {
    font-size: 0.9rem;
    color: var(--text-secondary);
    line-height: 1.5;
}

/* --- 6. Блок 2: Информация о подключении --- */
.connection-info-list {
    list-style: none;
}

.info-item {
    display: flex;
    align-items: baseline; 
    padding: 0.8rem 0;
    font-size: 0.95rem;
    border-bottom: 1px solid #222534;
}

.info-item:last-child {
    border-bottom: none;
}

.info-label {
    color: var(--text-secondary);
    margin-right: 1rem;
    word-break: break-word; 
}

.info-value {
    color: var(--text-color);
    font-weight: 500;
    text-align: right;
    word-break: break-all;
    flex-grow: 1; 
}

/* --- 7. Футер --- */
.site-footer {
    text-align: center;
    padding: 2rem 1.5rem;
    font-size: 0.85rem;
    color: var(--text-secondary);
    border-top: 1px solid #2a2e42;
    margin-top: auto;
}

/* --- 8. Адаптивность --- */
@media (min-width: 768px) {
    .main-content {
        padding: 2rem;
    }
    .logo {
        font-size: 1.4rem;
    }
    .block-title {
        font-size: 1.25rem;
    }
    .score-gauge {
        font-size: 5rem;
    }
    .info-item {
        font-size: 1rem;
    }
}

/* --- 9. Стили для Вкладок --- */
.tabs-container .block-header {
    display: none; 
}
.tab-headers {
    display: flex;
    background-color: var(--bg-color);
    border-bottom: 1px solid #2a2e42;
    padding: 0 0.5rem;
}
.tab-header {
    background: none;
    border: none;
    border-bottom: 3px solid transparent;
    color: var(--text-secondary);
    font-family: var(--font-main);
    font-size: 1rem;
    font-weight: 600;
    padding: 1rem 1.25rem;
    cursor: pointer;
    transition: color 0.2s, border-color 0.2s;
    margin-bottom: -1px;
}
.tab-header:hover {
    color: var(--text-color);
}
.tab-header.active {
    color: var(--accent-color);
    border-bottom-color: var(--accent-color);
}
.tab-content {
    display: none;
}
.tab-content.active {
    display: block;
    animation: fadeIn 0.3s ease-in-out;
}
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* --- 10. Стили для Иконки-подсказки --- */
.info-label {
    color: var(--text-secondary);
    margin-right: 1rem;
    word-break: break-word; 
}
.info-tooltip {
    display: inline-block; 
    width: 16px;
    height: 16px;
    flex-shrink: 0; 
    border: 1px solid var(--text-secondary);
    border-radius: 50%;
    color: var(--text-secondary);
    font-size: 0.7rem;
    line-height: 14px; 
    text-align: center;
    font-style: italic;
    font-family: 'Times New Roman', Times, serif;
    cursor: help;
    margin-left: 6px; 
    transition: all 0.2s;
    position: relative; 
    vertical-align: middle; 
}
.info-tooltip:hover {
    background-color: var(--accent-color);
    color: var(--card-bg);
    border-color: var(--accent-color);
}

/* --- 11. Стили для Подвала --- */
.site-footer {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    align-items: center;
    text-align: center;
    padding: 2rem 1.5rem;
    font-size: 0.85rem;
    color: var(--text-secondary);
    border-top: 1px solid #2a2e42;
    margin-top: auto;
}
.footer-nav {
    display: flex;
    gap: 1.5rem;
}
.footer-link {
    color: var(--text-secondary);
    text-decoration: none;
    transition: color 0.2s;
}
.footer-link:hover {
    color: var(--accent-color);
}
@media (min-width: 768px) {
    .site-footer {
        flex-direction: row;
        justify-content: space-between;
    }
}

/* --- 12. Стили для Списка языков --- */
.lang-switcher {
    position: relative;
}
.lang-switcher-toggle {
    display: flex;
    align-items: center;
    gap: 0.3rem;
}
.lang-switcher-toggle .arrow-down {
    font-size: 0.7rem;
    transition: transform 0.2s;
}
.lang-switcher-toggle[aria-expanded="true"] .arrow-down {
    transform: rotate(180deg);
}
.lang-dropdown {
    position: absolute;
    top: 100%;
    right: 0;
    background-color: var(--card-bg);
    border: 1px solid #2a2e42;
    border-radius: 8px;
    list-style: none;
    margin-top: 0.5rem;
    padding: 0.5rem;
    min-width: 150px;
    z-index: 1100;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: opacity 0.2s, transform 0.2s, visibility 0.2s;
}
.lang-dropdown.active {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}
.lang-option {
    display: block;
    color: var(--text-color);
    text-decoration: none;
    padding: 0.5rem 0.75rem;
    border-radius: 4px;
    font-size: 0.9rem;
}
.lang-option:hover,
.lang-option:focus {
    background-color: #2a2e42;
    outline: none;
}
.lang-option.active {
    color: var(--accent-color);
    font-weight: 600;
}

/* --- 13. Стили для Детализации скоринга --- */
.score-breakdown {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.5rem;
    margin-top: 1.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid #2a2e42;
    text-align: left;
}
@media (min-width: 500px) {
    .score-breakdown {
        grid-template-columns: 1fr 1fr;
    }
}
.score-breakdown h3 {
    font-size: 0.9rem;
    font-weight: 600;
    text-transform: uppercase;
    margin-bottom: 0.75rem;
}
.score-breakdown ul {
    list-style: none;
    font-size: 0.95rem;
    padding-left: 0;
}
.score-breakdown li {
    margin-bottom: 0.5rem;
    position: relative;
    padding-left: 22px;
}
.score-breakdown li::before {
    content: '';
    position: absolute;
    left: 0;
    top: 3px;
    width: 14px;
    height: 14px;
    border-radius: 50%;
}
.breakdown-passed h3 {
    color: var(--safe-color);
}
.breakdown-passed li::before {
    content: '✓';
    font-size: 0.8rem;
    line-height: 14px;
    text-align: center;
    background-color: var(--safe-color);
    color: var(--card-bg);
}
.breakdown-failed h3 {
    color: var(--danger-color);
}
.breakdown-failed li::before {
    content: '×';
    font-size: 0.8rem;
    line-height: 14px;
    text-align: center;
    background-color: var(--danger-color);
    color: var(--card-bg);
}
.breakdown-failed .test-impact,
.breakdown-passed .test-impact {
    color: var(--text-secondary);
    font-size: 0.9em;
    margin-left: 0.25rem;
}

/* --- 14. Вспомогательный класс --- */
.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    margin: -1px;
    padding: 0;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    border: 0;
}

/* --- 15. Стили для Всплывающих подсказок --- */
.tooltip-popup {
    position: absolute; 
    background-color: var(--card-bg);
    border: 1px solid var(--accent-color);
    border-radius: 8px;
    padding: 0.75rem 1rem;
    color: var(--text-color);
    font-size: 0.9rem;
    line-height: 1.5;
    max-width: 300px;
    z-index: 2000;
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px);
    transition: opacity 0.2s, transform 0.2s, visibility 0.2s;
    box-shadow: 0 5px 20px rgba(0, 240, 255, 0.1);
    left: 0;
    top: 0; 
}
.tooltip-popup.active {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}
@media (max-width: 480px) {
    .tooltip-popup {
        width: calc(100vw - 20px); 
        max-width: none;
    }
}

/* --- 16. Исправления CLS (Смещение макета) --- */
.score-breakdown h3 {
    min-height: 1.2em; 
    font-size: 0.9rem;
    font-weight: 600;
    text-transform: uppercase;
    margin-bottom: 0.75rem;
}
.score-breakdown ul {
    min-height: 4.5em; 
    list-style: none;
    font-size: 0.95rem;
    padding-left: 0;
}
.score-gauge {
    min-height: 1.2em; 
}
.score-status {
    min-height: 2.5em; 
}
.score-details {
    min-height: 4.5em; 
}
.info-value {
    display: inline-block; 
    min-height: 1.2em; 
    min-width: 40px; 
    text-align: right;
    flex-grow: 1;
}

/* --- 17. Стили для текстовых/статических страниц (Privacy, About) --- */
.block-content h2 {
    margin-top: 1.75rem;
    margin-bottom: 0.75rem;
}
.block-content h3 {
    margin-top: 1.25rem;
    margin-bottom: 0.5rem;
}
.block-content p {
    margin-bottom: 1rem;
}
.block-content > *:first-child {
    margin-top: 0;
}

/* --- 18. Стили для страницы "About" --- */
.about-page-content {
    display: flex;
    flex-direction: column;
    align-items: center;
}
.about-author-img {
    width: 200px;
    height: 200px;
    border-radius: 50%;
    object-fit: cover;
    margin-bottom: 1.5rem;
    flex-shrink: 0;
    border: 3px solid var(--accent-color);
    box-shadow: 0 0 15px rgba(0, 240, 255, 0.2);
}
.about-text-content {
    flex-grow: 1;
    line-height: 1.6;
}
.about-text-content h2 {
    margin-top: 1.75rem;
    margin-bottom: 0.75rem;
}
.about-text-content p,
.about-text-content ul {
    margin-bottom: 1rem;
}
.about-text-content ul {
    list-style-position: inside;
    padding-left: 0.5rem;
}
.about-text-content a {
    color: var(--accent-color);
    text-decoration: none;
}
.about-text-content a:hover {
    text-decoration: underline;
}
@media (min-width: 768px) {
    .about-page-content {
        flex-direction: row;
        align-items: flex-start;
    }
    .about-author-img {
        margin-right: 2.5rem;
        margin-bottom: 1rem;
    }
}

/* --- 19. Стиль для кликабельного IP --- */
#info-ip[data-copyable="true"],
#result-ip[data-copyable="true"] {
    cursor: pointer;
    border-bottom: 1px dashed var(--accent-color);
    transition: border-color 0.2s, color 0.2s;
    display: inline-block; 
}
#info-ip[data-copyable="true"]:hover,
#result-ip[data-copyable="true"]:hover {
    color: var(--accent-color);
}


/* --- 20. Стиль для уведомления о копировании --- */
.copy-notification {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%) translateY(20px);
    background-color: var(--safe-color);
    color: var(--bg-color);
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    font-weight: 600;
    z-index: 3000;
    box-shadow: 0 4px 15px rgba(0, 255, 140, 0.2);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s, transform 0.3s;
}
.copy-notification.active {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) translateY(0);
}

/* --- 21. Стиль для даты обновления БД в футере (Исправление CLS) --- */
.footer-db-date {
    display: inline;
}
#db-update-date {
    display: inline-block;
    min-width: 80px;
    min-height: 1.2em;
    text-align: left;
    vertical-align: middle; 
}
@media (max-width: 767px) {
    .footer-db-date {
        display: block;
        margin-top: 0.5rem;
    }
    #db-update-date {
        text-align: center;
    }
}

/* --- 22. Стили для формы IP Lookup --- */
.lookup-form {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}
.lookup-input {
    flex-grow: 1;
    background-color: var(--bg-color);
    border: 1px solid #2a2e42;
    border-radius: 8px;
    padding: 0.8rem 1rem;
    font-size: 1rem;
    font-family: var(--font-main);
    color: var(--text-color);
    transition: border-color 0.2s, box-shadow 0.2s;
}
.lookup-input:focus {
    outline: none;
    border-color: var(--accent-color);
    box-shadow: 0 0 10px rgba(0, 240, 255, 0.2);
}
.lookup-input::placeholder {
    color: var(--text-secondary);
    opacity: 0.8;
}
.lookup-button {
    background-color: var(--accent-color);
    color: var(--bg-color);
    font-family: var(--font-main);
    font-size: 1rem;
    font-weight: 700;
    border: none;
    border-radius: 8px;
    padding: 0.8rem 1.5rem;
    cursor: pointer;
    transition: opacity 0.2s;
    flex-shrink: 0;
}
.lookup-button:hover {
    opacity: 0.85;
}
.lookup-button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}
@media (min-width: 600px) {
    .lookup-form {
        flex-direction: row;
    }
}

/* --- (НОВЫЙ БЛОК) 23. Стили для статусов полей --- */
/* (ИЗМЕНЕНО) Этот селектор теперь работает в обоих случаях */
.info-value.text-safe,
.info-value .text-safe {
    color: var(--safe-color);
    font-weight: 500;
}
.info-value.text-danger,
.info-value .text-danger {
    color: var(--danger-color);
    font-weight: 500;
}
.info-value.text-warning-1,
.info-value .text-warning-1 {
    color: hsl(50, 90%, 60%); /* Желтый */
    font-weight: 500;
}
.info-value.text-warning-2,
.info-value .text-warning-2 {
    color: hsl(30, 90%, 60%); /* Оранжевый */
    font-weight: 500;
}

/* Сбрасываем стиль подчеркивания для цветного IP */
#info-ip[data-copyable="true"].text-safe,
#info-ip[data-copyable="true"].text-danger,
#info-ip[data-copyable="true"].text-warning-1,
#info-ip[data-copyable="true"].text-warning-2 {
    border-bottom-color: transparent;
}

/* ... (весь ваш CSS с Блоками 1-23) ... */

/* --- (НОВЫЙ БЛОК) 24. Стиль для H1 на главной странице --- */

.main-page-title {
    font-size: 1.6rem; /* Крупнее обычного текста, но меньше .score-gauge */
    font-weight: 500; /* Не слишком жирный (medium) */
    color: var(--text-secondary); /* (ИЗМЕНЕНО) Приглушенный, не "кричащий" цвет */
    text-align: center;
    margin-bottom: 1.5rem; /* Отступ до блока скоринга */
    line-height: 1.4;
}

@media (max-width: 600px) {
    .main-page-title {
        font-size: 1.3rem; /* Чуть меньше на мобильных */
    }
}

/* Выравнивание контейнера копирайта */
.footer-copyright {
    display: flex;
    align-items: center;
    justify-content: center; /* Или left, если у тебя футер слева */
    flex-wrap: wrap; /* Чтобы на мобилках переносилось, если не влезает */
    gap: 10px; /* Расстояние между элементами */
    font-size: 0.9em; /* Чуть меньше основного текста */
    color: #888; /* Цвет текста в футере */
}

/* Разделитель (палочка |) */
.separator {
    color: #555; /* Чуть тусклее текста */
    margin: 0 2px;
}

/* Сама ссылка статуса */
.live-status-link {
    display: inline-flex;
    align-items: center;
    text-decoration: none;
    color: inherit; /* Берит цвет родителя */
    transition: opacity 0.3s ease, color 0.3s ease;
    font-weight: 500;
}

.live-status-link:hover {
    color: #fff; /* При наведении становится ярче (если фон темный) */
    /* Или color: #000; если фон светлый */
}

/* Зеленая точка */
.live-dot {
    width: 8px;
    height: 8px;
    background-color: #2ecc71;
    border-radius: 50%;
    margin-right: 8px;
    position: relative;
    box-shadow: 0 0 5px rgba(46, 204, 113, 0.4);
}

/* Анимация пульсации */
.live-dot::after {
    content: '';
    position: absolute;
    top: -3px; left: -3px; right: -3px; bottom: -3px;
    border-radius: 50%;
    border: 1px solid #2ecc71;
    opacity: 0;
    animation: statusPulse 2s infinite;
}

@keyframes statusPulse {
    0% { transform: scale(0.5); opacity: 1; }
    100% { transform: scale(1.6); opacity: 0; }
}

/* Адаптив для мобильных (чтобы красиво переносилось) */
@media (max-width: 600px) {
    .footer-copyright {
        flex-direction: column;
        gap: 5px;
    }
    .separator {
        display: none; /* На мобилках убираем палочки, раз элементы друг под другом */
    }
}