/* === VARIABILI CSS === */
:root {
    /* --faq-primary-color: #0d6efd; */
    --faq-primary-color: #052c65;
    --faq-secondary-color: #6c757d;
    --faq-success-color: #198754;
    --faq-warning-color: #ffc107;
    --faq-danger-color: #dc3545;
    --faq-light-bg: #f8f9fa;
    --faq-white: #ffffff;
    --faq-border-color: #dee2e6;
    --faq-text-muted: #6c757d;
    --faq-border-radius: 0.375rem;
    --faq-transition: all 0.3s ease;
}

/* === LAYOUT GENERALE === */
.faq-categories-accordion {
    --bs-accordion-border-width: 1px;
    --bs-accordion-border-radius: var(--faq-border-radius);
}

/* === STILI CATEGORIA === */
.category-item {
    margin-bottom: 1rem;
    border: 1px solid var(--faq-border-color);
    border-radius: var(--faq-border-radius);
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
    overflow: hidden;
}

.category-header .category-button {
    background: linear-gradient(135deg, var(--faq-light-bg) 0%, var(--faq-white) 100%);
    border: none;
    padding: 1rem 1.25rem;
    font-weight: 600;
    transition: var(--faq-transition);
    position: relative;
}

.category-button:not(.collapsed) {
    background: linear-gradient(135deg, var(--faq-primary-color) 0%, #0b5ed7 100%);
    color: var(--faq-white);
    box-shadow: none;
}

.category-button:focus {
    box-shadow: 0 0 0 0.25rem rgba(13, 110, 253, 0.25);
    border-color: var(--faq-primary-color);
}

.category-icon {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    /* background: rgba(13, 110, 253, 0.1); */
    background: rgba(246, 249, 255, 0.9);
    color: var(--faq-primary-color);
    font-size: 1.1rem;
    transition: var(--faq-transition);
}

.category-button:not(.collapsed) .category-icon {
    background: rgba(255, 255, 255, 0.2);
    color: var(--faq-white);
}

.category-title {
    font-size: 1.1rem;
    font-weight: 600;
    line-height: 1.3;
}

.category-subtitle {
    font-size: 0.875rem;
    opacity: 0.8;
    margin-top: 0.25rem;
    line-height: 1.4;
}

.faq-count-badge .badge {
    background: var(--faq-primary-color);
    color: var(--faq-white);
    font-size: 0.75rem;
    padding: 0.35rem 0.65rem;
    border-radius: 1rem;
    font-weight: 600;
}

.category-button:not(.collapsed) .faq-count-badge .badge {
    background: rgba(255, 255, 255, 0.9);
    color: var(--faq-primary-color);
}

/* === STILI FAQ === */
.category-body {
    border-top: 2px solid var(--faq-primary-color);
}

.faq-accordion {
    --bs-accordion-border-width: 0;
}

.faq-item {
    border: none;
    border-bottom: 1px solid var(--faq-border-color);
}

.faq-item:last-child {
    border-bottom: none;
}

.faq-header .faq-button {
    background: var(--faq-white);
    border: none;
    padding: 1rem 1.25rem;
    font-weight: 500;
    color: #333;
    transition: var(--faq-transition);
}

.faq-button:hover {
    background: var(--faq-light-bg);
}

.faq-button:not(.collapsed) {
    background: var(--faq-light-bg);
    color: var(--faq-primary-color);
    border-bottom: 1px solid var(--faq-border-color);
}

.faq-button:focus {
    box-shadow: inset 0 0 0 2px rgba(13, 110, 253, 0.1);
}

.faq-icon {
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--faq-primary-color);
    font-size: 0.9rem;
}

.faq-question {
    font-size: 1rem;
    line-height: 1.4;
    text-align: left;
}

.badge-mobile {
    font-size: 0.7rem;
    padding: 0.2rem 0.5rem;
}

/* === CONTENUTO RISPOSTA === */
.faq-answer {
    padding: 1.25rem;
    background: var(--faq-white);
    border-top: 1px solid var(--faq-border-color);
}

.answer-content {
    line-height: 1.6;
    color: #333;
}

.answer-content p:last-child {
    margin-bottom: 0;
}

.related-links {
    border-top: 1px solid var(--faq-border-color);
}

.related-links-title {
    font-weight: 600;
    color: var(--faq-text-muted);
}

.faq-footer {
    border-top: 1px solid #f0f0f0;
}

/* === SEZIONI AGGIUNTIVE === */
.help-section {
    border: 1px solid var(--faq-border-color);
    background: linear-gradient(135deg, var(--faq-light-bg) 0%, var(--faq-white) 100%);
}

.no-faq-message,
.no-categories {
    color: var(--faq-text-muted);
}

/* === RESPONSIVE DESIGN === */

/* Mobile First (fino a 576px) */
@media (max-width: 575.98px) {
    .container {
        padding-left: 1rem;
        padding-right: 1rem;
    }
    
    .category-button {
        padding: 0.875rem 1rem !important;
    }
    
    .category-icon {
        width: 35px;
        height: 35px;
        font-size: 1rem;
    }
    
    .category-title {
        font-size: 1rem;
    }
    
    .faq-button {
        padding: 0.875rem 1rem !important;
    }
    
    .faq-question {
        font-size: 0.95rem;
    }
    
    .faq-answer {
        padding: 1rem;
    }
    
    .related-links .btn {
        font-size: 0.875rem;
        padding: 0.5rem 0.75rem;
    }
}

/* Tablet (576px - 768px) */
@media (min-width: 576px) and (max-width: 767.98px) {
    .category-subtitle {
        display: block !important;
    }
}

/* Desktop (768px+) */
@media (min-width: 768px) {
    .category-item:hover {
        box-shadow: 0 4px 12px rgba(0,0,0,0.1);
        transform: translateY(-2px);
    }
    
    .faq-item:hover {
        background: rgba(13, 110, 253, 0.02);
    }
}

/* === ANIMAZIONI === */
.accordion-collapse {
    transition: height 0.35s ease;
}

.category-item,
.faq-item {
    transition: var(--faq-transition);
}

/* Animazione fade-in per il contenuto */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.accordion-body {
    animation: fadeInUp 0.3s ease-out;
}

/* === ACCESSIBILITÀ === */
.accordion-button:focus-visible {
    outline: 2px solid var(--faq-primary-color);
    outline-offset: 2px;
}

@media (prefers-reduced-motion: reduce) {
    * {
        transition: none !important;
        animation: none !important;
    }
}

/* === STAMPA === */
@media print {
    .accordion-collapse {
        display: block !important;
        height: auto !important;
    }
    
    .accordion-button::after {
        display: none;
    }
    
    .help-section {
        display: none;
    }
}