/* --- Global Scroll --- */
html {
    scroll-behavior: smooth;
}

/* --- Main Container --- */
.rules-container {
    max-width: 1000px;
    margin: 0 auto;
    padding: 20px 20px 100px;
    min-height: 100vh;
}

/* --- Placeholder --- */
#nav-placeholder {
    display: none;
    height: 60px;
    width: 100%;
}

/* --- Sticky Navigation --- */
.sticky-nav {
    background: rgba(11, 13, 16, 0.98);
    backdrop-filter: blur(12px);
    padding: 10px 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    z-index: 9999;
    transition: all 0.3s ease;
    
    /* Important for absolute positioning of children */
    position: relative; 
}

/* OVERRIDE MARGINS from main css */
.sticky-nav.server-nav {
    margin: 0 !important;
}

/* --- Fixed State Class --- */
.fixed-active {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    box-shadow: 0 4px 20px rgba(0,0,0,0.8);
    animation: slideDown 0.3s ease;
}

@keyframes slideDown {
    from { transform: translateY(-100%); }
    to { transform: translateY(0); }
}

/* --- Nav Links Container --- */
.nav-links-container {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
    justify-content: center; /* This now centers perfectly relative to the screen */
    flex-grow: 1;
}

/* --- NAV BUTTONS --- */
.server-nav-btn {
    text-decoration: none !important;
    border-bottom: none !important;
    font-size: 0.9rem !important;
    padding: 10px 12px;
    display: inline-block;
    position: relative;
    color: var(--text-medium);
}

.server-nav-btn:hover, .server-nav-btn.active {
    color: var(--primary-accent) !important;
    text-decoration: none !important;
}

/* --- SHARED STYLES: Back Button & Toggle Button --- */
.back-btn-nav, 
.nav-toggle-btn {
    text-decoration: none !important;
    color: var(--primary-accent);
    border: 1px solid var(--primary-accent);
    padding: 6px 15px;
    border-radius: 4px;
    font-weight: 700;
    font-size: 0.85rem;
    text-transform: uppercase;
    transition: all 0.3s ease;
    white-space: nowrap;
    background: rgba(15, 255, 213, 0.05);
    cursor: pointer;
    font-family: 'Orbitron', sans-serif;
}

.back-btn-nav:hover,
.nav-toggle-btn:hover {
    background: var(--primary-accent);
    color: #000;
    box-shadow: 0 0 15px var(--primary-accent);
}

/* --- DESKTOP SPECIFIC: Button Positioning --- */

/* 1. Hide Toggle on Desktop */
.nav-toggle-btn {
    display: none; 
}

/* 2. Absolute Position for Back Button (Fixes Centering) */
.back-btn-nav {
    position: absolute;
    right: 20px; /* Aligns with container padding */
    top: 50%;
    transform: translateY(-50%); /* Vertically center */
    z-index: 10;
}

/* --- Sections --- */
.rules-section {
    margin-bottom: 60px;
    scroll-margin-top: 100px; 
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    padding-top: 40px;
}

.rules-section:first-child {
    border-top: none;
    padding-top: 20px;
}

.section-title {
    font-family: 'Orbitron', sans-serif;
    color: var(--primary-accent);
    font-size: 1.8rem;
    margin-bottom: 25px;
    text-transform: uppercase;
    letter-spacing: 1px;
    padding-left: 10px;
    border-left: 4px solid var(--primary-accent);
}

/* --- Rule Cards --- */
.rules-list-wrapper {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.rule-card {
    background: var(--panel-bg);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 12px;
    padding: 0;
    position: relative;
    transition: all 0.3s ease;
    width: 100%;
    overflow: hidden;
}

.rule-card:hover {
    border-color: var(--primary-accent);
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.3);
    transform: translateX(5px);
}

.rule-card h3 {
    font-family: 'Orbitron', sans-serif;
    color: #ffffff;
    font-size: 1.2rem;
    margin: 0;
    padding: 20px 25px;
    display: flex;
    align-items: center;
    background: rgba(255, 255, 255, 0.02);
    border-bottom: 1px solid var(--primary-accent); 
    box-shadow: 0 1px 10px rgba(15, 255, 213, 0.1);
}

.card-content {
    padding: 20px 25px;
}

.highlight {
    color: var(--primary-accent);
    margin-right: 12px;
    font-size: 1.4rem;
    font-weight: bold;
    text-shadow: 0 0 8px rgba(18, 247, 214, 0.4);
}

.card-content p {
    color: #d1d5db;
    font-size: 0.95rem;
    line-height: 1.6;
    margin-bottom: 15px;
}

.card-content ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.card-content li {
    position: relative;
    padding-left: 25px;
    margin-bottom: 8px;
    color: #d1d5db;
    font-size: 0.9rem;
    line-height: 1.5;
}

.card-content li::before {
    content: '▪';
    position: absolute;
    left: 5px;
    color: var(--primary-accent);
    font-size: 1.2rem;
    line-height: 1.2rem;
}

.warning {
    color: #ff6b6b !important;
    background: rgba(255, 107, 107, 0.1);
    border-left: 3px solid #ff6b6b;
    padding: 10px 15px;
    border-radius: 4px;
    margin-bottom: 15px;
}

.text-highlight {
color: #ff6b6b;
font-weight: bold;
}
.text-cyan {
    color: #12f7d6;
    font-weight: bold;
}
.info-box {
    color: #12f7d6 !important;
    background: rgba(18, 247, 214, 0.1);
    border-left: 3px solid #12f7d6;
    padding: 10px 15px;
    border-radius: 4px;
    margin-bottom: 15px;
}
.divider-red {
    border: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, #ff6b6b, transparent);
    margin: 25px 0;
    opacity: 0.8;
}
.divider-cyan {
    border: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, #12f7d6, transparent);
    margin: 25px 0;
    opacity: 0.8;
}
.hero-title, 
.section-title, 
.rule-card h3,
.nav-toggle-btn,
.back-btn-nav {
font-family: 'Inter', sans-serif !important;
letter-spacing: 0px; /* Махаме разстоянията, ако са твърде големи */
}
.hero-subtitle {
    text-align: center;
}

.disclaimer-card h3 {
    justify-content: center; /* Центрира заглавието */
    text-align: center;
    letter-spacing: 1px;
}

.disclaimer-divider {
    border: 0;
    height: 1px;
    margin: 20px 0;
    opacity: 0.6;
    /* Цветът се определя от темата по-долу */
}

.disclaimer-important {
    margin-top: 25px;
    padding: 15px;
    border-radius: 6px;
    text-align: center;
    font-weight: bold;
    text-transform: uppercase;
    /* Цветовете се определят от темата по-долу */
}
.theme-disclaimer {
    border-color: rgba(255, 193, 7, 0.4) !important;
}

.theme-disclaimer:hover {
    box-shadow: 0 5px 25px rgba(255, 193, 7, 0.2) !important;
    border-color: #ffc107 !important;
}

.theme-disclaimer h3 {
    border-bottom-color: #ffc107 !important;
    color: #ffc107 !important;
    text-shadow: 0 0 10px rgba(255, 193, 7, 0.3);
}

.theme-disclaimer .highlight {
    color: #ffc107 !important;
    text-shadow: none;
}

.theme-disclaimer .disclaimer-divider {
    background: linear-gradient(90deg, transparent, #ffc107, transparent);
}

.theme-disclaimer .disclaimer-important {
    background: rgba(255, 193, 7, 0.1);
    color: #ffc107;
    border: 1px solid #ffc107;
}


/* --- Responsive & Mobile Logic --- */
@media screen and (max-width: 768px) {
    .sticky-nav {
        flex-direction: column;
        gap: 10px;
        align-items: stretch; 
    }
    
    /* 1. Toggle Button (Mobile Only) */
    .nav-toggle-btn {
        display: block; 
        width: 100%;    
        margin-top: 10px;
        text-align: center;
        background: rgba(15, 255, 213, 0.05);
        color: var(--primary-accent);
        border: 1px solid var(--primary-accent);
        padding: 6px 15px;
        border-radius: 4px;
        font-weight: 700;
        font-size: 0.85rem;
        text-transform: uppercase;
        cursor: pointer;
        line-height: 1.2;
    }

    .nav-toggle-btn:hover {
        background: var(--primary-accent);
        color: #000;
        box-shadow: 0 0 15px var(--primary-accent);
    }

    /* 2. Container Adjustment */
    .nav-links-container {
        gap: 8px;
        width: 100%;
        display: flex; 
        flex-direction: column; 
    }
    
    .server-nav-btn {
        width: 100%;
        text-align: center;
        background: rgba(255,255,255,0.02);
        border-radius: 4px;
    }

    /* 3. Back Button Reset (No Absolute on Mobile) */
    .back-btn-nav {
        position: static; /* RESET absolute */
        transform: none;  /* RESET transform */
        width: 100%;
        text-align: center;
        display: block;
        right: auto;
        top: auto;
    }

    /* 4. HIDING LOGIC */
    .sticky-nav.nav-collapsed .nav-links-container,
    .sticky-nav.nav-collapsed .back-btn-nav {
        display: none !important;
    }

    .sticky-nav.nav-collapsed {
        padding-bottom: 10px;
        gap: 0;
    }
}