/**
 * FAQ Elementor - Estilos do Frontend
 */

/* Container Principal */
.faq-container {
    display: flex;
    flex-direction: column;
    gap: 40px;
    min-height: 400px;
}

.faq-container.faq-two-columns {
    flex-direction: row;
    flex-wrap: wrap;
}

.faq-container.faq-two-columns .faq-header {
    flex: 0 0 40%;
    max-width: 40%;
}

.faq-container.faq-two-columns .faq-items-wrapper {
    flex: 0 0 55%;
    max-width: 55%;
    margin-left: auto;
}

.faq-container.faq-one-column .faq-header {
    text-align: center;
}

.faq-container.faq-one-column .faq-tags-filter {
    justify-content: flex-start;
}

.faq-container.faq-one-column .faq-search-wrapper {
    max-width: 500px;
    margin: 0 auto;
}

/* Header e Título */
.faq-header {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.faq-title {
    font-size: 48px;
    font-weight: 700;
    line-height: 1.1;
    margin: 0;
    padding: 0;
}

/* Search Field */
.faq-search-wrapper {
    position: relative;
    width: 100%;
}

.faq-search-input {
    width: 100%;
    padding: 16px 50px 16px 20px;
    font-size: 16px;
    border: 1px solid;
    outline: none;
    transition: all 0.3s ease;
}

.faq-search-input:focus {
    border-color: rgba(255,255,255,0.6);
    box-shadow: 0 0 0 3px rgba(255,255,255,0.1);
}

.faq-search-icon,
.faq-search-loading {
    position: absolute;
    right: 16px;
    top: 50%;
    transform: translateY(-50%);
    pointer-events: none;
    opacity: 0.6;
}

/* Search Clear Button */
.faq-search-clear {
    position: absolute;
    right: 45px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    padding: 4px !important;
    color: #fff !important;
    cursor: pointer;
    opacity: 0.6;
    transition: opacity 0.2s ease;
    color: inherit;
    display: flex;
    align-items: center;
    justify-content: center;
}

.faq-search-clear:hover {
    opacity: 1;
}

.faq-search-loading svg {
    animation: faq-spin 1s linear infinite;
}

@keyframes faq-spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* Tags Filter */
.faq-tags-filter {
    display: flex;
    flex-wrap: nowrap;
    gap: 6px;
    align-items: center;
    overflow-x: auto;
    overflow-y: hidden;
    padding-bottom: 6px;
    scrollbar-width: thin;
    scrollbar-color: rgba(255,255,255,0.3) transparent;
    -webkit-overflow-scrolling: touch;
}

.faq-tags-filter::-webkit-scrollbar {
    height: 4px;
}

.faq-tags-filter::-webkit-scrollbar-track {
    background: transparent;
}

.faq-tags-filter::-webkit-scrollbar-thumb {
    background-color: rgba(255,255,255,0.3);
    border-radius: 4px;
}

.faq-tags-filter::-webkit-scrollbar-thumb:hover {
    background-color: rgba(255,255,255,0.5);
}

.faq-tag-btn {
    padding: 4px 22px 4px 22px !important;
    font-size: 11px !important;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.2px;
    border: none;
    cursor: pointer;
    transition: all 0.3s ease;
    outline: none;
    white-space: nowrap;
    flex-shrink: 0;
}

.faq-tag-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.faq-tag-btn.active {
    transform: scale(1.02);
}

/* Clear All Button */
.faq-clear-all-btn {
    padding: 8px 16px !important;
    font-size: 12px !important;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border: 1px solid rgba(255, 255, 255, 0.3);
    background: transparent;
    color: inherit;
    cursor: pointer;
    transition: all 0.3s ease;
    outline: none;
    display: flex;
    align-items: center;
    gap: 6px;
    border-radius: 4px;
    opacity: 0.7;
    color: #ffffff !important;
}

.faq-clear-all-btn:hover {
    opacity: 1;
    border-color: rgba(255, 255, 255, 0.6);
    background: rgba(255, 255, 255, 0.1) !important;
}

/* FAQ Items */
.faq-items-wrapper {
    width: 100%;
    position: relative;
}

.faq-items {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.faq-item {
    border: 1px solid;
    overflow: hidden;
    transition: all 0.3s ease;
}

.faq-item.hidden {
    display: none;
}

.faq-item.highlight .faq-question {
    background: rgba(255, 255, 0, 0.1);
}

.faq-question-wrapper {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
    cursor: pointer;
    user-select: none;
    transition: background-color 0.3s ease;
}

.faq-question-wrapper:hover {
    background-color: rgba(255, 255, 255, 0.05);
}

.faq-question {
    font-size: 15px;
    font-weight: 400;
    flex: 1;
    padding-right: 20px;
}

.faq-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.3s ease;
    flex-shrink: 0;
}

.faq-icon svg {
    display: block;
}

.faq-icon-vertical {
    transition: transform 0.3s ease, opacity 0.3s ease;
    transform-origin: center;
}

.faq-item.active .faq-icon-vertical {
    opacity: 0;
    transform: rotate(90deg);
}

.faq-item.active .faq-icon {
    transform: rotate(180deg);
}

/* Answer */
.faq-answer {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.4s ease;
    padding: 0 20px;
}

.faq-item.active .faq-answer {
    max-height: 1000px;
    padding-bottom: 20px;
}

.faq-answer p {
    margin: 0;
    line-height: 1.6;
    font-size: 14px !im;
}

.faq-answer p + p {
    margin-top: 12px;
}

.faq-answer a{
    color: #e87722 !important;
}

/* No results message */
.faq-no-results {
    text-align: center;
    font-size: 16px;
    opacity: 0.7;
    padding: 40px 20px;
    color: inherit;
}

/* Loading state */
.faq-items-wrapper.loading .faq-items {
    opacity: 0.5;
    pointer-events: none;
}

/* Responsive */
@media (max-width: 991px) {
    .faq-container.faq-two-columns {
        flex-direction: column;
    }

    .faq-container.faq-two-columns .faq-header,
    .faq-container.faq-two-columns .faq-items-wrapper {
        flex: 0 0 100%;
        max-width: 100%;
    }

    .faq-title {
        font-size: 36px;
    }
}

@media (max-width: 767px) {
    .faq-title {
        font-size: 28px;
    }

    .faq-tag-btn {
        padding: 4px 22px 4px 22px !important;
        font-size: 11px !important;
    }

    .faq-tags-filter {
        gap: 5px;
    }

    .faq-question-wrapper {
        padding: 16px 20px;
    }

    .faq-question {
        font-size: 14px;
    }

    .faq-answer {
        font-size: 14px;
    }

    .faq-item.active .faq-answer {
        padding: 0 20px 20px;
    }

    .faq-search-input {
        padding: 12px 45px 12px 16px;
        font-size: 14px;
    }
}

/* Animation for search results */
.faq-item {
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Focus states for accessibility */
.faq-tag-btn:focus {
    outline: 2px solid currentColor;
    outline-offset: 2px;
}

.faq-question-wrapper:focus-visible {
    outline: 2px solid currentColor;
    outline-offset: -2px;
}

.faq-search-input:focus {
    outline: none;
}

/* Highlight matched text in search results */
.faq-highlight {
    background-color: rgba(255, 255, 0, 0.3);
    padding: 0 2px;
    border-radius: 2px;
}
