/**
 * Product FAQs Styles
 * 
 * Styling voor veelgestelde vragen op productpagina's
 * Consistent met KTI thema kleuren en typografie
 * 
 * @package KTI
 * @version 1.0.0
 */

/* Main container */
.product-faqs-container {
    max-width: 1200px;
    width: 100%;
    margin: 0 auto;
    padding: 0 40px;
    font-family: 'DM Sans', sans-serif;
}

/* Header styles removed - user will add their own titles */

/* FAQ List */
.product-faqs-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

/* Individual FAQ Item */
.product-faq-item {
    background: #ffffff;
    border: 2px solid #f1f1f1;
    border-radius: 16px;
    overflow: hidden;
    transition: all 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
    margin-bottom: 16px;
}

.product-faq-item:hover {
    border-color: #e5e5e5;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
    transform: translateY(-1px);
}

.product-faq-item.active {
    border-color: #FAB400;
    border-width: 2px;
    box-shadow: 0 4px 16px rgba(250, 180, 0, 0.15);
}

/* FAQ Question (clickable header) */
.product-faq-question {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 32px 40px;
    cursor: pointer;
    transition: all 0.3s ease;
    background: #ffffff;
    user-select: none;
    min-height: 80px;
}

.product-faq-question:hover {
    background: #fafafa;
}

.product-faq-question:hover .product-faq-toggle-icon {
    color: #ED6B06;
    transform: scale(1.1);
}

.product-faq-item.active .product-faq-question:hover {
    background: #fff8f0;
}

.product-faq-item.active .product-faq-question:hover .product-faq-toggle-icon {
    color: #FAB400;
}

.product-faq-question:focus {
    outline: 2px solid #FAB400;
    outline-offset: -2px;
}

.product-faq-question-text {
    font-family: 'DM Sans', sans-serif !important;
    font-size: 22px !important;
    font-weight: 500 !important;
    font-style: normal !important;
    line-height: 140% !important;
    letter-spacing: 0% !important;
    margin: 0 !important;
    padding: 0 !important;
    color: #3A4653 !important;
    flex: 1;
    padding-right: 24px;
}

/* Toggle Icon */
.product-faq-toggle-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    color: #FAB400;
    transition: all 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    flex-shrink: 0;
    position: relative;
}

.product-faq-toggle-icon svg {
    transition: all 0.3s ease;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

/* Default state: show down arrow, hide up arrow */
.product-faq-toggle-icon .faq-icon-down {
    opacity: 1;
    transform: translate(-50%, -50%) rotate(0deg);
}

.product-faq-toggle-icon .faq-icon-up {
    opacity: 0;
    transform: translate(-50%, -50%) rotate(180deg);
}

/* Active state: hide down arrow, show up arrow */
.product-faq-item.active .product-faq-toggle-icon .faq-icon-down {
    opacity: 0;
    transform: translate(-50%, -50%) rotate(180deg);
}

.product-faq-item.active .product-faq-toggle-icon .faq-icon-up {
    opacity: 1;
    transform: translate(-50%, -50%) rotate(0deg);
}

.product-faq-item.active .product-faq-toggle-icon {
    color: #ED6B06;
}

/* FAQ Answer (collapsible content) */
.product-faq-answer {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.4s ease-in-out, opacity 0.3s ease-in-out;
    background: #ffffff;
    opacity: 0;
    border-top: 1px solid #f1f1f1;
}

/* Active state - both ways to trigger it */
.product-faq-answer.active,
.product-faq-item.active .product-faq-answer {
    max-height: 500px !important; /* Large enough value for most content */
    opacity: 1 !important;
}

/* When active, show border between question and answer */
.product-faq-item.active .product-faq-answer {
    border-top: 1px solid #FAB400;
}

.product-faq-answer-content {
    padding: 24px 40px 40px 40px;
    font-family: 'Inter', sans-serif !important;
    font-size: 17px !important;
    font-weight: 400 !important;
    font-style: normal !important;
    line-height: 150% !important;
    letter-spacing: 0% !important;
    color: #4B5563 !important;
}

/* Style content within answers */
.product-faq-answer-content p {
    margin: 0 0 16px 0;
    color: #4B5563 !important;
}

.product-faq-answer-content p:last-child {
    margin-bottom: 0;
}

.product-faq-answer-content ul,
.product-faq-answer-content ol {
    margin: 16px 0;
    padding-left: 24px;
    color: #4B5563 !important;
}

.product-faq-answer-content li {
    margin-bottom: 8px;
    color: #4B5563 !important;
}

.product-faq-answer-content strong {
    color: #3A4653;
    font-weight: 600;
}

.product-faq-answer-content a {
    color: #FAB400;
    text-decoration: none;
    transition: color 0.3s ease;
}

.product-faq-answer-content a:hover {
    color: #ED6B06;
    text-decoration: underline;
}

/* Empty/Error states */
.product-faqs-empty,
.product-faqs-error {
    text-align: center;
    padding: 40px 20px;
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 12px;
    margin: 20px 0;
}

.product-faqs-empty {
    color: #6B7280;
    font-style: italic;
    font-family: 'Inter', sans-serif;
    font-size: 16px;
    line-height: 150%;
}

.product-faqs-error {
    color: #dc3545;
    font-family: 'Inter', sans-serif;
    font-size: 16px;
    line-height: 150%;
    background: rgba(220, 53, 69, 0.1);
    border-color: rgba(220, 53, 69, 0.2);
}

/* Loading states */
.product-faqs-loading {
    opacity: 0.7;
    pointer-events: none;
}

.product-faqs-loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 24px;
    height: 24px;
    margin: -12px 0 0 -12px;
    border: 3px solid #f3f3f3;
    border-top: 3px solid #FAB400;
    border-radius: 50%;
    animation: product-faqs-spin 1s linear infinite;
}

@keyframes product-faqs-spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Accessibility improvements */
.product-faq-question[aria-expanded="true"] {
    background: #fafafa;
}

.product-faq-question:focus-visible {
    outline: 2px solid #FAB400;
    outline-offset: 2px;
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
    .product-faq-item,
    .product-faq-question,
    .product-faq-answer,
    .product-faq-toggle-icon,
    .product-faq-toggle-icon svg {
        transition: none;
    }
    
    .product-faqs-loading::after {
        animation: none;
    }
}

/* Responsive Design */
@media (max-width: 768px) {
    .product-faqs-container {
        padding: 0 20px;
    }
    
    .product-faqs-list {
        gap: 12px;
    }
    
    .product-faq-question {
        padding: 24px 20px;
        min-height: 70px;
    }
    
    .product-faq-question-text {
        font-size: 18px !important;
        line-height: 145% !important;
        padding-right: 16px;
    }
    
    .product-faq-toggle-icon {
        width: 36px;
        height: 36px;
    }
    
    .product-faq-toggle-icon svg {
        width: 22px;
        height: 22px;
    }
    
    .product-faq-answer-content {
        padding: 20px 20px 32px 20px;
        font-size: 16px !important;
        line-height: 155% !important;
    }
}

@media (max-width: 480px) {
    .product-faqs-container {
        padding: 0 16px;
    }
    
    .product-faq-question {
        padding: 20px 16px;
        min-height: 60px;
    }
    
    .product-faq-question-text {
        font-size: 16px !important;
        padding-right: 12px;
    }
    
    .product-faq-toggle-icon {
        width: 32px;
        height: 32px;
    }
    
    .product-faq-toggle-icon svg {
        width: 20px;
        height: 20px;
    }
    
    .product-faq-answer-content {
        padding: 16px 16px 24px 16px;
        font-size: 15px !important;
    }
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .product-faq-item {
        border-width: 2px;
    }
    
    .product-faq-item.active {
        border-width: 3px;
    }
    
    .product-faq-question:focus {
        outline-width: 3px;
    }
}

/* Print styles */
@media print {
    .product-faqs-container {
        margin: 0;
        padding: 0;
        max-width: none;
    }
    
    .product-faq-item {
        break-inside: avoid;
        border: 1px solid #ddd;
        box-shadow: none;
        margin-bottom: 16px;
    }
    
    .product-faq-answer {
        max-height: none !important;
        opacity: 1 !important;
    }
    
    .product-faq-toggle-icon {
        display: none;
    }
    
    .product-faq-question {
        padding-right: 28px;
    }
}
