/* Rule Finder Specific Styles - Match Game Finder exactly */

/* Override for Rule Finder page */
.quick-filters::before {
    content: "rule filters" !important;
    font-weight: normal !important;
}

/* Active Rule Styling - Base styles for all browsers */
.rules-masonry .rule-card.active-rule.card,
.rule-card.active-rule.card,
.card.rule-card.active-rule {
    background-color: #e6f7ff !important; /* Light blue background */
    color: inherit !important; /* Keep original text color */
    transition: all 0.3s ease !important;
    outline: 2px solid #00AEEF !important;
    outline-offset: -2px !important;
    box-shadow: 0 4px 12px rgba(0, 174, 239, 0.3) !important;
    position: relative !important;
    overflow: visible !important;
    isolation: isolate !important; /* Create new stacking context */
}

/* ACTIVE indicator overlay - Base positioning */
.active-indicator-overlay {
    position: absolute !important;
    top: 8px !important;
    left: 8px !important;
    background-color: #00AEEF !important;
    color: white !important;
    font-size: 0.75rem !important;
    font-weight: bold !important;
    padding: 4px 8px !important;
    border-radius: 4px !important;
    text-transform: uppercase !important;
    letter-spacing: 0.5px !important;
    z-index: 1000 !important;
    pointer-events: none !important;
    display: block !important;
    width: auto !important;
    height: auto !important;
    margin: 0 !important;
    line-height: 1 !important;
}

/* Desktop Safari-specific fixes only */
@media (min-width: 768px) {
    @supports (-webkit-appearance: none) {
        /* Use border instead of outline for desktop Safari only */
        .rule-card.active-rule {
            outline: none !important;
            border: 3px solid #00AEEF !important;
            margin: 8px !important; /* Add margin to prevent clipping */
            transform: none !important; /* Remove transform to prevent clipping */
        }
        
        .active-indicator-overlay {
            top: -3px !important; /* Position above the border */
            left: 12px !important;
            box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2) !important;
        }
        
        .rules-masonry {
            padding: 12px !important; /* Add padding to prevent clipping */
            margin: -12px !important; /* Negative margin to compensate */
        }
    }
}

/* Keep original colors for active rules - light blue background with dark text */
.rule-card.active-rule .card-body {
    color: inherit !important;
}

.rule-card.active-rule .card-title {
    color: inherit !important;
}

.rule-card.active-rule .card-text {
    color: inherit !important;
}

.rule-card.active-rule .badge {
    /* Keep original badge colors */
}

/* Copy Game Finder's exact button structure from custom.css */
.category-btn, .difficulty-btn, .game-btn {
    min-width: 70px;
    text-align: center;
    margin-bottom: 3px;
    font-size: 0.75rem;
    padding: 0.25rem 0.5rem;
}

/* Copy Game Finder's exact btn-xs from custom.css */
.btn-xs {
    padding: 0.2rem 0.4rem;
    font-size: 0.7rem;
    line-height: 1.2;
    border-radius: 0.2rem;
}

/* Copy Game Finder's exact desktop override from white-theme.css */
@media (min-width: 768px) {
    .quick-filters .btn-xs {
        font-size: 0.8rem !important;
        padding: 0.375rem 0.75rem !important;
    }
    
    /* Desktop game image positioning for rule cards - bottom center */
    .rule-card .game-image-desktop {
        display: block !important;
        width: 80px !important;
        height: 80px !important;
        max-width: 80px !important;
        max-height: 80px !important;
        margin: 1rem auto 0.5rem auto !important;
        border-radius: 8px !important;
        object-fit: cover !important;
        box-shadow: 0 2px 4px rgba(0,0,0,0.1) !important;
    }
}

/* Mobile override - match main.css exactly */
@media (max-width: 767.98px) {
    .quick-filters .btn-xs {
        font-size: 0.8rem;
        padding: 0.1rem 0.2rem;
        margin-right: 0.125rem;
        margin-bottom: 0.125rem;
        min-width: 4rem;
        text-align: center;
    }
    
    /* Mobile game image positioning for rule cards - bottom center */
    .rule-card .game-image-mobile {
        display: block !important;
        width: 60px !important;
        height: 60px !important;
        max-width: 60px !important;
        max-height: 60px !important;
        margin: 0.75rem auto 0.5rem auto !important;
        border-radius: 6px !important;
        object-fit: cover !important;
        box-shadow: 0 2px 4px rgba(0,0,0,0.1) !important;
    }
}

/* Filter Groups Styling - Match Game Finder */
.quick-filters {
    background-color: #f8f9fa;
    border: 2px solid rgba(128, 128, 128, 0.3);
    border-radius: 0.75rem;
    padding: 1rem 1rem 0.5rem 1rem;
    margin-bottom: 0.5rem;
    position: relative;
    animation: pulseAttention 0.6s ease-in-out 0.2s 1;
}

.filter-group-title {
    margin-bottom: 0.25rem;
    font-weight: 500;
}

/* Pulse animation */
@keyframes pulseAttention {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.02);
    }
}

/* Two-column layout handled by JavaScript and Bootstrap grid */

/* Centered, half-width difficulty bar */
.rule-card .attribute-bar {
    width: 50% !important;
    margin: 0 auto !important;
}

/* Rule card styling - match game cards exactly */
.rule-card {
    background-color: rgba(238, 200, 129, 0.05);
    color: black;
    border: 1px solid #00AEEF !important;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

/* Base hover effects */
.rule-card:hover {
    transform: scale(1.02);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

/* Desktop Safari: disable hover transform for active rules to prevent clipping */
@media (min-width: 768px) {
    @supports (-webkit-appearance: none) {
        .rule-card.active-rule:hover {
            transform: none !important; /* No transform for active rules in desktop Safari */
            box-shadow: 0 6px 16px rgba(0, 174, 239, 0.4) !important; /* Enhanced shadow instead */
        }
    }
}

.rule-card .card-body {
    background-color: rgba(238, 200, 129, 0.05);
    color: black;
}

.hero-section {
    padding: 2rem 0;
}