:root {
    --nav-teal: #14f1d9;
    --nav-text: #d9f6ff;
    --nav-muted: #8ea7bd;
    --nav-panel: linear-gradient(180deg, rgba(8, 22, 36, .985), rgba(14, 34, 52, .985));
}

.rd-navbar,
.rd-navbar-wrap,
.rd-navbar-main-outer,
.rd-navbar-main-inner,
.rd-navbar-main,
.rd-navbar-nav-wrap,
.rd-navbar-nav,
.rd-navbar-panel,
.rd-navbar-aside-outer,
.rd-navbar-aside {
    position: relative;
    z-index: 1000;
}

.rd-nav-item {
    position: relative;
    display: inline-block;
    z-index: 1200;
}

/* тень у шапки, когда страницу прокрутили */
.rd-navbar.is-scrolled {
    box-shadow: 0 10px 30px rgba(0, 0, 0, .35);
}

/* =========================================================================
 *  2. ВЕРХНЯЯ ИНФО-СТРОКА
 * ========================================================================= */
.rd-navbar-info .list-lined > li > a {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 2px;
    color: var(--nav-muted);
    text-decoration: none;
    transition: color .2s ease;
}

.rd-navbar-info .list-lined > li > a:hover {
    color: var(--nav-teal);
    text-decoration: none;
}

.rd-navbar-info .list-lined img {
    opacity: .75;
    transition: opacity .2s ease;
}

.rd-navbar-info .list-lined > li > a:hover img {
    opacity: 1;
}

/* ---- индикатор онлайна ---- */
.nav-online {
    display: inline-flex !important;
    align-items: center;
    gap: 7px;
    padding: 3px 12px;
    border-radius: 999px;
    background: rgba(20, 241, 217, .07);
    border: 1px solid rgba(20, 241, 217, .16);
    font-size: 12px;
    font-weight: 700;
    color: var(--nav-text);
    letter-spacing: .01em;
}

.nav-online.is-offline {
    background: rgba(255, 255, 255, .04);
    border-color: rgba(255, 255, 255, .10);
    color: var(--nav-muted);
}

.dot {
    display: inline-block;
    width: 9px;
    height: 9px;
    border-radius: 50%;
    background-color: var(--nav-teal);
    box-shadow: 0 0 10px rgba(20, 241, 217, .45);
    transition: background-color .3s ease;
}

.dot.offline {
    background-color: #6b7280;
    box-shadow: none;
}

.pulse {
    animation: navPulse 1.6s infinite;
}

@keyframes navPulse {
    0% { box-shadow: 0 0 0 0 rgba(20, 241, 217, .55); }
    70% { box-shadow: 0 0 0 8px rgba(20, 241, 217, 0); }
    100% { box-shadow: 0 0 0 0 rgba(20, 241, 217, 0); }
}

/* =========================================================================
 *  3. ПУНКТЫ МЕНЮ
 * ========================================================================= */
.rd-nav-link {
    display: flex;
    align-items: center;
    gap: 7px;
    padding: 10px 14px;
    border-radius: 10px;
    color: var(--nav-text);
    text-decoration: none;
    position: relative;
    transition: color .25s ease, background .25s ease, box-shadow .25s ease;
}

.rd-nav-link:hover,
.rd-nav-item.active > .rd-nav-link {
    color: var(--nav-teal);
    background: linear-gradient(90deg, rgba(20, 241, 217, .08), rgba(59, 130, 246, .10));
    box-shadow: inset 0 0 0 1px rgba(20, 241, 217, .08);
    text-shadow: 0 0 12px rgba(20, 241, 217, .30);
    text-decoration: none;
}

/* подчёркивание */
.rd-nav-link::after {
    content: "";
    position: absolute;
    bottom: 2px;
    left: 50%;
    width: 0;
    height: 2px;
    border-radius: 2px;
    background: var(--nav-teal);
    transform: translateX(-50%);
    transition: width .3s ease;
}

.rd-nav-item.active > .rd-nav-link::after,
.rd-nav-link:hover::after {
    width: 55%;
}

/* стрелка у пунктов с подменю */
.rd-nav-caret {
    font-size: 11px;
    opacity: .5;
    transition: transform .25s ease, opacity .25s ease;
}

.rd-nav-item:hover > .rd-nav-link .rd-nav-caret,
.rd-nav-item:focus-within > .rd-nav-link .rd-nav-caret {
    transform: rotate(180deg);
    opacity: 1;
}

/* =========================================================================
 *  4. ВЫПАДАЮЩИЕ МЕНЮ
 * ========================================================================= */
.dropdown,
.dropdown-auth {
    position: absolute;
    top: calc(100% - 2px);
    left: 0;
    min-width: 230px;
    width: max-content;
    max-width: 340px;
    padding: 8px 0;
    margin: 0;
    list-style: none;

    background: var(--nav-panel);
    border: 1px solid rgba(20, 241, 217, .14);
    border-radius: 0 0 14px 14px;
    box-shadow: 0 18px 40px rgba(0, 0, 0, .42);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);

    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transform: translateY(-8px) scale(.97);
    transition: opacity .22s cubic-bezier(.16, 1, .3, 1),
    transform .22s cubic-bezier(.16, 1, .3, 1),
    visibility .22s;
    z-index: 1000;
}

.dropdown {
    border-top: 2px solid var(--nav-teal);
}

.dropdown-auth {
    min-width: 190px;
    max-width: 280px;
}

.dropdown-right {
    left: auto !important;
    right: 0 !important;
}

/* невидимый мостик, чтобы курсор не терял меню на зазоре */
.dropdown::before,
.dropdown-auth::before {
    content: "";
    position: absolute;
    top: -12px;
    left: 0;
    right: 0;
    height: 12px;
}

/* ---- показ ---- */
.rd-nav-item:hover > .dropdown,
.rd-nav-item:focus-within > .dropdown,
.rd-nav-item:hover > .dropdown-auth,
.rd-nav-item:focus-within > .dropdown-auth {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transform: translateY(0);
}

/* ---- пункты ---- */
.dropdown li,
.dropdown-auth li {
    padding: 0;
    position: relative;
    opacity: 0;
    transform: translateY(-6px);
    transition: opacity .22s ease, transform .22s ease;
}

.rd-nav-item:hover > .dropdown li,
.rd-nav-item:focus-within > .dropdown li,
.rd-nav-item:hover > .dropdown-auth li,
.rd-nav-item:focus-within > .dropdown-auth li {
    opacity: 1;
    transform: translateY(0);
}

/* лесенка появления */
.dropdown li:nth-child(1), .dropdown-auth li:nth-child(1) { transition-delay: .03s; }
.dropdown li:nth-child(2), .dropdown-auth li:nth-child(2) { transition-delay: .06s; }
.dropdown li:nth-child(3), .dropdown-auth li:nth-child(3) { transition-delay: .09s; }
.dropdown li:nth-child(4), .dropdown-auth li:nth-child(4) { transition-delay: .12s; }
.dropdown li:nth-child(5), .dropdown-auth li:nth-child(5) { transition-delay: .15s; }
.dropdown li:nth-child(6), .dropdown-auth li:nth-child(6) { transition-delay: .18s; }
.dropdown li:nth-child(7), .dropdown-auth li:nth-child(7) { transition-delay: .21s; }
.dropdown li:nth-child(8), .dropdown-auth li:nth-child(8) { transition-delay: .24s; }
.dropdown li:nth-child(9), .dropdown-auth li:nth-child(9) { transition-delay: .27s; }

/* ---- ссылки внутри (и кнопка выхода — она же пункт меню) ---- */
.dropdown li a,
.dropdown-auth li a,
.dropdown-auth li .logout-link {
    display: flex;
    align-items: center;
    gap: 9px;
    width: 100%;
    padding: 12px 16px;
    font: inherit;
    font-weight: 600;
    text-align: left;
    text-decoration: none;
    white-space: nowrap;
    color: var(--nav-text);
    background: none;
    border: 0;
    border-left: 2px solid transparent;
    cursor: pointer;
    transition: color .25s ease, background .25s ease, border-color .2s ease;
}

.dropdown li a i,
.dropdown-auth li a i,
.dropdown-auth li .logout-link i {
    width: 16px;
    text-align: center;
    transition: transform .2s ease, color .2s ease;
}

.dropdown li a:hover,
.dropdown li a:focus-visible {
    color: #fff;
    text-decoration: none;
    border-left-color: var(--nav-teal);
    background: linear-gradient(90deg, rgba(20, 241, 217, .10), rgba(59, 130, 246, .14));
}

.dropdown-auth li a:hover,
.dropdown-auth li .logout-link:hover {
    color: #fff;
    text-decoration: none;
    border-left-color: var(--nav-teal);
    background: linear-gradient(90deg, rgba(59, 130, 246, .12), rgba(20, 241, 217, .10));
}

.dropdown li a:hover i,
.dropdown-auth li a:hover i,
.dropdown-auth li .logout-link:hover i {
    transform: translateX(3px);
    color: var(--nav-teal);
}

.dropdown-auth li .logout-form {
    margin: 0;
}

/* =========================================================================
 *  5. БЕЙДЖИ УВЕДОМЛЕНИЙ
 * ========================================================================= */
.notification-badge {
    position: absolute;
    top: -2px;
    right: -7px;
    transform: translate(50%, -50%);
    min-width: 19px;
    padding: 3px 5px;
    border-radius: 999px;
    font-size: 10px;
    font-weight: 800;
    line-height: 1;
    text-align: center;
    color: #fff;
    background: linear-gradient(180deg, #ff4d6d, #ff2d55);
    box-shadow: 0 0 10px rgba(255, 45, 85, .35);
    z-index: 5;
}

/* внутри выпадашки — не абсолютом, а рядом с текстом */
.dropdown .notification-badge {
    position: static;
    transform: none;
    margin-left: auto;
}

/* =========================================================================
 *  6. МОБИЛЬНАЯ ВЕРСИЯ
 * ========================================================================= */
@media (max-width: 768px) {
    .rd-navbar-nav {
        flex-direction: column;
    }

    .rd-nav-item {
        width: 100%;
        display: block;
    }

    .rd-nav-link {
        width: 100%;
        border-radius: 0;
        padding: 14px 18px;
    }

    .rd-nav-link::after {
        display: none;
    }

    .rd-nav-caret {
        margin-left: auto;
    }

    /* ключевое: на мобиле выпадашка не absolute, а обычный блок */
    .dropdown,
    .dropdown-auth {
        position: static !important;
        top: auto !important;
        left: auto !important;
        width: 100% !important;
        min-width: 100% !important;
        max-width: 100% !important;
        margin: 0 !important;
        padding: 6px 0;

        border-radius: 0;
        border-left: 3px solid rgba(20, 241, 217, .45);
        border-right: none;
        border-bottom: none;
        border-top: 1px solid rgba(20, 241, 217, .08);
        box-shadow: none;
        background: linear-gradient(180deg, rgba(6, 20, 34, .95), rgba(10, 28, 44, .95));

        opacity: 1 !important;
        visibility: visible !important;
        pointer-events: auto !important;
        transform: none !important;

        display: none;
        overflow: hidden;
        z-index: 2147483647 !important;
    }

    .dropdown::before,
    .dropdown-auth::before {
        display: none !important;
    }

    .rd-nav-item.is-open > .dropdown,
    .rd-nav-item.is-open > .dropdown-auth {
        display: block;
    }

    .rd-nav-item.is-open > .rd-nav-link .rd-nav-caret {
        transform: rotate(180deg);
    }

    .dropdown li,
    .dropdown-auth li {
        opacity: 1 !important;
        transform: none !important;
        transition: none;
    }

    .dropdown li a,
    .dropdown-auth li a,
    .dropdown-auth li .logout-link {
        padding: 11px 14px 11px 22px;
        font-size: 15px;
        white-space: normal;
    }
}

/* =========================================================================
 *  7. МОДАЛКА ПРОВЕРКИ ЧС
 * ========================================================================= */
.blacklist-modal {
    border-radius: 24px;
    border: 1px solid rgba(20, 241, 217, .18);
    overflow: hidden;
    background: linear-gradient(160deg, rgba(10, 24, 40, .97), rgba(16, 36, 56, .97));
    box-shadow: 0 30px 80px rgba(0, 0, 0, .55), 0 0 0 1px rgba(20, 241, 217, .06);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    color: var(--nav-text);
}

.blacklist-modal .modal-header h3 {
    color: #fff;
    font-weight: 800;
}

.blacklist-modal .modal-header h3 i {
    color: var(--nav-teal);
    margin-right: 8px;
}

.blacklist-modal .text-muted {
    color: var(--nav-muted) !important;
}

.blacklist-modal .btn-close {
    filter: invert(1) grayscale(1) brightness(2);
    opacity: .7;
}

.blacklist-modal .btn-close:hover {
    opacity: 1;
}

/* ---- поиск ---- */
.blacklist-search {
    display: flex;
    gap: 15px;
}

.blacklist-search input {
    height: 55px;
    font-size: 17px;
    border-radius: 14px;
    background: rgba(255, 255, 255, .04);
    border: 1px solid rgba(255, 255, 255, .10);
    color: #fff;
    transition: border-color .2s, box-shadow .2s, background .2s;
}

.blacklist-search input::placeholder {
    color: #6f8ba0;
}

.blacklist-search input:focus {
    background: rgba(255, 255, 255, .06);
    border-color: var(--nav-teal);
    box-shadow: 0 0 0 4px rgba(20, 241, 217, .12);
    color: #fff;
    outline: none;
}

.blacklist-search button {
    width: 190px;
    border-radius: 14px;
    font-size: 17px;
    font-weight: 700;
    border: none;
    background: linear-gradient(135deg, #14f1d9, #3b82f6);
    color: #051826;
    transition: transform .2s, box-shadow .2s, opacity .2s;
}

.blacklist-search button:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 12px 28px rgba(20, 241, 217, .30);
}

.blacklist-search button:disabled {
    opacity: .7;
    cursor: not-allowed;
}

.check-info {
    padding: 15px;
    border-radius: 12px;
    background: rgba(59, 130, 246, .08);
    border: 1px solid rgba(59, 130, 246, .18);
    color: #9cc3ff;
}

/* ---- загрузка ---- */
.loading-title {
    margin-top: 25px;
    font-size: 20px;
    font-weight: 700;
    color: #fff;
}

.loading-subtitle {
    margin-top: 5px;
    color: var(--nav-muted);
    transition: opacity .2s;
}

.blacklist-modal .progress {
    height: 26px;
    border-radius: 50px;
    background: rgba(255, 255, 255, .06);
    overflow: hidden;
}

.blacklist-modal .progress-bar {
    font-size: 14px;
    font-weight: 700;
    background: linear-gradient(90deg, #14f1d9, #3b82f6);
    color: #051826;
    transition: width .25s ease;
}

/* ---- карточка результата ---- */
.result-card {
    margin-top: 25px;
    padding: 26px;
    border-radius: 20px;
    background: rgba(255, 255, 255, .035);
    border: 1px solid rgba(255, 255, 255, .08);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    opacity: 0;
    transform: translateY(25px);
    transition: .45s;
}

.result-card.show {
    opacity: 1;
    transform: none;
}

.result-card.danger {
    background: linear-gradient(160deg, rgba(214, 48, 49, .16), rgba(255, 77, 79, .05));
    border-color: rgba(255, 77, 79, .35);
    box-shadow: 0 0 40px rgba(255, 77, 79, .12), inset 0 0 0 1px rgba(255, 77, 79, .08);
}

.result-card.success {
    background: linear-gradient(160deg, rgba(46, 204, 113, .16), rgba(39, 174, 96, .05));
    border-color: rgba(46, 204, 113, .35);
    box-shadow: 0 0 40px rgba(46, 204, 113, .12), inset 0 0 0 1px rgba(46, 204, 113, .08);
}

.result-header {
    display: flex;
    align-items: center;
    gap: 18px;
    margin-bottom: 22px;
}

.result-icon {
    width: 70px;
    height: 70px;
    min-width: 70px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 34px;
    line-height: 1;
    color: #fff;
}

.result-danger {
    background: linear-gradient(135deg, #ff4d4f, #d63031);
    box-shadow: 0 0 30px rgba(255, 77, 79, .45);
}

.result-success {
    background: linear-gradient(135deg, #2ecc71, #27ae60);
    box-shadow: 0 0 30px rgba(46, 204, 113, .45);
}

.result-title {
    margin: 0;
    font-size: 26px;
    font-weight: 800;
    color: #fff;
}

.result-subtitle {
    margin-top: 3px;
    color: #9db4c6;
}

.result-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 14px;
    margin-top: 20px;
}

.result-item {
    padding: 16px;
    border-radius: 14px;
    background: rgba(255, 255, 255, .04);
    border: 1px solid rgba(255, 255, 255, .07);
    transition: background .2s, border-color .2s;
}

.result-item:hover {
    background: rgba(255, 255, 255, .07);
    border-color: rgba(20, 241, 217, .25);
}

.result-label {
    margin-bottom: 6px;
    font-size: 13px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .03em;
    color: #7f97ab;
}

.result-value {
    font-size: 18px;
    font-weight: 700;
    word-break: break-word;
    color: #eef8ff;
}

.degree {
    display: inline-block;
    padding: 7px 16px;
    border-radius: 40px;
    font-weight: 700;
}

.degree-1 {
    background: rgba(46, 204, 113, .18);
    color: #4be08a;
    box-shadow: inset 0 0 0 1px rgba(46, 204, 113, .35);
}

.degree-2 {
    background: rgba(255, 193, 7, .18);
    color: #ffc94b;
    box-shadow: inset 0 0 0 1px rgba(255, 193, 7, .35);
}

.degree-3 {
    background: rgba(255, 77, 79, .18);
    color: #ff7a7c;
    box-shadow: inset 0 0 0 1px rgba(255, 77, 79, .35);
}

.result-actions {
    margin-top: 25px;
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
}

.result-btn {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 12px 22px;
    border-radius: 12px;
    font-weight: 700;
    text-decoration: none;
    border: none;
    cursor: pointer;
    transition: transform .2s, box-shadow .2s, opacity .2s;
}

.result-btn:hover {
    transform: translateY(-2px);
}

.result-proof {
    background: linear-gradient(135deg, #3b82f6, #14f1d9);
    color: #051826;
}

.result-proof:hover {
    color: #051826;
    box-shadow: 0 10px 24px rgba(20, 241, 217, .30);
}

.result-copy {
    background: rgba(255, 255, 255, .06);
    color: var(--nav-text);
    border: 1px solid rgba(255, 255, 255, .10);
}

.result-copy:hover {
    background: rgba(255, 255, 255, .10);
}

.result-copy.copied {
    background: rgba(46, 204, 113, .18) !important;
    color: #4be08a !important;
    border-color: rgba(46, 204, 113, .35) !important;
}

@media (max-width: 576px) {
    .blacklist-search {
        flex-direction: column;
    }

    .blacklist-search button {
        width: 100%;
    }

    .result-grid {
        grid-template-columns: 1fr;
    }

    .result-header {
        flex-direction: column;
        text-align: center;
    }

    .result-actions {
        flex-direction: column;
    }

    .result-btn {
        justify-content: center;
        width: 100%;
    }
}

/* =========================================================================
 *  8. УВАЖЕНИЕ К НАСТРОЙКАМ СИСТЕМЫ
 * ========================================================================= */
@media (prefers-reduced-motion: reduce) {
    .dropdown,
    .dropdown-auth,
    .dropdown li,
    .dropdown-auth li,
    .result-card {
        transition-duration: .01ms !important;
    }

    .pulse {
        animation: none;
    }
}

.rd-navbar--is-clone .sfpd-palette-trigger,
.rd-navbar--is-clone #online-status,
.rd-navbar--is-clone .sfpd-palette {
    display: none !important;
}

/* на всякий случай — если плагин соберёт клон иначе */
.sfpd-palette-trigger.is-duplicate {
    display: none !important;
}
