/* ===== FAQS SECTION STYLES ===== */
.faqs-section {
    min-height: 100vh;
}

/* ===== HERO SECTION ===== */
.faqs-hero {
    background: linear-gradient(rgba(0, 0, 0, 0.8), rgba(0, 0, 0, 0.9)), 
                url('/images/Banner_Home_Fitaflex_ESP.png') center center/cover no-repeat;
    padding: 30px 0 20px;
    margin-top: 20px;
}

.faqs-hero .section-title h1 {
    font-size: 2.2rem;
    font-weight: 700;
    margin-bottom: 10px;
}

.faqs-hero .section-title h2 {
    font-weight: 500;
    letter-spacing: 1px;
}

/* ===== SIDEBAR STYLES ===== */
.sidebar-sticky {
    position: sticky;
    top: 100px;
}

.sidebar-sticky .card {
    border-radius: 12px;
    overflow: hidden;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    border: none;
    box-shadow: 0 5px 20px rgba(0,0,0,0.1);
}

.sidebar-sticky .card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.15);
}

.stat-item {
    padding: 0.5rem 0;
}

.stat-color-indicator {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    flex-shrink: 0;
}

.total-stats {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-radius: 8px;
    padding: 1rem;
}

/* ===== SEARCH CONTAINER ===== */
.search-container {
    position: relative;
    margin-bottom: 2rem;
}

.search-icon {
    left: 20px;
    top: 50%;
    transform: translateY(-50%);
    color: #6c757d;
    z-index: 10;
}

.search-container .form-control {
    border-radius: 50px;
    border: 2px solid #e9ecef;
    padding-left: 50px;
    padding-right: 20px;
    font-size: 1.1rem;
    transition: all 0.3s ease;
}

.search-container .form-control:focus {
    border-color: #dc2626;
    box-shadow: 0 0 0 0.2rem rgba(220, 38, 38, 0.1);
}

/* ===== CATEGORY SECTIONS ===== */
.category-section {
    background: white;
    border-radius: 15px;
    padding: 2rem;
    box-shadow: 0 5px 25px rgba(0, 0, 0, 0.08);
    border: 1px solid #f8f9fa;
    margin-bottom: 2.5rem;
    position: relative;
}

.category-header {
    border-bottom: 2px solid #f8f9fa;
    padding-bottom: 1rem;
    margin-bottom: 1.5rem;
}

.category-badge .badge {
    font-size: 0.9rem;
    padding: 0.5rem 1rem;
}

.category-icon {
    width: 70px;
    height: 70px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

/* ===== FAQ LIST & ITEMS ===== */
.faq-list {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.faq-item {
    border-radius: 12px;
    transition: all 0.3s ease;
    background: white;
    border: 1px solid #e9ecef;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0,0,0,0.04);
}

.faq-item:hover {
    box-shadow: 0 4px 15px rgba(0,0,0,0.08);
    transform: translateY(-1px);
}

/* FAQ Question Toggle */
.faq-toggle {
    background: #f8f9fa;
    border: none;
    border-radius: 12px;
    padding: 1.75rem;
    transition: all 0.3s ease;
    display: block;
    width: 100%;
    text-align: left;
    color: #333;
    text-decoration: none;
    position: relative;
    margin: 0;
    cursor: pointer;
}

.faq-toggle:hover {
    background: #e9ecef;
    text-decoration: none;
    color: #333;
}

.faq-toggle[aria-expanded="true"] {
    background: #dc2626;
    color: white;
    border-radius: 12px 12px 0 0;
}

#waterproofing-faqs .faq-toggle[aria-expanded="true"] {
    background: #2563eb;
}

.faq-question {
    line-height: 1.4;
    padding-right: 1rem;
    flex: 1;
    margin: 0;
}

/* FAQ Answer Content */
.collapse:not(.show) {
    display: none;
}

.collapse.show {
    display: block;
    animation: fadeInUp 0.3s ease;
}

.faq-answer-content {
    background: white;
    border-top: none;
    border-radius: 0 0 12px 12px;
    padding: 2rem;
    animation: fadeInUp 0.3s ease;
}

@keyframes fadeInUp {
    from { 
        opacity: 0;
        transform: translateY(-10px);
    }
    to { 
        opacity: 1;
        transform: translateY(0);
    }
}

.faq-image {
    border-radius: 8px;
    overflow: hidden;
    margin-bottom: 1.5rem;
}

.faq-image img {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
    display: block;
}

.faq-answer {
    line-height: 1.7;
    color: #555;
    font-size: 1.05rem;
}

/* ===== QUICK VIEW STYLES ===== */
.quick-view-btn {
    padding: 0.5rem 0.75rem;
    border-radius: 6px;
    transition: all 0.2s ease;
    opacity: 0.8;
    border: 1px solid #dc2626;
    background: white;
    color: #dc2626;
    flex-shrink: 0;
    cursor: pointer;
}

.quick-view-btn:hover {
    opacity: 1;
    transform: scale(1.05);
    background: #dc2626;
    color: white;
}

#waterproofing-faqs .quick-view-btn {
    border-color: #2563eb;
    color: #2563eb;
}

#waterproofing-faqs .quick-view-btn:hover {
    background: #2563eb;
    color: white;
}

/* Ensure proper spacing in FAQ items */
.faq-toggle .d-flex {
    align-items: center;
    width: 100%;
}

.faq-toggle .gap-2 {
    flex-shrink: 0;
}

/* ===== NO RESULTS & EMPTY STATES ===== */
#noResults {
    display: none;
}

#noResults i {
    opacity: 0.5;
}

.text-center.py-5 {
    padding: 3rem 0;
}

/* ===== HIGHLIGHT ANIMATION ===== */
@keyframes highlightFade {
    0% { 
        background-color: rgba(220, 38, 38, 0.1);
        box-shadow: 0 0 0 2px rgba(220, 38, 38, 0.3);
    }
    100% { 
        background-color: transparent;
        box-shadow: none;
    }
}

@keyframes highlightFadeBlue {
    0% { 
        background-color: rgba(37, 99, 235, 0.1);
        box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.3);
    }
    100% { 
        background-color: transparent;
        box-shadow: none;
    }
}

.faq-item.highlighted {
    animation: highlightFade 3s ease;
}

#waterproofing-faqs .faq-item.highlighted {
    animation: highlightFadeBlue 3s ease;
}

/* ===== MODAL STYLES ===== */
#quickViewModal .modal-content {
    border: none;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.2);
}

#quickViewModal .modal-header {
    border-radius: 12px 12px 0 0;
    border-bottom: 2px solid rgba(255,255,255,0.2);
}

#quickViewModal .modal-body {
    padding: 2rem;
    max-height: 70vh;
    overflow-y: auto;
}

.quick-view-content {
    line-height: 1.6;
}

.quick-view-answer {
    font-size: 1.05rem;
    color: #444;
    white-space: pre-line;
    line-height: 1.7;
}

/* Animation for modal */
.modal.fade .modal-dialog {
    transform: scale(0.9);
    transition: transform 0.2s ease-out;
}

.modal.show .modal-dialog {
    transform: scale(1);
}

/* ===== RESPONSIVE DESIGN ===== */
@media (max-width: 991.98px) {
    .sidebar-sticky {
        position: relative;
        top: 0;
        margin-bottom: 2rem;
    }
    
    .category-section {
        padding: 1.5rem;
    }
    
    .faq-toggle {
        padding: 1.5rem;
    }
    
    .faq-answer-content {
        padding: 1.5rem;
    }
}

@media (max-width: 768px) {
    .category-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }
    
    .category-badge {
        align-self: flex-start;
    }
    
    .faq-toggle {
        padding: 1.25rem;
    }
    
    .faq-answer-content {
        padding: 1.25rem;
    }
    
    .faq-question {
        font-size: 1.1rem;
    }
    
    .faq-toggle .d-flex {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }
    
    .faq-toggle .gap-2 {
        align-self: flex-end;
    }
}

@media (max-width: 575.98px) {
    .category-section {
        padding: 1rem;
    }
    
    .faq-toggle {
        padding: 1rem;
    }
    
    .faq-answer-content {
        padding: 1rem;
    }
    
    .faq-question {
        font-size: 1rem;
        padding-right: 0;
    }
    
    .quick-view-btn {
        padding: 0.4rem 0.6rem;
    }
    
    .faq-toggle .d-flex {
        flex-direction: column;
        gap: 0.75rem;
    }
    
    .faq-toggle .gap-2 {
        width: 100%;
        justify-content: space-between;
    }
}

/* ===== ACCESSIBILITY ===== */
.faq-toggle:focus {
    outline: 2px solid #dc2626;
    outline-offset: 2px;
}

#waterproofing-faqs .faq-toggle:focus {
    outline-color: #2563eb;
}

.quick-view-btn:focus {
    outline: 2px solid #b91c1c;
    outline-offset: 1px;
}

#waterproofing-faqs .quick-view-btn:focus {
    outline-color: #1d4ed8;
}

/* === FIX OVERLAP BETWEEN SIDEBAR AND MAIN CONTENT === */
.faqs-section .row {
    display: flex;
    flex-wrap: wrap;
}

.faqs-section .col-lg-3 {
    position: relative;
    z-index: 10; /* ensures sidebar stays above background */
}

.faqs-section .col-lg-9 {
    position: relative;
    z-index: 1;
}

@media (max-width: 991.98px) {
    .faqs-section .row {
        flex-direction: column;
    }
}

/* Prevent overlapping from sticky sidebar on smaller screens */
@media (max-width: 991.98px) {
    .sidebar-sticky {
        position: static !important;
        top: auto !important;
    }
}
