/* FAQ Accordion Styles */
.faq-container {
    max-width: 800px;
    margin: 0 auto;
    padding: 0 20px;
    font-family: 'Inter', sans-serif;
}

/* FAQ Controls Container */
.faq-controls-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    gap: 15px;
}

/* Search Input */
.faq-search-container {
    position: relative;
    flex: 1;
    max-width: 300px;
}

.faq-search-input {
    width: 100%;
    padding: 10px 40px 10px 15px;
    border: 2px solid #e5e7eb;
    border-radius: 6px;
    font-size: 14px;
    font-family: 'Inter', sans-serif;
    transition: all 0.3s ease;
    background: white;
    height: 44px;
    box-sizing: border-box;
}

.faq-search-input:focus {
    outline: none;
    border-color: #ff8800;
    box-shadow: 0 0 0 3px rgba(255, 136, 0, 0.1);
}

.faq-search-icon {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: #6b7280;
    font-size: 16px;
    pointer-events: none;
}

/* Legacy support for toggle all container */
.faq-toggle-all-container {
    text-align: right;
    margin-bottom: 20px;
}

.faq-toggle-all-btn {
    background: #ff8800;
    color: white;
    border: none;
    border-radius: 6px;
    padding: 10px 20px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: 'Inter', sans-serif;
    height: 44px;
    box-sizing: border-box;
}

.faq-toggle-all-btn:hover {
    background: #e67e00;
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(255, 136, 0, 0.3);
}

.faq-toggle-all-btn:active {
    transform: translateY(0);
}

/* Grid layout for desktop */
.faq-grid-layout {
    max-width: 1200px;
    /* Ensure single column by default */
    columns: 1;
    column-gap: 0;
}

@media (min-width: 769px) {
    .faq-grid-layout {
        columns: 2;
        column-gap: 20px;
        column-fill: balance;
    }
    
    .faq-grid-layout .faq-controls-container,
    .faq-grid-layout .faq-toggle-all-container {
        column-span: all;
        margin-bottom: 20px;
    }
    
    .faq-grid-layout .faq-item {
        margin-bottom: 20px;
        break-inside: avoid;
        display: inline-block;
        width: 100%;
        height: fit-content;
    }
    
    /* Ensure proper column distribution */
    .faq-grid-layout {
        column-fill: balance;
    }
}

/* Alternative grid layout with better spacing */
@media (min-width: 1024px) {
    .faq-grid-layout {
        columns: 2;
        column-gap: 30px;
    }
    
    .faq-grid-layout .faq-controls-container,
    .faq-grid-layout .faq-toggle-all-container {
        column-span: all;
        margin-bottom: 25px;
    }
    
    .faq-grid-layout .faq-item {
        margin-bottom: 25px;
    }
}

.faq-item {
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    margin-bottom: 12px;
    background: #ffffff;
    overflow: hidden;
    transition: all 0.3s ease;
}

.faq-item:hover {
    border-color: #ff8800;
    box-shadow: 0 4px 12px rgba(255, 136, 0, 0.1);
}

.faq-question {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    cursor: pointer;
    background: #ffffff;
    transition: all 0.3s ease;
    user-select: none;
}

.faq-question:hover {
    background: #f8f9fa;
}

.faq-question:focus {
    outline: 2px solid #ff8800;
    outline-offset: -2px;
}

.faq-question-text {
    font-size: 18px;
    font-weight: 600;
    color: #374151;
    line-height: 1.5;
    flex: 1;
    margin-right: 15px;
}

.faq-toggle-icon {
    font-size: 24px;
    font-weight: bold;
    color: #ff8800;
    transition: transform 0.3s ease, color 0.3s ease;
    min-width: 24px;
    text-align: center;
}

.faq-item-expanded .faq-toggle-icon {
    transform: rotate(0deg);
    color: #e67e00;
}

.faq-answer {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.4s ease, padding 0.3s ease;
    background: #f8f9fa;
}

.faq-item-expanded .faq-answer {
    max-height: 1000px;
    padding: 0 20px 20px 20px;
}

.faq-answer-content {
    padding-top: 15px;
    color: #4b5563;
    line-height: 1.7;
    font-size: 16px;
}

.faq-answer-content p {
    margin: 0 0 15px 0;
}

.faq-answer-content p:last-child {
    margin-bottom: 0;
}

.faq-answer-content ul,
.faq-answer-content ol {
    margin: 15px 0;
    padding-left: 25px;
}

.faq-answer-content li {
    margin-bottom: 8px;
}

.faq-answer-content a {
    color: #ff8800;
    text-decoration: none;
    font-weight: 500;
}

.faq-answer-content a:hover {
    text-decoration: underline;
}

/* No Results Message */
.faq-no-results {
    text-align: center;
    padding: 60px 20px;
    color: #6b7280;
    background: #f8f9fa;
    border-radius: 8px;
    margin: 20px 0;
    border: 1px solid #e5e7eb;
}

.faq-no-results p {
    margin: 0;
    font-size: 18px;
    font-weight: 500;
}

/* Desktop styles for controls */
@media (min-width: 769px) {
    .faq-controls-container {
        gap: 20px;
    }
    
    .faq-search-container {
        max-width: 400px;
    }
    
    .faq-toggle-all-btn {
        padding: 10px 20px;
        font-size: 14px;
    }
}

/* Mobile responsive design */
@media (max-width: 768px) {
    .faq-container {
        max-width: 100%;
        margin: 0 auto;
        padding: 0 15px;
    }
    
    /* Reset grid layout to single column on mobile */
    .faq-grid-layout {
        columns: 1 !important;
        column-gap: 0;
    }
    
    .faq-grid-layout .faq-controls-container,
    .faq-grid-layout .faq-toggle-all-container {
        column-span: none;
    }
    
    .faq-grid-layout .faq-item {
        margin-bottom: 12px;
        break-inside: auto;
        display: block;
        width: 100%;
    }
    
    .faq-controls-container {
        flex-direction: row;
        gap: 10px;
    }
    
    .faq-search-container {
        flex: 1;
        max-width: none;
    }
    
    .faq-toggle-all-btn {
        flex-shrink: 0;
        padding: 0 12px;
        font-size: 12px;
        white-space: nowrap;
        height: 44px;
    }
    
    .faq-question {
        padding: 16px;
    }
    
    .faq-question-text {
        font-size: 16px;
        margin-right: 10px;
    }
    
    .faq-toggle-icon {
        font-size: 20px;
        min-width: 20px;
    }
    
    .faq-item-expanded .faq-answer {
        padding: 0 16px 16px 16px;
    }
    
    .faq-answer-content {
        padding-top: 12px;
        font-size: 15px;
    }
}

/* Animation for smooth accordion */
@media (prefers-reduced-motion: no-preference) {
    .faq-answer {
        transition: max-height 0.4s cubic-bezier(0.4, 0, 0.2, 1), 
                    padding 0.3s ease;
    }
    
    .faq-toggle-icon {
        transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1), 
                    color 0.3s ease;
    }
}

/* Accessibility improvements */
@media (prefers-reduced-motion: reduce) {
    .faq-answer,
    .faq-toggle-icon,
    .faq-item {
        transition: none;
    }
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .faq-item {
        border-width: 2px;
    }
    
    .faq-question-text {
        font-weight: 700;
    }
    
    .faq-toggle-icon {
        font-weight: 900;
    }
}

/* FAQ Categories */
.faq-categories {
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px solid #e5e7eb;
}

.faq-category-tag {
    display: inline-block;
    background: #ff8800;
    color: white;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 500;
    margin-right: 8px;
    margin-bottom: 4px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.faq-category-tag:hover {
    background: #e67e00;
}

/* Mobile responsive design for FAQ categories */
@media (max-width: 768px) {
    .faq-category-tag {
        font-size: 11px;
        padding: 3px 6px;
    }
}