:root {
    --bg-main: #110e16;
    --hero-bg: radial-gradient(circle at 10% 50%, #2a1638 0%, #171120 70%);
    --card-bg: #1a1522;
    --card-hover: #221b2d;
    --purple-primary: #9b2bb9;
    --purple-glow: rgba(155, 43, 185, 0.4);
    --border-dashed: rgba(155, 43, 185, 0.35);
    --text-muted: #8b8098;
    --text-light: #ffffff;
    --green-online: #22c55e;
}

* { box-sizing: border-box; }

body {
    font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    background-color: var(--bg-main);
    color: var(--text-light);
    margin: 0;
    padding: 0;
    width: 100%;
}

/* NAVBAR LOGO FIX */
.navbar {
    background: #15101c;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    padding: 18px 0;
    width: 100%;
}
.nav-container {
    max-width: 1350px;
    margin: 0 auto;
    padding: 0 40px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.nav-logo {
    font-size: 1.6rem;
    font-weight: 900;
    letter-spacing: 2px;
    text-decoration: none;
    text-transform: uppercase;
    display: inline-flex;
    align-items: center;
    line-height: 1;
}
.nav-logo span {
    display: inline-block;
    line-height: 1;
}
.nav-links a {
    color: var(--text-muted);
    text-decoration: none;
    margin-left: 28px;
    font-size: 0.95rem;
    font-weight: 600;
    transition: color 0.2s;
}
.nav-links a.active, .nav-links a:hover {
    color: var(--text-light);
}

/* HERO SECTION */
.hero {
    background: var(--hero-bg);
    padding: 65px 0 75px;
    width: 100%;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}
.hero-container {
    max-width: 1350px;
    margin: 0 auto;
    padding: 0 40px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.server-title {
    font-size: 4rem;
    font-weight: 900;
    letter-spacing: 2px;
    margin: 0;
    color: #ffffff;
    line-height: 1;
}
.server-subtitle {
    color: #9a8eb0;
    margin-top: 14px;
    font-size: 1.25rem;
    font-weight: 500;
}
.server-ip {
    background: rgba(20, 15, 27, 0.7);
    border: 1.5px dashed var(--border-dashed);
    border-radius: 16px;
    padding: 22px 35px;
    display: flex;
    flex-direction: column;
    align-items: center;
    cursor: pointer;
    min-width: 320px;
    transition: all 0.2s ease;
}
.server-ip:hover {
    border-color: var(--purple-primary);
    box-shadow: 0 0 25px var(--purple-glow);
}
.server-status-badge {
    background: rgba(34, 197, 94, 0.12);
    color: var(--green-online);
    border: 1px solid rgba(34, 197, 94, 0.25);
    font-size: 0.8rem;
    font-weight: 700;
    padding: 4px 14px;
    border-radius: 20px;
    margin-bottom: 12px;
}
.ip-text {
    font-size: 1.45rem;
    font-weight: 800;
    color: var(--text-light);
}
.copy-badge {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-top: 4px;
}
.online-bar-wrapper {
    width: 100%;
    height: 4px;
    background: #251b30;
    border-radius: 2px;
    margin-top: 16px;
    overflow: hidden;
}
.online-bar-fill {
    height: 100%;
    background: var(--purple-primary);
}
.online-text {
    font-size: 0.82rem;
    color: var(--text-muted);
    margin-top: 8px;
}

/* SHOP & GRID */
.shop-container {
    max-width: 1350px;
    margin: 45px auto;
    padding: 0 40px;
}
.category-filters {
    display: flex;
    justify-content: center;
    gap: 12px;
    margin-bottom: 40px;
}
.cat-btn {
    background: var(--card-bg);
    border: none;
    color: #7b708b;
    padding: 12px 30px;
    border-radius: 12px;
    font-weight: 700;
    font-size: 0.95rem;
    cursor: pointer;
    transition: all 0.2s;
}
.cat-btn.active {
    background: var(--purple-primary);
    color: var(--text-light);
    box-shadow: 0 4px 18px var(--purple-glow);
}

.products-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 18px;
}
.product-card {
    background: var(--card-bg);
    border-radius: 14px;
    padding: 30px 15px 20px;
    text-align: center;
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: space-between;
    min-height: 270px;
}
.product-card:hover {
    transform: translateY(-4px);
    background: var(--card-hover);
}
.card-badge {
    position: absolute;
    top: 14px;
    font-size: 0.8rem;
    font-weight: 800;
    color: var(--text-light);
}
.card-icon img {
    width: 68px;
    height: 68px;
    margin: 10px 0 15px;
}
.product-card h3 {
    margin: 0;
    font-size: 1.05rem;
    font-weight: 800;
    color: var(--text-light);
}
.card-price {
    font-size: 1.25rem;
    font-weight: 800;
    color: var(--text-light);
    margin: 15px 0 10px;
}
.btn-select {
    background: #251e30;
    color: var(--text-light);
    border: none;
    padding: 10px;
    border-radius: 8px;
    font-weight: 700;
    cursor: pointer;
    width: 100%;
}
.btn-select:hover {
    background: var(--purple-primary);
}

/* MODAL FIXES (SIDE BY SIDE GATEWAYS & PURPLE SLIDER) */
.modal-overlay {
    display: none;
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(10, 7, 14, 0.88);
    z-index: 9999;
    backdrop-filter: blur(8px);
    justify-content: center;
    align-items: center;
}
.modal-overlay.open { display: flex; }
.modal-fullscreen-container {
    background: #17121f;
    border: 1px solid var(--border-dashed);
    width: 90%; max-width: 820px;
    border-radius: 20px; padding: 35px;
    position: relative;
}
.modal-close-btn {
    position: absolute; top: 15px; right: 20px;
    background: none; border: none; color: var(--text-muted);
    font-size: 2rem; cursor: pointer;
}
.modal-two-columns {
    display: grid; grid-template-columns: 1fr 1.2fr; gap: 30px; align-items: center;
}
.modal-left-col { text-align: center; }
.modal-product-image img { width: 100px; height: 100px; object-fit: contain; }
.modal-price-badge {
    font-size: 1.2rem; font-weight: bold; background: var(--bg-main);
    padding: 12px; border-radius: 10px; margin-top: 15px; border: 1px solid rgba(255,255,255,0.05);
}
.form-group { margin-bottom: 18px; }
.form-group label { display: block; margin-bottom: 8px; color: var(--text-muted); font-size: 0.9rem; }
.form-group input[type="text"], .form-group input[type="number"] {
    width: 100%; background: var(--bg-main); border: 1px solid var(--border-dashed);
    padding: 12px; border-radius: 10px; color: #fff; box-sizing: border-box; font-size: 1rem;
}

/* RANGE SLIDER FIX */
.dcoin-modal-calculator input[type="range"] {
    -webkit-appearance: none;
    width: 100%;
    height: 6px;
    background: #282035;
    border-radius: 3px;
    outline: none;
    margin-top: 10px;
}
.dcoin-modal-calculator input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: var(--purple-primary);
    cursor: pointer;
    box-shadow: 0 0 10px var(--purple-glow);
}

/* GATEWAY SELECTOR IN ONE ROW FIX */
.gateway-selector {
    display: flex !important;
    flex-direction: row !important;
    gap: 12px !important;
    width: 100%;
}
.gateway-card {
    flex: 1 !important;
    background: var(--bg-main);
    border: 1px solid var(--border-dashed);
    padding: 12px 15px;
    border-radius: 10px;
    text-align: center;
    cursor: pointer;
    color: var(--text-light);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: all 0.2s;
    margin: 0 !important;
}
.gateway-card.active {
    border-color: var(--purple-primary);
    background: rgba(155, 43, 185, 0.15);
    box-shadow: 0 0 12px var(--purple-glow);
}
.gateway-card input { display: none; }

.btn-pay-fullscreen {
    width: 100%; background: var(--purple-primary); color: #fff;
    border: none; padding: 14px; border-radius: 10px; font-weight: bold; font-size: 1rem; cursor: pointer;
    margin-top: 10px;
}

/* FOOTER FIX */
.footer {
    background: #0d0a11;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    padding: 45px 0; margin-top: 70px; color: var(--text-muted);
}
.footer-container {
    max-width: 1350px; margin: 0 auto; padding: 0 40px;
    display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 30px;
}
.footer-logo { font-size: 1.4rem; font-weight: bold; color: var(--text-light); margin-bottom: 8px; }
.footer-brand p { margin: 0; line-height: 1.5; font-size: 0.85rem; color: var(--text-muted); }
.footer-col h4 { color: var(--text-light); margin-top: 0; margin-bottom: 12px; }
.footer-col ul { list-style: none; padding: 0; margin: 0; }
.footer-col ul li { margin-bottom: 8px; }
.footer-col a { color: var(--text-muted); text-decoration: none; }
.footer-col a:hover { color: var(--text-light); }

/* TABS FIX (SEGMENTED CONTROL) */
.modal-dur-tabs {
    display: flex !important;
    background: var(--bg-main) !important;
    border: 1px solid var(--border-dashed) !important;
    padding: 4px !important;
    border-radius: 12px !important;
    gap: 4px !important;
    width: 100% !important;
    box-sizing: border-box !important;
}
.dur-tab-btn {
    flex: 1 !important;
    background: transparent !important;
    border: none !important;
    color: var(--text-muted) !important;
    padding: 10px 14px !important;
    border-radius: 8px !important;
    cursor: pointer !important;
    font-weight: 700 !important;
    font-size: 0.9rem !important;
    transition: all 0.2s ease !important;
    text-align: center !important;
}
.dur-tab-btn.active {
    background: var(--purple-primary) !important;
    color: #ffffff !important;
    box-shadow: 0 2px 10px var(--purple-glow) !important;
}

/* FEATURES BOX FIX */
.modal-features-list {
    background: var(--bg-main) !important;
    border: 1px solid var(--border-dashed) !important;
    border-radius: 12px !important;
    padding: 15px 18px 15px 35px !important;
    max-height: 160px !important;
    overflow-y: auto !important;
    color: #b0a4c0 !important;
    font-size: 0.9rem !important;
    margin: 0 !important;
    line-height: 1.6 !important;
}
.modal-features-list li {
    margin-bottom: 6px !important;
}
.modal-features-list li::marker {
    color: var(--purple-primary) !important;
}

/* CUSTOM SCROLLBAR FOR FEATURES */
.modal-features-list::-webkit-scrollbar {
    width: 6px;
}
.modal-features-list::-webkit-scrollbar-track {
    background: var(--bg-main);
    border-radius: 10px;
}
.modal-features-list::-webkit-scrollbar-thumb {
    background: var(--border-dashed);
    border-radius: 10px;
}
.modal-features-list::-webkit-scrollbar-thumb:hover {
    background: var(--purple-primary);
}

/* COMPACT TABS FIX */
.modal-dur-tabs {
    padding: 2px !important;
    border-radius: 8px !important;
    gap: 2px !important;
}
.dur-tab-btn {
    padding: 6px 10px !important;
    border-radius: 6px !important;
    font-size: 0.82rem !important;
}

/* COMPACT FEATURES & FORM GROUPS */
.form-group {
    margin-bottom: 12px !important;
}
.modal-features-list {
    padding: 10px 12px 10px 28px !important;
    max-height: 125px !important;
    font-size: 0.85rem !important;
}

/* GRADIENT LOGO FIX */
.nav-logo {
    font-size: 1.6rem !important;
    font-weight: 900 !important;
    letter-spacing: 2px !important;
    text-transform: uppercase !important;
    background: linear-gradient(90deg, #E22121 0%, #BD244C 30%, #86278D 60%, #4E2BCD 100%);
    -webkit-background-clip: text !important;
    -webkit-text-fill-color: transparent !important;
    display: inline-block !important;
    line-height: 1 !important;
}

/* LOGO BASELINE ALIGNMENT FIX */
.nav-logo {
    display: inline-flex !important;
    align-items: center !important;
    font-size: 1.6rem !important;
    font-weight: 900 !important;
    letter-spacing: 1px !important;
    text-decoration: none !important;
    line-height: 1 !important;
}
.nav-logo span {
    display: inline-block !important;
    line-height: 1 !important;
    font-size: 1.6rem !important;
    font-weight: 900 !important;
    font-family: inherit !important;
}

/* MODAL ANIMATION FIX */
.modal-overlay {
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.modal-overlay.open {
    display: flex !important;
    opacity: 1;
    visibility: visible;
}

.modal-fullscreen-container {
    transform: scale(0.85) translateY(20px);
    opacity: 0;
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1), opacity 0.3s ease;
}

.modal-overlay.open .modal-fullscreen-container {
    transform: scale(1) translateY(0);
    opacity: 1;
}

/* SMOOTH MODAL ANIMATIONS */
.modal-overlay {
    display: flex !important;
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(10, 7, 14, 0.88);
    z-index: 9999;
    backdrop-filter: blur(8px);
    justify-content: center;
    align-items: center;
    opacity: 0 !important;
    pointer-events: none !important;
    transition: opacity 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important;
}

.modal-overlay.open {
    opacity: 1 !important;
    pointer-events: auto !important;
}

.modal-fullscreen-container {
    transform: scale(0.8) translateY(30px) !important;
    opacity: 0 !important;
    transition: transform 0.35s cubic-bezier(0.175, 0.885, 0.32, 1.275), opacity 0.3s ease !important;
}

.modal-overlay.open .modal-fullscreen-container {
    transform: scale(1) translateY(0) !important;
    opacity: 1 !important;
}

/* HOVER ANIMATIONS & EFFECTS */

/* 1. Карточки товаров в сетке */
.product-card {
    transition: transform 0.3s cubic-bezier(0.25, 0.8, 0.25, 1), 
                background-color 0.3s ease, 
                box-shadow 0.3s ease !important;
}
.product-card:hover {
    transform: translateY(-8px) scale(1.02) !important;
    background: #231b2e !important;
    box-shadow: 0 12px 30px rgba(155, 43, 185, 0.25), 0 0 15px rgba(155, 43, 185, 0.15) !important;
}
.product-card .card-icon img {
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1) !important;
}
.product-card:hover .card-icon img {
    transform: scale(1.12) rotate(3deg) !important;
}

/* 2. Кнопки выбора категории */
.cat-btn {
    transition: all 0.25s ease !important;
}
.cat-btn:hover:not(.active) {
    background: #251d31 !important;
    color: #fff !important;
    transform: translateY(-2px) !important;
}

/* 3. Кнопка закрытия модального окна */
.modal-close-btn {
    transition: transform 0.3s ease, color 0.2s ease !important;
}
.modal-close-btn:hover {
    color: #ff4a4a !important;
    transform: rotate(90deg) scale(1.15) !important;
}

/* 4. Переключатели длительности привилегий (30/90/Навсегда) */
.dur-tab-btn {
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1) !important;
}
.dur-tab-btn:hover:not(.active) {
    background: rgba(155, 43, 185, 0.15) !important;
    color: #fff !important;
    transform: translateY(-1px) !important;
}

/* 5. Карточки способ оплаты (Lava / AnyPay) */
.gateway-card {
    transition: all 0.25s ease !important;
}
.gateway-card:hover:not(.active) {
    border-color: rgba(155, 43, 185, 0.6) !important;
    background: rgba(155, 43, 185, 0.08) !important;
    transform: translateY(-2px) !important;
}
.gateway-card.active {
    transition: all 0.25s ease !important;
}
.gateway-card.active:hover {
    transform: translateY(-2px) scale(1.02) !important;
    box-shadow: 0 4px 18px rgba(155, 43, 185, 0.35) !important;
}

/* 6. Главная кнопка "Перейти к оплате" */
.btn-pay-fullscreen {
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1) !important;
    position: relative;
    overflow: hidden;
}
.btn-pay-fullscreen:hover {
    background: #b131d2 !important;
    transform: translateY(-2px) scale(1.01) !important;
    box-shadow: 0 8px 25px rgba(155, 43, 185, 0.5) !important;
}
.btn-pay-fullscreen:active {
    transform: translateY(0) scale(0.98) !important;
}

/* 7. Кнопки "Купить" на карточках */
.btn-select {
    transition: all 0.25s ease !important;
}
.btn-select:hover {
    background: var(--purple-primary) !important;
    box-shadow: 0 4px 15px rgba(155, 43, 185, 0.4) !important;
    transform: translateY(-1px) !important;
}

/* MOBILE & RESPONSIVE ADAPTABILITY */

@media (max-width: 992px) {
    .hero-container {
        flex-direction: column;
        text-align: center;
        gap: 25px;
    }
    .hero-right {
        width: 100%;
        max-width: 450px;
    }
    .modal-two-columns {
        grid-template-columns: 1fr !important;
        gap: 20px !important;
    }
    .modal-left-col {
        border-right: none !important;
        border-bottom: 1px solid rgba(255, 255, 255, 0.1);
        padding-right: 0 !important;
        padding-bottom: 20px;
    }
}

@media (max-width: 768px) {
    .navbar .nav-container {
        flex-direction: column;
        gap: 12px;
        padding: 15px 20px;
    }
    .nav-links {
        gap: 15px;
        flex-wrap: wrap;
        justify-content: center;
    }
    .category-filters {
        justify-content: flex-start;
        overflow-x: auto;
        padding-bottom: 10px;
        white-space: nowrap;
        -webkit-overflow-scrolling: touch;
    }
    .cat-btn {
        flex: 0 0 auto;
    }
    .products-grid {
        grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)) !important;
        gap: 15px !important;
    }
    .modal-fullscreen-container {
        padding: 25px 18px !important;
        max-height: 90vh;
        overflow-y: auto;
    }
}

@media (max-width: 480px) {
    .products-grid {
        grid-template-columns: 1fr !important;
    }
    .server-title {
        font-size: 2.2rem !important;
    }
    .modal-dur-tabs {
        flex-direction: column !important;
        gap: 8px !important;
    }
    .dur-tab-btn {
        width: 100% !important;
    }
    .gateway-selector {
        flex-direction: column !important;
        gap: 10px !important;
    }
    .dcoin-modal-calculator {
        flex-direction: column !important;
        align-items: stretch !important;
    }
    #modal_dcoin_input, #modal_case_input {
        width: 100% !important;
    }
}
