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

:root {
    --bg-main: #070b14;
    --bg-secondary: #0d1424;
    --glass: rgba(255, 255, 255, 0.045);
    --glass-hover: rgba(255, 255, 255, 0.075);
    --border: rgba(255, 255, 255, 0.085);
    --border-hover: rgba(96, 165, 250, 0.3);
    --text: #f8fafc;
    --text-secondary: rgba(255, 255, 255, 0.68);
    --text-muted: rgba(255, 255, 255, 0.42);
    --primary: #60a5fa;
    --primary-light: #93c5fd;
    --purple: #a78bfa;
    --green: #34d399;
    --radius-sm: 10px;
    --radius-md: 16px;
    --radius-lg: 22px;
    --shadow: 0 18px 50px rgba(0, 0, 0, 0.28);
    --transition: 0.28s ease;
}

html {
    scroll-behavior: smooth;
}

body {
    min-height: 100vh;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    background: var(--bg-main);
    color: var(--text);
    line-height: 1.6;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}

button,
input {
    font: inherit;
}

button {
    -webkit-tap-highlight-color: transparent;
}

.background-container {
    position: fixed;
    inset: 0;
    z-index: -1;
    overflow: hidden;
    background:
        radial-gradient(circle at 15% 15%, rgba(59, 130, 246, 0.14), transparent 32%),
        radial-gradient(circle at 85% 20%, rgba(139, 92, 246, 0.13), transparent 30%),
        radial-gradient(circle at 50% 85%, rgba(14, 165, 233, 0.08), transparent 35%),
        linear-gradient(135deg, #070b14 0%, #0b1120 38%, #0b1524 68%, #090f1d 100%);
}

.background-container::before,
.background-container::after {
    content: "";
    position: absolute;
    border-radius: 50%;
    filter: blur(90px);
    pointer-events: none;
}

.background-container::before {
    width: 320px;
    height: 320px;
    top: 12%;
    left: -100px;
    background: rgba(59, 130, 246, 0.08);
}

.background-container::after {
    width: 360px;
    height: 360px;
    right: -120px;
    bottom: 10%;
    background: rgba(139, 92, 246, 0.07);
}

header {
    position: sticky;
    top: 0;
    z-index: 100;
    padding: 1rem 2rem;
    background: rgba(7, 11, 20, 0.76);
    border-bottom: 1px solid rgba(255, 255, 255, 0.07);
    backdrop-filter: blur(24px) saturate(150%);
    -webkit-backdrop-filter: blur(24px) saturate(150%);
}

.header-content {
    max-width: 1400px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1.25rem;
    flex-wrap: wrap;
}

.logo-section {
    flex: 0 0 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.45rem;
    margin-bottom: 0.25rem;
}

.logo-icon {
    width: auto;
    height: 108px;
    object-fit: contain;
    border-radius: 20px;
    filter: drop-shadow(0 12px 30px rgba(0, 0, 0, 0.35));
}

.logo-section h1 {
    font-size: clamp(1.7rem, 4vw, 2.35rem);
    font-weight: 800;
    line-height: 1.15;
    letter-spacing: -0.8px;
    text-align: center;
    background: linear-gradient(110deg, #60a5fa 0%, #93c5fd 30%, #a78bfa 65%, #60a5fa 100%);
    background-size: 200% auto;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: titleGlow 8s linear infinite;
}

@keyframes titleGlow {
    to {
        background-position: 200% center;
    }
}

.stats-section {
    display: flex;
    align-items: center;
    gap: 0.7rem;
    color: var(--text-muted);
    font-size: 0.86rem;
    white-space: nowrap;
}

.stat-divider {
    opacity: 0.3;
}

.stat-item {
    color: var(--text-secondary);
}

#totalDns {
    color: var(--primary-light);
    font-size: 1.08rem;
    font-weight: 750;
    text-shadow: 0 0 18px rgba(96, 165, 250, 0.25);
}

.search-section {
    flex: 1;
    min-width: 220px;
    max-width: 430px;
}

#searchInput {
    width: 100%;
    height: 44px;
    padding: 0.65rem 1rem;
    color: var(--text);
    background: rgba(255, 255, 255, 0.055);
    border: 1px solid var(--border);
    border-radius: 13px;
    outline: none;
    font-size: 0.92rem;
    transition: var(--transition);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.025);
}

#searchInput:hover {
    background: rgba(255, 255, 255, 0.07);
    border-color: rgba(255, 255, 255, 0.12);
}

#searchInput:focus {
    background: rgba(255, 255, 255, 0.085);
    border-color: rgba(96, 165, 250, 0.5);
    box-shadow:
        0 0 0 3px rgba(96, 165, 250, 0.08),
        0 10px 35px rgba(0, 0, 0, 0.18);
}

#searchInput::placeholder {
    color: rgba(255, 255, 255, 0.36);
}

main {
    width: 100%;
    max-width: 1400px;
    margin: 0 auto;
    padding: 2rem;
}

.dashboard {
    margin-bottom: 1.5rem;
    padding: 1.35rem 1.5rem;
    background: rgba(255, 255, 255, 0.038);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    box-shadow: var(--shadow);
}

.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(110px, 1fr));
    gap: 0.65rem;
}

.dashboard-item {
    min-height: 78px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 0.7rem;
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.025);
    border: 1px solid rgba(255, 255, 255, 0.035);
    transition: var(--transition);
}

.dashboard-item:hover {
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(96, 165, 250, 0.13);
    transform: translateY(-2px);
}

.dashboard-label {
    color: var(--text-muted);
    font-size: 0.67rem;
    font-weight: 700;
    letter-spacing: 0.09em;
    text-transform: uppercase;
}

.dashboard-value {
    margin-top: 0.15rem;
    color: var(--text);
    font-size: 1.65rem;
    font-weight: 800;
    line-height: 1.25;
}

.filter-section {
    display: flex;
    flex-wrap: wrap;
    gap: 0.55rem;
    margin-bottom: 1.5rem;
    padding: 0.8rem;
    background: rgba(255, 255, 255, 0.032);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
}

.filter-btn {
    padding: 0.5rem 1rem;
    color: rgba(255, 255, 255, 0.66);
    background: rgba(255, 255, 255, 0.045);
    border: 1px solid rgba(255, 255, 255, 0.07);
    border-radius: 999px;
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
}

.filter-btn:hover {
    color: #fff;
    background: rgba(255, 255, 255, 0.09);
    border-color: rgba(255, 255, 255, 0.14);
    transform: translateY(-1px);
}

.filter-btn:active {
    transform: translateY(0);
}

.filter-btn.active {
    color: #fff;
    transform: translateY(-1px);
}

.filter-btn[data-filter="all"].active {
    background: linear-gradient(135deg, #4f46e5, #8b5cf6);
    border-color: #6366f1;
    box-shadow: 0 7px 24px rgba(99, 102, 241, 0.25);
}

.filter-btn[data-filter="Standard"].active {
    background: linear-gradient(135deg, #2563eb, #60a5fa);
    border-color: #3b82f6;
    box-shadow: 0 7px 24px rgba(59, 130, 246, 0.22);
}

.filter-btn[data-filter="AdBlock"].active {
    background: linear-gradient(135deg, #d97706, #fbbf24);
    border-color: #f59e0b;
    box-shadow: 0 7px 24px rgba(245, 158, 11, 0.2);
}

.filter-btn[data-filter="Family"].active {
    background: linear-gradient(135deg, #059669, #34d399);
    border-color: #10b981;
    box-shadow: 0 7px 24px rgba(16, 185, 129, 0.2);
}

.filter-btn[data-filter="Security"].active {
    background: linear-gradient(135deg, #dc2626, #f87171);
    border-color: #ef4444;
    box-shadow: 0 7px 24px rgba(239, 68, 68, 0.2);
}

.filter-btn[data-filter="Malware"].active {
    background: linear-gradient(135deg, #b91c1c, #ef4444);
    border-color: #dc2626;
    box-shadow: 0 7px 24px rgba(220, 38, 38, 0.2);
}

.filter-btn[data-filter="Adult Filter"].active {
    background: linear-gradient(135deg, #db2777, #f472b6);
    border-color: #ec4899;
    box-shadow: 0 7px 24px rgba(236, 72, 153, 0.2);
}

.filter-btn[data-filter="Unfiltered"].active {
    background: linear-gradient(135deg, #7c3aed, #a78bfa);
    border-color: #8b5cf6;
    box-shadow: 0 7px 24px rgba(139, 92, 246, 0.2);
}

.filter-btn[data-filter="Private"].active {
    background: linear-gradient(135deg, #0891b2, #22d3ee);
    border-color: #06b6d4;
    box-shadow: 0 7px 24px rgba(6, 182, 212, 0.2);
}

.filter-btn[data-filter="IPv4"].active {
    background: linear-gradient(135deg, #2563eb, #60a5fa);
    border-color: #3b82f6;
    box-shadow: 0 7px 24px rgba(59, 130, 246, 0.2);
}

.filter-btn[data-filter="IPv6"].active {
    background: linear-gradient(135deg, #7c3aed, #a78bfa);
    border-color: #8b5cf6;
    box-shadow: 0 7px 24px rgba(139, 92, 246, 0.2);
}

.filter-btn[data-filter="DoH"].active {
    background: linear-gradient(135deg, #7c3aed, #a78bfa);
    border-color: #8b5cf6;
    box-shadow: 0 7px 24px rgba(139, 92, 246, 0.2);
}

.filter-btn[data-filter="DoT"].active {
    background: linear-gradient(135deg, #4f46e5, #818cf8);
    border-color: #6366f1;
    box-shadow: 0 7px 24px rgba(99, 102, 241, 0.2);
}

.filter-btn[data-filter="DNSCrypt"].active {
    background: linear-gradient(135deg, #0f766e, #2dd4bf);
    border-color: #14b8a6;
    box-shadow: 0 7px 24px rgba(20, 184, 166, 0.2);
}

.dns-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.dns-card {
    position: relative;
    min-width: 0;
    padding: 1.25rem;
    overflow: hidden;
    background:
        linear-gradient(145deg, rgba(255, 255, 255, 0.065), rgba(255, 255, 255, 0.025));
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
    box-shadow: 0 12px 35px rgba(0, 0, 0, 0.18);
    transition: transform var(--transition), border-color var(--transition), background var(--transition), box-shadow var(--transition);
}

.dns-card::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(96, 165, 250, 0.4), transparent);
    opacity: 0;
    transition: opacity var(--transition);
}

.dns-card:hover {
    transform: translateY(-4px);
    background:
        linear-gradient(145deg, rgba(255, 255, 255, 0.085), rgba(255, 255, 255, 0.035));
    border-color: var(--border-hover);
    box-shadow: 0 20px 55px rgba(0, 0, 0, 0.3);
}

.dns-card:hover::before {
    opacity: 1;
}

.dns-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 0.8rem;
    margin-bottom: 0.6rem;
}

.dns-address {
    min-width: 0;
    color: var(--primary-light);
    font-family: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, Monaco, "Courier New", monospace;
    font-size: 0.98rem;
    font-weight: 700;
    line-height: 1.5;
    word-break: break-all;
    text-shadow: 0 0 18px rgba(96, 165, 250, 0.12);
}

.dns-status {
    flex: 0 0 auto;
    padding: 0.2rem 0.55rem;
    color: var(--green);
    background: rgba(52, 211, 153, 0.09);
    border: 1px solid rgba(52, 211, 153, 0.16);
    border-radius: 999px;
    font-size: 0.62rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    white-space: nowrap;
}

.dns-provider {
    margin-bottom: 0.8rem;
    color: var(--text-secondary);
    font-size: 0.84rem;
    font-weight: 500;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.dns-categories,
.dns-protocols {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
}

.dns-categories {
    margin-bottom: 0.45rem;
}

.dns-protocols {
    margin-bottom: 0.7rem;
}

.category-badge,
.protocol-badge {
    display: inline-flex;
    align-items: center;
    min-height: 23px;
    padding: 0.15rem 0.6rem;
    border-radius: 999px;
    font-size: 0.65rem;
    font-weight: 650;
    background: rgba(255, 255, 255, 0.055);
    border: 1px solid rgba(255, 255, 255, 0.075);
    color: rgba(255, 255, 255, 0.68);
}

.protocol-badge {
    color: rgba(147, 197, 253, 0.85);
    background: rgba(96, 165, 250, 0.07);
    border-color: rgba(96, 165, 250, 0.12);
}

.dns-type {
    margin-bottom: 0.75rem;
    color: var(--text-muted);
    font-size: 0.72rem;
    font-weight: 600;
}

.dns-actions {
    display: flex;
    gap: 0.5rem;
}

.copy-btn {
    min-height: 34px;
    padding: 0.35rem 1rem;
    color: rgba(255, 255, 255, 0.7);
    background: rgba(255, 255, 255, 0.045);
    border: 1px solid rgba(255, 255, 255, 0.09);
    border-radius: 9px;
    font-size: 0.75rem;
    font-weight: 650;
    cursor: pointer;
    transition: var(--transition);
}

.copy-btn:hover {
    color: #fff;
    background: rgba(96, 165, 250, 0.1);
    border-color: rgba(96, 165, 250, 0.22);
    transform: translateY(-1px);
}

.copy-btn:active {
    transform: translateY(0);
}

.copy-btn.copied {
    color: var(--green);
    background: rgba(52, 211, 153, 0.1);
    border-color: rgba(52, 211, 153, 0.2);
}

.pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.8rem;
    padding: 0.8rem;
    background: rgba(255, 255, 255, 0.032);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
}

.pagination button {
    min-width: 92px;
    min-height: 36px;
    padding: 0.4rem 1rem;
    color: rgba(255, 255, 255, 0.7);
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 9px;
    font-size: 0.76rem;
    font-weight: 650;
    cursor: pointer;
    transition: var(--transition);
}

.pagination button:hover:not(:disabled) {
    color: #fff;
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(96, 165, 250, 0.2);
    transform: translateY(-1px);
}

.pagination button:disabled {
    opacity: 0.28;
    cursor: not-allowed;
}

#pageInfo {
    min-width: 105px;
    color: var(--text-muted);
    font-size: 0.78rem;
    font-weight: 600;
    text-align: center;
}

footer {
    max-width: 1400px;
    margin: 2rem auto 0;
    padding: 2rem;
    text-align: center;
    border-top: 1px solid rgba(255, 255, 255, 0.055);
}

.telegram-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 44px;
    padding: 0.7rem 2rem;
    color: #fff;
    background: linear-gradient(135deg, #0088cc, #006699);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    font-size: 0.9rem;
    font-weight: 700;
    text-decoration: none;
    cursor: pointer;
    transition: var(--transition);
    box-shadow: 0 8px 25px rgba(0, 136, 204, 0.12);
}

.telegram-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 35px rgba(0, 136, 204, 0.25);
}

.modal {
    display: none;
    position: fixed;
    top: 50%;
    left: 50%;
    z-index: 1000;
    width: min(400px, 90%);
    padding: 2.2rem;
    transform: translate(-50%, -50%);
    text-align: center;
    background: rgba(10, 15, 27, 0.88);
    border: 1px solid rgba(255, 255, 255, 0.11);
    border-radius: var(--radius-lg);
    backdrop-filter: blur(28px) saturate(140%);
    -webkit-backdrop-filter: blur(28px) saturate(140%);
    box-shadow: 0 30px 90px rgba(0, 0, 0, 0.55);
}

.modal h2 {
    margin-bottom: 0.55rem;
    color: #fff;
    font-size: 1.35rem;
}

.modal p {
    margin-bottom: 1.5rem;
    color: var(--text-secondary);
    font-size: 0.88rem;
}

.modal button {
    min-height: 40px;
    padding: 0.55rem 2rem;
    color: #fff;
    background: rgba(255, 255, 255, 0.07);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    font-size: 0.88rem;
    font-weight: 650;
    cursor: pointer;
    transition: var(--transition);
}

.modal button:hover {
    background: rgba(255, 255, 255, 0.13);
    border-color: rgba(255, 255, 255, 0.16);
}

.empty-state {
    display: none;
    margin: 2rem 0;
    padding: 4rem 2rem;
    text-align: center;
    background: rgba(255, 255, 255, 0.032);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
}

.empty-state h2 {
    margin-bottom: 0.5rem;
    color: rgba(255, 255, 255, 0.7);
}

.empty-state p {
    color: var(--text-muted);
    font-size: 0.88rem;
}

@media (max-width: 900px) {
    header {
        padding: 0.9rem 1.25rem;
    }

    main {
        padding: 1.35rem;
    }

    .header-content {
        gap: 0.9rem;
    }

    .search-section {
        max-width: none;
    }

    .stats-section {
        flex: 1;
        justify-content: flex-start;
    }

    .dns-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 768px) {
    header {
        padding: 0.75rem 1rem;
    }

    .header-content {
        flex-direction: column;
        align-items: stretch;
    }

    .logo-section {
        flex-basis: auto;
        margin-bottom: 0.2rem;
    }

    .logo-icon {
        height: 78px;
        border-radius: 16px;
    }

    .logo-section h1 {
        font-size: 1.55rem;
    }

    .stats-section {
        justify-content: center;
        font-size: 0.77rem;
    }

    .search-section {
        width: 100%;
        max-width: none;
    }

    #searchInput {
        height: 42px;
    }

    main {
        padding: 1rem;
    }

    .dashboard {
        padding: 0.9rem;
        border-radius: 18px;
    }

    .dashboard-grid {
        grid-template-columns: repeat(4, 1fr);
        gap: 0.45rem;
    }

    .dashboard-item {
        min-height: 70px;
        padding: 0.5rem 0.25rem;
    }

    .dashboard-label {
        font-size: 0.59rem;
    }

    .dashboard-value {
        font-size: 1.25rem;
    }

    .filter-section {
        padding: 0.65rem;
        gap: 0.4rem;
        border-radius: 14px;
    }

    .filter-btn {
        padding: 0.38rem 0.75rem;
        font-size: 0.7rem;
    }

    .dns-grid {
        grid-template-columns: 1fr;
        gap: 0.8rem;
    }

    .dns-card {
        padding: 1rem;
    }

    .pagination {
        gap: 0.55rem;
    }

    .pagination button {
        min-width: 82px;
    }
}

@media (max-width: 480px) {
    .logo-icon {
        height: 70px;
    }

    .logo-section h1 {
        font-size: 1.4rem;
    }

    .stats-section {
        flex-wrap: wrap;
        white-space: normal;
        line-height: 1.4;
    }

    .dashboard-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .dashboard-item {
        min-height: 72px;
    }

    .dashboard-value {
        font-size: 1.35rem;
    }

    .filter-section {
        max-height: none;
    }

    .filter-btn {
        flex: 0 0 auto;
    }

    .dns-header {
        gap: 0.5rem;
    }

    .dns-address {
        font-size: 0.88rem;
    }

    .dns-status {
        font-size: 0.56rem;
        padding: 0.18rem 0.45rem;
    }

    .pagination {
        flex-wrap: wrap;
    }

    #pageInfo {
        order: -1;
        flex-basis: 100%;
    }

    footer {
        padding: 1.5rem 1rem;
    }

    .telegram-btn {
        width: 100%;
    }
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        scroll-behavior: auto !important;
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}
