/* ============ FIX HEADER OVERLAP ============ */
.rules-hero {
    min-height: 40vh;
    padding-top: 80px; /* فضای خالی برای هدر فیکس */
    display: flex;
    align-items: center;
    justify-content: center;
}

.rules-page-section {
    padding: 2rem 0 4rem;
    position: relative;
    z-index: 1;
}

.rules-page-section .container {
    max-width: 900px;
    margin: 0 auto;
    padding: 0 1.5rem;
    padding-top: 1rem; /* فاصله از بالای بخش */
}

/* تپ‌های sticky */
.rules-page-tabs {
    position: sticky;
    top: 70px; /* همون ارتفاع هدر */
    background: var(--bg-dark);
    z-index: 5;
    padding: 0.5rem 0;
    margin-bottom: 1.5rem;
}

/* هدر ثابت */
header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
}

/* ============ RULES PAGE (بقیه استایل‌ها) ============ */
:root {
    --primary: #8B2252;
    --primary-dark: #6B1A3F;
    --primary-light: #A83262;
    --primary-glow: rgba(139, 34, 82, 0.3);
    --primary-bg: rgba(139, 34, 82, 0.05);
    --primary-bg-hover: rgba(139, 34, 82, 0.1);
    --primary-border: rgba(139, 34, 82, 0.2);
    --primary-border-hover: rgba(139, 34, 82, 0.4);
    --bg-dark: #0a0a0a;
    --bg-card: #151515;
    --text: #ffffff;
    --text-light: #cccccc;
    --text-muted: #888888;
}

/* ===== SEARCH ===== */
.rules-page-search {
    position: relative;
    margin-bottom: 1.5rem;
    z-index: 10;
}

.rules-page-search .rules-search-input {
    width: 100%;
    padding: 1rem 1.5rem;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 50px;
    color: var(--text);
    font-size: 1rem;
    font-family: inherit;
    outline: none;
    transition: all 0.3s;
}

.rules-page-search .rules-search-input:focus {
    border-color: var(--primary-border);
    box-shadow: 0 0 20px var(--primary-glow);
    background: rgba(255, 255, 255, 0.05);
}

.rules-page-search .rules-search-input::placeholder {
    color: var(--text-muted);
}

.rules-search-autocomplete {
    position: absolute;
    top: calc(100% + 5px);
    left: 0;
    right: 0;
    background: var(--bg-card);
    border: 1px solid var(--primary-border);
    border-radius: 15px;
    max-height: 250px;
    overflow-y: auto;
    z-index: 20;
    display: none;
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.5);
}

.autocomplete-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.7rem 1rem;
    cursor: pointer;
    color: var(--text-light);
    font-size: 0.85rem;
    transition: all 0.2s;
    border-bottom: 1px solid rgba(255, 255, 255, 0.03);
}

.autocomplete-item:hover {
    background: var(--primary-bg);
    color: var(--text);
}

.autocomplete-category {
    color: var(--primary);
    font-size: 0.7rem;
    margin-right: auto;
    opacity: 0.7;
}

.autocomplete-no-result,
.autocomplete-count {
    padding: 0.8rem 1rem;
    text-align: center;
    color: var(--text-muted);
    font-size: 0.8rem;
}

/* ===== TABS ===== */
.rules-page-tabs {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    position: sticky;
    top: 70px;
    background: var(--bg-dark);
    z-index: 5;
    padding-top: 0.5rem;
}

.rules-page-tab {
    padding: 0.6rem 1.2rem;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 50px;
    background: transparent;
    color: var(--text-muted);
    font-size: 0.9rem;
    font-family: inherit;
    cursor: pointer;
    transition: all 0.3s;
    white-space: nowrap;
}

.rules-page-tab:hover {
    color: var(--text);
    border-color: rgba(255, 255, 255, 0.2);
    background: rgba(255, 255, 255, 0.03);
}

.rules-page-tab.active {
    background: var(--primary);
    border-color: var(--primary);
    color: white;
    box-shadow: 0 5px 15px var(--primary-glow);
}

.tab-count {
    font-size: 0.7rem;
    opacity: 0.7;
    margin-right: 0.3rem;
}

/* ===== CONTENT ===== */
.rules-category-block {
    display: none;
    animation: fadeIn 0.4s ease;
}

.rules-category-block.active {
    display: block;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.category-title-block {
    font-size: 1.3rem;
    color: var(--primary);
    margin-bottom: 1.5rem;
    padding-bottom: 0.8rem;
    border-bottom: 2px solid var(--primary-border);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* Rule Cards */
.rule-card {
    background: var(--bg-card);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    padding: 1.2rem 1.5rem;
    margin-bottom: 0.8rem;
    border-right: 3px solid var(--primary);
    transition: all 0.3s;
}

.rule-card:hover {
    border-color: rgba(255, 255, 255, 0.1);
    background: rgba(139, 34, 82, 0.03);
}

.rule-card-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 0.6rem;
    flex-wrap: wrap;
}

.rule-card-number {
    color: var(--primary);
    font-weight: bold;
    font-size: 0.85rem;
    min-width: 30px;
}

.rule-card-title {
    font-size: 1rem;
    color: var(--text);
    flex: 1;
}

.rule-card-desc {
    color: var(--text-light);
    font-size: 0.9rem;
    line-height: 1.7;
    margin-bottom: 0.6rem;
    padding-right: 2.5rem;
}

.rule-card-penalty {
    color: var(--text-muted);
    font-size: 0.8rem;
    padding-right: 2.5rem;
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.rule-card-penalty strong {
    color: var(--primary);
}

/* Severity */
.severity {
    padding: 0.15rem 0.6rem;
    border-radius: 15px;
    font-size: 0.7rem;
    border: 1px solid;
}

.severity.low { color: #00ff00; border-color: rgba(0,255,0,0.3); }
.severity.medium { color: #ffaa00; border-color: rgba(255,170,0,0.3); }
.severity.high { color: #ff4444; border-color: rgba(255,68,68,0.3); }

/* Coming Soon */
.coming-soon-block {
    text-align: center;
    padding: 3rem;
    color: var(--text-muted);
}

.coming-soon-block .icon {
    font-size: 3rem;
    margin-bottom: 1rem;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 768px) {
    .rules-hero {
        min-height: 30vh;
        padding-top: 70px;
    }
    
    .rules-page-tabs {
        top: 60px;
        gap: 0.3rem;
        padding: 0.5rem 0;
    }
    
    .rules-page-tab {
        padding: 0.5rem 0.8rem;
        font-size: 0.75rem;
    }
    
    .rule-card {
        padding: 1rem;
    }
    
    .rule-card-title {
        font-size: 0.9rem;
    }
    
    .rule-card-desc {
        padding-right: 1rem;
    }
    
    .rule-card-penalty {
        padding-right: 1rem;
    }
}

/* Rule Cards */
.rule-card:hover {
    border-color: rgba(255, 255, 255, 0.1);
    background: rgba(139, 34, 82, 0.03);
    box-shadow: 0 0 80px rgba(139, 34, 82, 0.15);
    transform: translateX(-3px);
}

/* Tabs */
.rules-page-tab:hover {
    color: var(--text);
    border-color: rgba(255, 255, 255, 0.2);
    background: rgba(255, 255, 255, 0.03);
    box-shadow: 0 0 40px rgba(139, 34, 82, 0.15);
}

.rules-page-tab.active {
    background: var(--primary);
    border-color: var(--primary);
    color: white;
    box-shadow: 0 5px 15px var(--primary-glow),
                0 0 60px rgba(139, 34, 82, 0.2);
}