/* ========================================
   Enhanced Rules Section Styling
   ======================================== */

.rules-container {
    max-width: 1200px;
    margin: 0 auto;
}

/* Document Cards */
.rules-document-card {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 15px;
    padding: 30px;
    color: white;
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
    margin-bottom: 30px;
}

.rules-document-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.15);
}

.document-header {
    display: flex;
    align-items: center;
    gap: 20px;
    margin-bottom: 25px;
}

.document-icon {
    font-size: 3rem;
    color: #ffffff;
    opacity: 0.9;
}

.document-info h3 {
    margin: 0 0 10px 0;
    font-size: 1.5rem;
    font-weight: 600;
    color: #ffffff;
}

.document-info p {
    margin: 0;
    color: rgba(255, 255, 255, 0.9);
    font-size: 1.1rem;
}

.document-actions {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
}

.btn-download, .btn-view {
    padding: 12px 25px;
    border-radius: 10px;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.btn-download {
    background: rgba(255, 255, 255, 0.2);
    color: white;
    border: 2px solid rgba(255, 255, 255, 0.3);
}

.btn-download:hover {
    background: rgba(255, 255, 255, 0.3);
    color: white;
    transform: translateY(-2px);
}

.btn-view {
    background: transparent;
    color: white;
    border: 2px solid rgba(255, 255, 255, 0.5);
}

.btn-view:hover {
    background: rgba(255, 255, 255, 0.1);
    color: white;
}

/* Interactive Rules Section */
.rules-interactive-section {
    margin-top: 40px;
}

.rules-header {
    text-align: center;
    margin-bottom: 30px;
}

.rules-title {
    font-size: 2rem;
    font-weight: 700;
    color: #2c3e50;
    margin-bottom: 10px;
}

.rules-subtitle {
    color: #7f8c8d;
    font-size: 1.1rem;
    margin: 0;
}

/* Modern Rules Accordion */
.rules-accordion {
    margin-bottom: 40px;
    max-width: 100%;
}

.rules-accordion-item {
    background: white;
    border-radius: 16px;
    margin-bottom: 20px;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.08);
    overflow: hidden;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    border: 2px solid transparent;
}

.rules-accordion-item:hover {
    box-shadow: 0 12px 35px rgba(0, 0, 0, 0.12);
    border-color: rgba(102, 126, 234, 0.2);
    transform: translateY(-2px);
}

.rules-accordion-header {
    margin: 0;
}

.rules-accordion-button {
    width: 100%;
    padding: 24px 28px;
    border: none;
    background: white;
    text-align: left;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: space-between;
    transition: all 0.3s ease;
    font-size: 1.1rem;
    position: relative;
    outline: none;
}

.rules-accordion-button::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.05) 0%, rgba(118, 75, 162, 0.05) 100%);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.rules-accordion-button:hover {
    background: #f8faff;
}

.rules-accordion-button:hover::before {
    opacity: 1;
}

.rules-accordion-button.collapsed {
    background: white;
}

.rules-accordion-button:not(.collapsed) {
    background: linear-gradient(135deg, #f8faff 0%, #f1f5ff 100%);
    border-bottom: 1px solid rgba(102, 126, 234, 0.1);
}

.accordion-button-content {
    display: flex;
    align-items: center;
    gap: 15px;
}

.accordion-icon {
    font-size: 1.5rem;
    color: #667eea;
    transition: all 0.3s ease;
    padding: 12px;
    border-radius: 12px;
    background: rgba(102, 126, 234, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 48px;
    min-height: 48px;
}

.rules-accordion-button:hover .accordion-icon {
    background: rgba(102, 126, 234, 0.15);
    transform: scale(1.1);
}

.rules-accordion-button:not(.collapsed) .accordion-icon {
    background: rgba(102, 126, 234, 0.2);
    color: #5a67d8;
}

.accordion-text {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.category-name {
    font-weight: 600;
    color: #2c3e50;
    font-size: 1.1rem;
}

.rules-count {
    color: #7f8c8d;
    font-size: 0.9rem;
}

.accordion-chevron {
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    font-size: 1.3rem;
    color: #94a3b8;
    padding: 8px;
    border-radius: 50%;
    background: rgba(148, 163, 184, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 32px;
    min-height: 32px;
}

.rules-accordion-button:hover .accordion-chevron {
    background: rgba(102, 126, 234, 0.1);
    color: #667eea;
    transform: scale(1.1);
}

.rules-accordion-button:not(.collapsed) .accordion-chevron {
    transform: rotate(180deg);
}

/* Enhanced Rules Content with Smooth Animations */
.rules-accordion-collapse {
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    overflow: hidden;
}

/* Modern Collapse States */
.rules-accordion-collapse.collapse {
    max-height: 0;
    opacity: 0;
    transform: translateY(-10px);
    transition: max-height 0.4s ease, opacity 0.3s ease, transform 0.3s ease;
}

.rules-accordion-collapse.collapsing {
    position: relative;
    overflow: hidden;
    transition: max-height 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.rules-accordion-collapse.collapse.show {
    max-height: 1000px;
    opacity: 1;
    transform: translateY(0);
    transition: max-height 0.4s ease, opacity 0.3s ease 0.1s, transform 0.3s ease 0.1s;
}

/* Enhanced Accordion Button States */
.rules-accordion-button:not(.collapsed) {
    background: linear-gradient(135deg, #f8faff 0%, #f1f5ff 100%);
    border-bottom: 1px solid rgba(102, 126, 234, 0.1);
}

.rules-accordion-button:not(.collapsed) .accordion-chevron {
    transform: rotate(180deg);
    color: #667eea;
}

.rules-accordion-button.collapsed .accordion-chevron {
    transform: rotate(0deg);
    color: #94a3b8;
}

.rules-accordion-button:focus {
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
    outline: none;
}

.rules-accordion-body {
    padding: 0 25px 25px 25px;
    border-top: 1px solid #e9ecef;
}

.rules-list {
    margin-top: 20px;
}

.rule-item {
    padding: 24px;
    border-radius: 12px;
    margin-bottom: 16px;
    background: linear-gradient(135deg, #f8faff 0%, #f1f5ff 100%);
    border-left: 4px solid #667eea;
    position: relative;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border: 1px solid rgba(102, 126, 234, 0.1);
    overflow: hidden;
}

.rule-item::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.05) 0%, rgba(118, 75, 162, 0.05) 100%);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.rule-item:hover {
    background: linear-gradient(135deg, #f1f5ff 0%, #e8f2ff 100%);
    transform: translateX(8px) translateY(-2px);
    border-left-color: #5a67d8;
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.15);
}

.rule-item:hover::before {
    opacity: 1;
}

.rule-item.highlighted {
    background: linear-gradient(135deg, #fff8db 0%, #fef3c7 100%);
    border-left-color: #f59e0b;
    border-color: rgba(245, 158, 11, 0.2);
}

.rule-item.highlighted::before {
    background: linear-gradient(135deg, rgba(245, 158, 11, 0.1) 0%, rgba(251, 191, 36, 0.1) 100%);
}

.rule-item.highlighted:hover {
    background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
    border-left-color: #d97706;
    box-shadow: 0 8px 25px rgba(245, 158, 11, 0.2);
}

.rule-item.highlighted .rule-highlight-badge {
    position: absolute;
    top: 16px;
    right: 16px;
    color: #f59e0b;
    font-size: 1.3rem;
    z-index: 2;
    background: rgba(255, 255, 255, 0.9);
    padding: 8px;
    border-radius: 50%;
    box-shadow: 0 2px 8px rgba(245, 158, 11, 0.2);
    animation: pulse-warning 2s infinite;
}

@keyframes pulse-warning {
    0%, 100% {
        transform: scale(1);
        opacity: 1;
    }
    50% {
        transform: scale(1.1);
        opacity: 0.8;
    }
}

.rule-title {
    font-size: 1.15rem;
    font-weight: 700;
    color: #1e293b;
    margin-bottom: 12px;
    position: relative;
    z-index: 1;
    display: flex;
    align-items: center;
    gap: 8px;
}

.rule-title::before {
    content: '▶';
    color: #667eea;
    font-size: 0.8rem;
    transition: transform 0.3s ease;
}

.rule-item:hover .rule-title::before {
    transform: scale(1.2);
}

.rule-text {
    color: #475569;
    line-height: 1.7;
    position: relative;
    z-index: 1;
    font-size: 1rem;
}

.rule-text p {
    margin-bottom: 10px;
}

.rule-text ul, .rule-text ol {
    margin-left: 20px;
    margin-bottom: 10px;
}

/* Notice Section */
.rules-notice {
    background: linear-gradient(135deg, #74b9ff, #0984e3);
    border-radius: 15px;
    padding: 30px;
    margin-bottom: 30px;
    color: white;
}

.notice-content {
    display: flex;
    align-items: flex-start;
    gap: 20px;
}

.notice-icon {
    font-size: 2.5rem;
    color: rgba(255, 255, 255, 0.9);
    flex-shrink: 0;
}

.notice-title {
    font-size: 1.3rem;
    font-weight: 600;
    margin-bottom: 10px;
    color: white;
}

.notice-description {
    color: rgba(255, 255, 255, 0.9);
    line-height: 1.6;
    margin: 0;
}

/* Contact Section */
.rules-contact {
    margin-top: 40px;
}

.contact-card {
    background: white;
    border-radius: 15px;
    padding: 30px;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.1);
    text-align: center;
}

.contact-header {
    margin-bottom: 20px;
}

.contact-title {
    font-size: 1.3rem;
    font-weight: 600;
    color: #2c3e50;
    margin-bottom: 10px;
}

.contact-content p {
    color: #7f8c8d;
    margin-bottom: 25px;
}

.contact-actions {
    display: flex;
    gap: 15px;
    justify-content: center;
    flex-wrap: wrap;
}

.contact-actions .btn {
    padding: 12px 25px;
    border-radius: 10px;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.contact-actions .btn:hover {
    transform: translateY(-2px);
}

/* Responsive Design */
@media (max-width: 768px) {
    .rules-container {
        padding: 0 15px;
    }
    
    .rules-document-card {
        padding: 20px;
    }
    
    .document-header {
        flex-direction: column;
        text-align: center;
        gap: 15px;
    }
    
    .document-actions {
        justify-content: center;
    }
    
    .btn-download, .btn-view {
        padding: 10px 20px;
        font-size: 0.9rem;
    }
    
    .rules-accordion-button {
        padding: 15px 20px;
    }
    
    .rules-accordion-item .rules-accordion-button .accordion-button-content {
        flex-direction: column !important;
        align-items: center !important; /* Changed from flex-start to maintain symmetry */
        gap: 10px !important;
        text-align: center !important; /* Ensure text content stays centered */
        width: 100% !important; /* Ensure full width usage */
        justify-content: center !important; /* Center vertically */
        display: flex !important; /* Ensure flex display */
    }
    
    /* Additional mobile accordion text centering */
    .rules-accordion-item .rules-accordion-button .accordion-text {
        text-align: center !important;
        width: 100% !important;
    }
    
    .rules-accordion-item .rules-accordion-button .category-name {
        text-align: center !important;
        width: 100% !important;
    }
    
    .rules-accordion-item .rules-accordion-button .rules-count {
        text-align: center !important;
        width: 100% !important;
    }
}

/* Override scroll animations that create zig-zag pattern */
.rules-accordion-item.animate-on-scroll {
    transform: translateX(0) !important; /* Center all items */
}

.rules-accordion-item:nth-child(even).animate-on-scroll {
    transform: translateX(0) !important; /* Center even items too */
}

.rules-accordion-item.animate-on-scroll.is-visible {
    transform: translateX(0) !important; /* Keep centered when visible */
}

.rules-accordion-item:nth-child(even).animate-on-scroll.is-visible {
    transform: translateX(0) !important; /* Keep even items centered when visible */
}
    
    .rule-item {
        padding: 15px;
    }
    
    .notice-content {
        flex-direction: column;
        text-align: center;
    }
    
    .contact-actions {
        flex-direction: column;
        align-items: center;
    }
    
    .contact-actions .btn {
        width: 100%;
        max-width: 250px;
    }
}

@media (max-width: 480px) {
    .rules-title {
        font-size: 1.5rem;
    }
    
    .document-actions {
        flex-direction: column;
    }
    
    .btn-download, .btn-view {
        width: 100%;
        justify-content: center;
    }
    
    .rules-accordion-button {
        font-size: 1rem;
    }
    
    .category-name {
        font-size: 1rem;
    }
} 