/* ===== RULES PAGE STYLES ===== */

/* Rules Hero */
.rules-hero {
    position: relative;
    min-height: 50vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 140px 20px 80px;
    background:
        radial-gradient(ellipse at 50% 50%, rgba(212, 160, 23, 0.1) 0%, transparent 60%),
        var(--dark);
    overflow: hidden;
}

.rules-hero-overlay {
    position: absolute;
    inset: 0;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><defs><pattern id="g" width="20" height="20" patternUnits="userSpaceOnUse"><circle cx="10" cy="10" r="0.5" fill="rgba(255,255,255,0.03)"/></pattern></defs><rect fill="url(%23g)" width="100" height="100"/></svg>');
    z-index: 1;
}

.rules-hero-content {
    position: relative;
    z-index: 2;
    text-align: center;
    max-width: 700px;
    margin: 0 auto;
    animation: fadeInUp 0.8s ease;
}

.rules-hero-title {
    margin-bottom: 20px;
}

.rules-hero-title .title-main {
    font-size: clamp(2.5rem, 6vw, 4rem);
    font-weight: 900;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    display: block;
}

.rules-hero-desc {
    font-size: 1.1rem;
    color: rgba(241, 250, 238, 0.6);
    line-height: 1.8;
    max-width: 600px;
    margin: 0 auto;
}

/* Rules Section */
.rules-section {
    padding: 80px 0 100px;
    background: var(--dark-2);
    position: relative;
    z-index: 1;
}

/* Categories Tabs */
.categories-tabs {
    display: flex;
    gap: 12px;
    margin-bottom: 50px;
    flex-wrap: wrap;
    justify-content: center;
    animation: fadeInUp 0.8s ease 0.2s both;
}

.category-tab {
    display: flex;
    align-items: center;
    gap: 10px;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.06);
    padding: 14px 24px;
    border-radius: var(--radius-sm);
    font-family: 'Tajawal', sans-serif;
    font-size: 0.95rem;
    font-weight: 600;
    color: rgba(241, 250, 238, 0.6);
    cursor: pointer;
    transition: var(--transition);
    white-space: nowrap;
}

.category-tab i {
    font-size: 1.1rem;
}

.category-tab:hover {
    background: rgba(212, 160, 23, 0.05);
    border-color: rgba(212, 160, 23, 0.2);
    color: var(--light);
    transform: translateY(-2px);
}

.category-tab.active {
    background: var(--gradient-primary);
    border-color: var(--primary);
    color: white;
    box-shadow: 0 4px 20px rgba(212, 160, 23, 0.3);
}

/* Rules Content */
.rules-content {
    position: relative;
}

.rules-category {
    display: none;
    animation: fadeIn 0.5s ease;
}

.rules-category.active {
    display: block;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Category Header */
.category-header {
    display: flex;
    align-items: center;
    gap: 24px;
    margin-bottom: 50px;
    padding: 32px;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: var(--radius);
    animation: fadeInUp 0.6s ease 0.1s both;
}

.category-header .category-icon {
    width: 80px;
    height: 80px;
    background: var(--gradient-primary);
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    color: white;
    box-shadow: 0 8px 25px rgba(212, 160, 23, 0.3);
    flex-shrink: 0;
}

.category-info h2 {
    font-size: clamp(1.5rem, 3vw, 2rem);
    font-weight: 800;
    margin-bottom: 8px;
    color: var(--light);
}

.category-info p {
    font-size: 1rem;
    color: rgba(241, 250, 238, 0.5);
    line-height: 1.7;
}

/* Rules Grid */
.rules-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 24px;
    animation: fadeInUp 0.6s ease 0.2s both;
}

/* Rule Card */
.rule-card {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: var(--radius);
    padding: 28px;
    transition: var(--transition);
    position: relative;
    overflow: hidden;
}

.rule-card::before {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 100%;
    height: 3px;
    background: var(--gradient-primary);
    transform: scaleX(0);
    transform-origin: right;
    transition: transform 0.4s ease;
}

.rule-card:hover::before {
    transform: scaleX(1);
}

.rule-card:hover {
    background: rgba(212, 160, 23, 0.03);
    border-color: rgba(212, 160, 23, 0.15);
    transform: translateY(-6px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
}

.rule-card.mistake {
    border-color: rgba(239, 68, 68, 0.15);
}

.rule-card.mistake:hover {
    background: rgba(239, 68, 68, 0.03);
    border-color: rgba(239, 68, 68, 0.25);
}

.rule-card.mistake::before {
    background: linear-gradient(135deg, #ef4444, #dc2626);
}

/* Rule Header */
.rule-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
}

.rule-icon {
    width: 50px;
    height: 50px;
    background: rgba(212, 160, 23, 0.1);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.3rem;
    color: var(--primary-light);
    transition: var(--transition);
}

.rule-card:hover .rule-icon {
    background: var(--gradient-primary);
    color: white;
    box-shadow: 0 6px 20px rgba(212, 160, 23, 0.3);
    transform: scale(1.05);
}

.rule-card.mistake .rule-icon {
    background: rgba(239, 68, 68, 0.1);
    color: #f87171;
}

.rule-card.mistake:hover .rule-icon {
    background: linear-gradient(135deg, #ef4444, #dc2626);
    color: white;
}

.rule-number {
    width: 40px;
    height: 40px;
    background: rgba(212, 160, 23, 0.1);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    font-weight: 800;
    color: var(--primary-light);
    border: 1px solid rgba(212, 160, 23, 0.2);
}

.rule-card.mistake .rule-number {
    background: rgba(239, 68, 68, 0.1);
    color: #f87171;
    border-color: rgba(239, 68, 68, 0.2);
}

/* Rule Content */
.rule-card h3 {
    font-size: 1.1rem;
    font-weight: 700;
    margin-bottom: 12px;
    color: var(--light);
    line-height: 1.4;
}

.rule-card p {
    font-size: 0.95rem;
    color: rgba(241, 250, 238, 0.5);
    line-height: 1.8;
    margin-bottom: 16px;
}

/* Rule Penalty & Tip */
.rule-penalty,
.rule-tip {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
    background: rgba(212, 160, 23, 0.08);
    border: 1px solid rgba(212, 160, 23, 0.15);
    border-radius: var(--radius-sm);
    font-size: 0.85rem;
    color: var(--primary-light);
    margin-top: auto;
}

.rule-penalty i,
.rule-tip i {
    font-size: 1rem;
    flex-shrink: 0;
}

.rule-penalty.severe {
    background: rgba(239, 68, 68, 0.08);
    border-color: rgba(239, 68, 68, 0.2);
    color: #f87171;
}

.rule-penalty.severe i {
    color: #ef4444;
}

.rule-tip {
    background: rgba(59, 130, 246, 0.08);
    border-color: rgba(59, 130, 246, 0.2);
    color: #60a5fa;
}

.rule-tip i {
    color: #3b82f6;
}

/* Rules Notice */
.rules-notice {
    display: flex;
    gap: 24px;
    align-items: flex-start;
    background: rgba(59, 130, 246, 0.05);
    border: 1px solid rgba(59, 130, 246, 0.2);
    border-radius: var(--radius);
    padding: 28px 32px;
    margin-top: 60px;
    animation: fadeInUp 0.6s ease 0.4s both;
}

.notice-icon {
    width: 60px;
    height: 60px;
    background: rgba(59, 130, 246, 0.15);
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.8rem;
    color: #60a5fa;
    flex-shrink: 0;
}

.notice-content h3 {
    font-size: 1.2rem;
    font-weight: 700;
    margin-bottom: 8px;
    color: #60a5fa;
}

.notice-content p {
    font-size: 0.95rem;
    color: rgba(241, 250, 238, 0.6);
    line-height: 1.8;
}

/* Responsive */
@media (max-width: 968px) {
    .rules-hero {
        min-height: 40vh;
        padding: 120px 20px 60px;
    }

    .rules-section {
        padding: 60px 0 80px;
    }

    .categories-tabs {
        gap: 8px;
    }

    .category-tab {
        padding: 12px 18px;
        font-size: 0.9rem;
    }

    .category-tab span {
        display: none;
    }

    .category-tab i {
        font-size: 1.3rem;
    }

    .category-header {
        flex-direction: column;
        text-align: center;
        padding: 24px;
        gap: 16px;
    }

    .rules-grid {
        grid-template-columns: 1fr;
    }

    .rules-notice {
        flex-direction: column;
        text-align: center;
        gap: 16px;
    }

    .notice-icon {
        margin: 0 auto;
    }
}

@media (max-width: 640px) {
    .rules-hero {
        padding: 100px 20px 50px;
    }

    .category-header .category-icon {
        width: 60px;
        height: 60px;
        font-size: 1.5rem;
    }

    .rule-card {
        padding: 24px 20px;
    }

    .rules-notice {
        padding: 20px;
    }
}

/* Loading Animation */
.rules-category.active {
    animation: slideIn 0.4s ease;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateX(-20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* Scroll Animation */
.rule-card {
    opacity: 0;
    transform: translateY(30px);
    animation: fadeInUpCard 0.5s ease forwards;
}

@keyframes fadeInUpCard {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.rule-card:nth-child(1) { animation-delay: 0.05s; }
.rule-card:nth-child(2) { animation-delay: 0.1s; }
.rule-card:nth-child(3) { animation-delay: 0.15s; }
.rule-card:nth-child(4) { animation-delay: 0.2s; }
.rule-card:nth-child(5) { animation-delay: 0.25s; }
.rule-card:nth-child(6) { animation-delay: 0.3s; }
.rule-card:nth-child(7) { animation-delay: 0.35s; }
.rule-card:nth-child(8) { animation-delay: 0.4s; }
