/**
 * FAQ Styles
 *
 * Stili per componenti FAQ
 *
 * @package Lilitech_FAQ_Manager
 * @since 1.0.0
 */

/* ========================================
   SEARCH BAR
   ======================================== */

.lilitech-faq-search-wrapper {
    position: relative;
    width: 100%;
}

.lilitech-faq-search-bar {
    position: relative;
    width: 100%;
}

.lilitech-faq-search-input {
    width: 100%;
    padding: 15px 50px 15px 20px;
    font-size: 16px;
    line-height: 1.5;
    border: 1px solid #ddd;
    border-radius: 8px;
    background-color: #fff;
    transition: all 0.3s ease;
    outline: none;
}

.lilitech-faq-search-input:focus {
    border-color: #2271b1;
    box-shadow: 0 0 0 1px #2271b1;
}

.lilitech-faq-search-input::placeholder {
    color: #999;
}

.lilitech-faq-search-icon,
.lilitech-faq-search-loader {
    position: absolute;
    right: 20px;
    top: 50%;
    transform: translateY(-50%);
    color: #666;
    pointer-events: none;
}

.lilitech-faq-search-loader {
    color: #2271b1;
}

/* ========================================
   SEARCH RESULTS
   ======================================== */

.lilitech-faq-results {
    position: absolute;
    top: calc(100% + 10px);
    left: 0;
    right: 0;
    z-index: 1000;
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    max-height: 500px;
    overflow-y: auto;
}

.lilitech-faq-results-header {
    padding: 12px 20px;
    border-bottom: 1px solid #eee;
    background: #f9f9f9;
    font-size: 14px;
    color: #666;
}

.lilitech-faq-results-list {
    padding: 0;
}

.lilitech-faq-result-item {
    padding: 20px;
    border-bottom: 1px solid #eee;
    cursor: pointer;
    transition: background 0.2s ease;
}

.lilitech-faq-result-item:last-child {
    border-bottom: none;
}

.lilitech-faq-result-item:hover {
    background: #f9f9f9;
}

.result-category {
    display: inline-block;
    padding: 4px 10px;
    margin-bottom: 8px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    color: #2271b1;
    background: #e5f2ff;
    border-radius: 4px;
}

.result-question {
    margin: 0 0 10px;
    font-size: 18px;
    font-weight: 600;
    color: #333;
    line-height: 1.4;
}

.result-question mark {
    background: #fff59d;
    padding: 2px 4px;
    border-radius: 3px;
}

.result-excerpt {
    margin: 0 0 10px;
    font-size: 14px;
    line-height: 1.6;
    color: #666;
    display: none; /* Nascosto di default, mostrato su expand */
}

.lilitech-faq-result-item.expanded .result-excerpt {
    display: block;
}

.result-excerpt mark {
    background: #fff59d;
    padding: 2px 4px;
    border-radius: 3px;
}

.result-link {
    display: inline-block;
    font-size: 14px;
    color: #2271b1;
    text-decoration: none;
    font-weight: 600;
    transition: color 0.2s ease;
}

.result-link:hover {
    color: #135e96;
    text-decoration: underline;
}

.lilitech-faq-no-results,
.lilitech-faq-error {
    padding: 40px 20px;
    text-align: center;
}

.lilitech-faq-no-results p,
.lilitech-faq-error p {
    margin: 0;
    color: #666;
    font-size: 16px;
}

.lilitech-faq-error p {
    color: #d63638;
}

/* ========================================
   FAQ LIST / ACCORDION
   ======================================== */

.lilitech-faq-list {
    width: 100%;
}

.lilitech-faq-item {
    margin-bottom: 10px;
    border: 1px solid #ddd;
    border-radius: 8px;
    overflow: hidden;
    transition: all 0.3s ease;
}

.lilitech-faq-item:hover {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.lilitech-faq-question {
    position: relative;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 15px 20px;
    background: #f5f5f5;
    cursor: pointer;
    transition: all 0.3s ease;
    user-select: none;
}

.lilitech-faq-question:hover {
    background: #ebebeb;
}

.lilitech-faq-question.active {
    background: #2271b1;
    color: #fff;
}

.lilitech-faq-category {
    display: inline-block;
    padding: 4px 10px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    color: #2271b1;
    background: #e5f2ff;
    border-radius: 4px;
    flex-shrink: 0;
}

.lilitech-faq-question.active .lilitech-faq-category {
    background: rgba(255, 255, 255, 0.2);
    color: #fff;
}

.lilitech-faq-question-text {
    flex: 1;
    font-size: 18px;
    font-weight: 600;
    line-height: 1.4;
}

.lilitech-faq-icon {
    flex-shrink: 0;
    margin-left: auto;
    transition: transform 0.3s ease;
}

.lilitech-faq-question.active .lilitech-faq-icon {
    transform: rotate(180deg);
}

.lilitech-faq-answer {
    padding: 20px;
    background: #fff;
    border-top: 1px solid #eee;
}

.lilitech-faq-answer p {
    margin: 0 0 15px;
    line-height: 1.7;
    color: #666;
}

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

.lilitech-faq-answer ul,
.lilitech-faq-answer ol {
    margin: 0 0 15px;
    padding-left: 25px;
    color: #666;
}

.lilitech-faq-answer li {
    margin-bottom: 8px;
    line-height: 1.7;
}

.lilitech-faq-answer a {
    color: #2271b1;
    text-decoration: underline;
}

.lilitech-faq-answer a:hover {
    color: #135e96;
}

/* ========================================
   RESPONSIVE
   ======================================== */

@media (max-width: 768px) {
    .lilitech-faq-search-input {
        padding: 12px 45px 12px 15px;
        font-size: 14px;
    }
    
    .lilitech-faq-search-icon,
    .lilitech-faq-search-loader {
        right: 15px;
    }
    
    .lilitech-faq-results {
        max-height: 400px;
    }
    
    .lilitech-faq-result-item {
        padding: 15px;
    }
    
    .result-question {
        font-size: 16px;
    }
    
    .lilitech-faq-question {
        padding: 12px 15px;
        flex-wrap: wrap;
    }
    
    .lilitech-faq-question-text {
        font-size: 16px;
    }
    
    .lilitech-faq-category {
        order: -1;
        width: 100%;
        margin-bottom: 8px;
    }
    
    .lilitech-faq-answer {
        padding: 15px;
    }
}

/* ========================================
   ACCESSIBILITY
   ======================================== */

.lilitech-faq-question:focus,
.lilitech-faq-question:focus-visible {
    outline: 2px solid #2271b1;
    outline-offset: 2px;
}

/* Screen reader only */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border-width: 0;
}

/* ========================================
   ANIMATIONS
   ======================================== */

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

.lilitech-faq-results {
    animation: fadeIn 0.3s ease;
}

/* ========================================
   PRINT STYLES
   ======================================== */

@media print {
    .lilitech-faq-search-wrapper {
        display: none;
    }
    
    .lilitech-faq-answer {
        display: block !important;
    }
    
    .lilitech-faq-question {
        background: #fff;
        cursor: default;
    }
    
    .lilitech-faq-icon {
        display: none;
    }
}


/* Desktop: nascondi la tendina mobile */
@media (min-width: 769px) {
  .faq-tax-filter-select {
    display: none;
  }
}

/* Mobile: mostra la tendina e nascondi il filtro originale */
@media (max-width: 768px) {
  .faq-tax-filter .e-filter {
    display: none !important;
  }

  .faq-tax-filter-select {
    display: block;
    width: 100%;
    padding: 10px;
    font-size: 16px;
    background: #fff;
    border: 1px solid #ccc;
    border-radius: 6px;
  }
}

