/**
 * Course Category Filter Styles
 * File: css/course-filter.css
 */

/* ---------------------------------------------------------------------------
 * Category Filter Container
 * --------------------------------------------------------------------------- */

.course-category-filter {
    margin: 30px 0;
    padding: 0 20px;
    width: 100%;
    box-sizing: border-box;
}

.course-category-filter .category-buttons {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 15px;
    align-items: center;
    margin: 0;
    padding: 0;
}

/* ---------------------------------------------------------------------------
 * Category Buttons - Updated Styling
 * --------------------------------------------------------------------------- */

.course-category-filter .category-buttons .category-btn {
    background: #6C818F !important;
    color: white !important;
    border: 2px solid #6C818F !important;
    padding: 8px 24px !important;
    border-radius: 0 !important;
    cursor: pointer !important;
    font-family: 'proxima-nova', sans-serif !important;
    font-weight: 400 !important;
    font-size: 14px !important;
    text-transform: uppercase !important;
    letter-spacing: 0.5px !important;
    transition: all 0.3s ease !important;
    position: relative !important;
    display: inline-flex !important;
    align-items: center !important;
    gap: 8px !important;
    white-space: nowrap !important; /* Keep for desktop */
    text-decoration: none !important;
    box-shadow: none !important;
    outline: none !important;
    line-height: 1.2 !important;
}

/* Desktop-specific styling */
@media (min-width: 769px) {
    .course-category-filter .category-buttons .category-btn {
        white-space: nowrap !important; /* Prevent wrapping on desktop */
    }
}

/* Mobile text wrapping */
@media (max-width: 768px) {
    .course-category-filter .category-buttons .category-btn {
        white-space: normal !important; /* Allow wrapping on mobile */
        text-align: center !important;
        justify-content: center !important;
    }
}

.course-category-filter .category-buttons .category-btn:hover {
    background: white !important;
    color: #6C818F !important;
    border: 2px solid #6C818F !important;
    box-shadow: none !important;
    transform: none !important;
}

.course-category-filter .category-buttons .category-btn.active {
    background: #041E42 !important;
    color: white !important;
    border: 2px solid #041E42 !important;
    box-shadow: none !important;
}

.course-category-filter .category-buttons .category-btn.active:hover {
    background: white !important;
    color: #6C818F !important;
    border: 2px solid #6C818F !important;
}

/* ---------------------------------------------------------------------------
 * Category Count Badge
 * --------------------------------------------------------------------------- */

.course-category-filter .category-buttons .category-btn .category-count {
    background: rgba(255, 255, 255, 0.2) !important;
    color: inherit !important;
    padding: 2px 8px !important;
    border-radius: 12px !important;
    font-size: 12px !important;
    font-weight: 700 !important;
    min-width: 20px !important;
    text-align: center !important;
    transition: all 0.3s ease !important;
    display: inline-block !important;
    line-height: 1.2 !important;
}

.course-category-filter .category-buttons .category-btn:not(.active) .category-count {
    background: rgba(255, 255, 255, 0.3) !important;
    color: white !important;
}

.course-category-filter .category-buttons .category-btn:not(.active):hover .category-count {
    background: #6C818F !important;
    color: white !important;
}

.course-category-filter .category-buttons .category-btn.active .category-count {
    background: rgba(255, 255, 255, 0.3) !important;
    color: white !important;
}

.course-category-filter .category-buttons .category-btn.active:hover .category-count {
    background: #6C818F !important;
    color: white !important;
}

/* ---------------------------------------------------------------------------
 * Filter Animation States  
 * --------------------------------------------------------------------------- */

.elementor-loop-container .filterable-product {
    transition: opacity 0.3s ease, transform 0.3s ease !important;
}

.elementor-loop-container .filterable-product.hiding {
    opacity: 0 !important;
    transform: scale(0.95) !important;
    pointer-events: none !important;
}

.elementor-loop-container .filterable-product.showing {
    opacity: 1 !important;
    transform: scale(1) !important;
}

/* ---------------------------------------------------------------------------
 * No Results Message
 * --------------------------------------------------------------------------- */

.course-category-filter ~ .elementor-loop-container .no-results-message,
.elementor-loop-container .no-results-message {
    width: 100% !important;
    padding: 60px 20px !important;
    text-align: center !important;
    grid-column: 1 / -1 !important; /* Span full width in grid layouts */
    clear: both !important;
    background: white !important;
    border-radius: 8px !important;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1) !important;
    margin: 20px 0 !important;
}

.no-results-content {
    max-width: 400px !important;
    margin: 0 auto !important;
}

.no-results-content h3 {
    color: #041E42 !important;
    font-size: 24px !important;
    margin-bottom: 15px !important;
    font-family: 'proxima-nova', sans-serif !important;
    font-weight: 400 !important;
}

.no-results-content p {
    color: #666 !important;
    font-size: 16px !important;
    margin-bottom: 25px !important;
    line-height: 1.5 !important;
}

.no-results-content .category-btn {
    background: #D69A2D !important;
    color: white !important;
    border: 2px solid #D69A2D !important;
    padding: 9px 24px !important;
    border-radius: 0 !important;
    cursor: pointer !important;
    font-family: 'proxima-nova', sans-serif !important;
    font-weight: 600 !important;
    font-size: 14px !important;
    text-transform: uppercase !important;
    text-decoration: none !important;
    display: inline-block !important;
    transition: all 0.3s ease !important;
    box-shadow: none !important;
}

.no-results-content .category-btn:hover {
    background: #B8851F !important;
    border-color: #B8851F !important;
}

/* ---------------------------------------------------------------------------
 * Responsive Design with Higher Specificity
 * --------------------------------------------------------------------------- */

@media (max-width: 768px) {
    .course-category-filter {
        margin: 20px 0 !important;
        padding: 0 10px !important;
    }
    
    .course-category-filter .category-buttons {
        gap: 10px !important;
        justify-content: center !important;
    }
    
    .course-category-filter .category-buttons .category-btn {
        padding: 9px 16px !important;
        font-size: 12px !important;
        min-height: 40px !important;
        white-space: normal !important; /* Allow text wrapping */
        line-height: 1.2 !important;
        text-align: center !important;
    }
    
    .course-category-filter .category-buttons .category-btn .category-count {
        font-size: 10px !important;
        padding: 2px 6px !important;
        min-width: 16px !important;
        margin-top: 2px !important; /* Add space when text wraps */
    }
}

@media (max-width: 480px) {
    .course-category-filter .category-buttons {
        gap: 8px !important;
        /* Consider full-width layout for very small screens */
        flex-direction: column !important;
        align-items: stretch !important;
    }
    
    .course-category-filter .category-buttons .category-btn {
        padding: 9px 12px !important;
        font-size: 11px !important;
        min-height: 48px !important; /* Increase height for wrapped text */
        flex: none !important; /* Remove flex for full-width */
        max-width: none !important; /* Allow full width */
        white-space: normal !important; /* Ensure text wrapping */
        display: flex !important;
        flex-direction: column !important; /* Stack text and count vertically */
        align-items: center !important;
        justify-content: center !important;
        width: 100% !important; /* Full width on small screens */
    }
    
    .course-category-filter .category-buttons .category-btn .category-count {
        font-size: 9px !important;
        padding: 2px 6px !important;
        margin-top: 3px !important; /* Space between text and count */
    }
}

/* Medium mobile screens - keep 2-column layout */
@media (min-width: 481px) and (max-width: 640px) {
    .course-category-filter .category-buttons {
        display: grid !important;
        grid-template-columns: 1fr 1fr !important; /* 2 columns */
        gap: 10px !important;
        justify-items: stretch !important;
    }
    
    .course-category-filter .category-buttons .category-btn {
        width: 100% !important;
        max-width: none !important;
        min-height: 50px !important;
    }
}

/* Extra small screens - stack buttons more efficiently */
@media (max-width: 360px) {
    .course-category-filter .category-buttons .category-btn {
        font-size: 10px !important;
        padding: 9px 10px !important;
        min-height: 52px !important; /* Even more height for smaller text */
        letter-spacing: 0.3px !important; /* Reduce letter spacing */
    }
    
    .course-category-filter .category-buttons .category-btn .category-count {
        font-size: 8px !important;
        padding: 1px 4px !important;
    }
}

/* ---------------------------------------------------------------------------
 * Override any conflicting button styles
 * --------------------------------------------------------------------------- */

.course-category-filter button.category-btn,
.course-category-filter input[type="button"].category-btn,
.course-category-filter input[type="submit"].category-btn {
    -webkit-appearance: none !important;
    -moz-appearance: none !important;
    appearance: none !important;
    background-image: none !important;
    text-shadow: none !important;
    box-sizing: border-box !important;
}

/* Force override any theme button styles */
.course-category-filter .category-btn:not(.active):not(:hover),
.course-category-filter .category-btn:not(.active):not(:hover):focus {
    background: #6C818F !important;
    color: white !important;
    border: 2px solid #6C818F !important;
}

/* Accessibility */
.course-category-filter .category-buttons .category-btn:focus {
    outline: 2px solid #D69A2D !important;
    outline-offset: 2px !important;
    z-index: 10 !important;
}

.course-category-filter .category-buttons .category-btn:focus:not(:focus-visible) {
    outline: none !important;
}