/* ---------- Глобальные переопределения ---------- */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Inter', sans-serif;
}

body {
    background: linear-gradient(145deg, #0a1929 0%, #11212e 100%);
    min-height: 100vh;
    padding: 24px;
    color: #f0f9ff;
}

.container {
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Header */
.header {
    display: flex;
    justify-content: center;
    margin-bottom: 40px;
}

.logo {
    background: rgba(0, 0, 0, 0.3);
    backdrop-filter: blur(8px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 60px;
    padding: 8px 24px;
    display: inline-flex;
    align-items: center;
    gap: 12px;
    font-weight: 500;
}

.logo img {
    height: 32px;
    width: auto;
}

/* Hero */
.hero {
    text-align: center;
    margin-bottom: 48px;
}

.hero h1 {
    font-size: clamp(2rem, 5vw, 3.2rem);
    font-weight: 600;
    background: linear-gradient(to right, #fff, #b0d4ff);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 8px;
}

.hero p {
    color: #a0b8cc;
    font-size: 1.2rem;
}

/* Search panel */
.search-container {
    display: flex;
    flex-direction: column;
    gap: 32px;
}

.filter-panel {
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 32px;
    padding: 24px 28px;
    display: flex;
    flex-wrap: wrap;
    gap: 28px;
    align-items: flex-end;
}

.filter-group {
    flex: 1;
    min-width: 180px;
}

.filter-label {
    display: block;
    font-size: 0.85rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: #8ba0c0;
    margin-bottom: 8px;
}

.filter-group input[type="text"] {
    width: 100%;
    padding: 12px 16px;
    border-radius: 40px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    background: rgba(255, 255, 255, 0.08);
    color: white;
    font-size: 0.9rem;
}

.filter-group input[type="text"]:focus {
    border-color: #3b82f6;
    outline: none;
    background: rgba(255, 255, 255, 0.12);
}

.checkbox-group {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
}

.checkbox {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    color: #e0e7ff;
}

.checkbox input {
    display: none;
}

.checkmark {
    width: 18px;
    height: 18px;
    border: 2px solid rgba(255, 255, 255, 0.4);
    border-radius: 4px;
    background: rgba(255, 255, 255, 0.05);
    position: relative;
    transition: 0.1s;
}

.checkbox input:checked + .checkmark {
    background: #3b82f6;
    border-color: #3b82f6;
}

.checkbox input:checked + .checkmark::after {
    content: "";
    position: absolute;
    left: 4px;
    top: 1px;
    width: 5px;
    height: 9px;
    border: solid white;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

.range-wrapper {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

#max_ping {
    flex: 1;
    min-width: 120px;
    height: 4px;
    border-radius: 4px;
    background: rgba(255, 255, 255, 0.2);
    outline: none;
}

#max_ping::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #3b82f6;
    cursor: pointer;
    border: none;
}

#ping_value {
    font-size: 0.85rem;
    background: rgba(0, 0, 0, 0.4);
    padding: 4px 12px;
    border-radius: 40px;
    color: #b0c4ff;
}

.cta.primary {
    background: linear-gradient(135deg, #2563eb, #1d4ed8);
    border: none;
    padding: 12px 28px;
    border-radius: 40px;
    font-weight: 600;
    font-size: 0.95rem;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    transition: all 0.2s;
    box-shadow: 0 8px 20px -8px #0f2b5e;
    border: 1px solid rgba(255, 255, 255, 0.15);
    color: #fff;
}

.cta.primary:hover {
    background: linear-gradient(135deg, #1d4ed8, #1e3a8a);
    box-shadow: 0 12px 28px -8px #0f2b5e;
}

/* Servers list */
.servers-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.server-card {
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(8px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 24px;
    padding: 16px 20px;
    transition: all 0.2s;
}

.server-card:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.2);
}

.server-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 16px;
}

.server-main {
    display: flex;
    align-items: center;
    gap: 14px;
}

.flag {
    width: 36px;
    height: 36px;
    border-radius: 12px;
    object-fit: cover;
    background: #1e2a3a;
    box-shadow: 0 2px 8px rgba(0,0,0,0.2);
}

.server-details {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 12px;
}

.ip {
    font-weight: 600;
    font-size: 1rem;
    color: white;
    letter-spacing: 0.3px;
}

.badge {
    font-size: 0.7rem;
    font-weight: 600;
    padding: 4px 10px;
    border-radius: 40px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.badge.no-mask {
    background: rgba(156, 163, 175, 0.2);
    color: #cbd5e1;
    border: 1px solid rgba(255,255,255,0.2);
}

.badge.dd-mask {
    background: rgba(59, 130, 246, 0.2);
    color: #60a5fa;
    border: 1px solid rgba(59,130,246,0.4);
}

.badge.ee-mask {
    background: rgba(139, 92, 246, 0.2);
    color: #a78bfa;
    border: 1px solid rgba(139,92,246,0.4);
}

.sni {
    font-size: 0.7rem;
    background: rgba(0,0,0,0.4);
    padding: 3px 8px;
    border-radius: 20px;
    color: #b0c4ff;
    font-family: monospace;
}

.server-meta {
    display: flex;
    align-items: center;
    gap: 16px;
}

.ping {
    font-size: 0.85rem;
    font-weight: 500;
    background: rgba(255, 255, 255, 0.1);
    padding: 6px 14px;
    border-radius: 40px;
    border: 1px solid rgba(255, 255, 255, 0.15);
    white-space: nowrap;
}

.ping.good {
    color: #2ecc71;
}
.ping.medium {
    color: #f39c12;
}
.ping.bad {
    color: #e74c3c;
}

.copy-btn, .info-btn {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.2);
    width: 36px;
    height: 36px;
    border-radius: 40px;
    cursor: pointer;
    transition: 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #cbd5e1;
    font-size: 1rem;
}

.copy-btn:hover,
.info-btn:hover {
    background: rgba(255, 255, 255, 0.15);
    color: white;
    border-color: rgba(255, 255, 255, 0.4);
}

/* Loading / empty / error states */
.loading-skeleton, .empty-message, .error-message {
    text-align: center;
    padding: 48px 20px;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 32px;
    color: #9ab3d0;
    font-size: 1rem;
    backdrop-filter: blur(4px);
}

.loading-skeleton i, .empty-message i, .error-message i {
    margin-right: 8px;
    font-size: 1.2rem;
}

/* Toast */
.toast {
    position: fixed;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    background: #1e2a3a;
    backdrop-filter: blur(16px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    padding: 12px 24px;
    border-radius: 60px;
    font-size: 0.9rem;
    font-weight: 500;
    color: white;
    transition: 0.2s;
    opacity: 0;
    pointer-events: none;
    z-index: 1000;
    white-space: nowrap;
    box-shadow: 0 8px 20px rgba(0,0,0,0.3);
}

.toast.show {
    transform: translateX(-50%) translateY(0);
    opacity: 1;
}

.toast.success {
    background: #10b981;
    border-color: #34d399;
}

@media (max-width: 768px) {
    .sni {
        display: none;
    }

    body {
        padding: 16px;
    }
    .filter-panel {
        flex-direction: column;
        align-items: stretch;
        gap: 20px;
    }
    .server-info {
        flex-direction: column;
        align-items: flex-start;
    }
    .server-meta {
        width: 100%;
        justify-content: flex-end;
    }
    .toast {
        white-space: normal;
        text-align: center;
        max-width: 90%;
        font-size: 0.85rem;
    }
}

@keyframes sk-shimmer {
  0%   { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

.skeleton {
  background: linear-gradient(
    90deg,
    #162030 30%,
    #243a4a 50%,
    #1a3550 70%
  );
  background-size: 200% 100%;
  animation: sk-shimmer 1.6s infinite linear;
  color: transparent !important;
  border-color: transparent !important;
  pointer-events: none;
  border-radius: 40px;
}

.skeleton * { visibility: hidden; }