/**
 * WS FAQ - Clean Production Styles
 */

/* ==========================================================================
   Variables (CSS Custom Properties)
   ========================================================================== */

.ws-faq-hub {
    --faq-color-text: #1a1a1a;
    --faq-color-text-light: #555;
    --faq-color-primary: #DA6E5C;
    --faq-color-secondary: #E8B0A4;
    --faq-color-border: #eee;
    --faq-color-bg: #f9f7f6;
    --faq-color-bg-hover: #f5f0ee;
    --faq-radius: 8px;
    --faq-transition: 0.2s ease;
}

/* ==========================================================================
   Search
   ========================================================================== */

.ws-faq-search {
    position: relative;
    margin-bottom: 24px;
}

.ws-faq-hub .ws-faq-search-input,
.ws-faq-hub .ws-faq-search-input[type="text"] {
    width: 100% !important;
    padding: 14px 48px 14px 16px !important;
    font-size: 16px !important;
    font-family: inherit !important;
    color: var(--faq-color-text) !important;
    background: #fff !important;
    border: 1px solid var(--faq-color-border) !important;
    border-radius: 8px !important;
    outline: none !important;
    box-shadow: none !important;
    margin: 0 !important;
    height: auto !important;
    line-height: normal !important;
    transition: border-color var(--faq-transition), box-shadow var(--faq-transition) !important;
}

.ws-faq-hub .ws-faq-search-input:focus,
.ws-faq-hub .ws-faq-search-input[type="text"]:focus {
    border-color: var(--faq-color-primary) !important;
    box-shadow: 0 0 0 3px rgba(218, 110, 92, 0.15) !important;
    background: #fff !important;
}

.ws-faq-hub .ws-faq-search-input::placeholder {
    color: #9ca3af !important;
    opacity: 1 !important;
}

.ws-faq-search-icon {
    position: absolute;
    right: 16px;
    top: 50%;
    transform: translateY(-50%);
    width: 20px;
    height: 20px;
    color: var(--faq-color-secondary);
    pointer-events: none;
}

/* ==========================================================================
   Category Filter
   ========================================================================== */

.ws-faq-filter {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 32px;
}

.ws-faq-filter-btn {
    padding: 10px 20px;
    color: var(--faq-color-text-light);
    background: var(--faq-color-bg);
    border: 1px solid var(--faq-color-border);
    cursor: pointer;
    transition: all var(--faq-transition);
}

.ws-faq-filter-btn:hover {
    color: var(--faq-color-primary);
    background: var(--faq-color-bg-hover);
    border-color: var(--faq-color-secondary);
}

.ws-faq-filter-btn.active {
    color: #fff;
    background: var(--faq-color-primary);
    border-color: var(--faq-color-primary);
}

.ws-faq-filter-btn.active:hover {
    color: #fff;
    background: var(--faq-color-primary);
    border-color: var(--faq-color-primary);
}

/* ==========================================================================
   FAQ Groups (when grouped by category)
   ========================================================================== */

.ws-faq-group {
    margin-bottom: 40px;
}

.ws-faq-group:last-child {
    margin-bottom: 0;
}

.ws-faq-group-title {
    margin: 0 0 16px;
    color: var(--faq-color-text-light);
}

.ws-faq-group.hidden {
    display: none;
}

/* ==========================================================================
   FAQ List & Items
   ========================================================================== */

.ws-faq-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.ws-faq-item {
    background: #fff;
    border-radius: var(--faq-radius);
    overflow: hidden;
}

.ws-faq-item.hidden {
    display: none;
}

/* ==========================================================================
   Question (Accordion Header)
   ========================================================================== */

.ws-faq-question {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    padding: 18px 20px;
    font-size: 16px;
    font-weight: 500;
    font-family: inherit;
    text-align: left;
    color: var(--faq-color-text);
    background: transparent;
    border: none;
    cursor: pointer;
    transition: color var(--faq-transition), background var(--faq-transition);
    gap: 16px;
    white-space: normal;
}

.ws-faq-question:hover {
    background: var(--faq-color-bg);
}

.ws-faq-item.active .ws-faq-question {
    color: #fff;
    background: var(--faq-color-primary);
}

.ws-faq-question:focus {
    outline: none;
}

.ws-faq-question:focus-visible {
    outline: 2px solid var(--faq-color-secondary);
    outline-offset: -2px;
    border-radius: var(--faq-radius);
}

.ws-faq-question-text {
    flex: 1;
    min-width: 0;
    line-height: 1.5;
    overflow-wrap: anywhere;
    word-break: break-word;
    white-space: normal;
}

/* ==========================================================================
   Icon (Plus/Minus)
   ========================================================================== */

.ws-faq-icon {
    flex-shrink: 0;
    width: 24px;
    height: 24px;
    position: relative;
    color: var(--faq-color-secondary);
    transition: color var(--faq-transition), transform 0.3s ease;
}

.ws-faq-question:hover .ws-faq-icon {
    color: var(--faq-color-primary);
}

.ws-faq-item.active .ws-faq-icon {
    color: #fff;
}

.ws-faq-icon::before,
.ws-faq-icon::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    background: currentColor;
    transition: transform 0.3s ease, opacity 0.3s ease;
}

.ws-faq-icon::before {
    width: 12px;
    height: 2px;
    transform: translate(-50%, -50%);
}

.ws-faq-icon::after {
    width: 2px;
    height: 12px;
    transform: translate(-50%, -50%);
}

.ws-faq-item.active .ws-faq-icon::after {
    transform: translate(-50%, -50%) rotate(90deg);
    opacity: 0;
}

/* ==========================================================================
   Answer (Accordion Content)
   ========================================================================== */

.ws-faq-answer {
    overflow: hidden;
    transition: height 0.3s ease;
}

.ws-faq-answer[hidden] {
    display: block;
    height: 0;
}

.ws-faq-answer-content {
    padding: 16px 20px 20px;
    font-size: 15px;
    line-height: 1.7;
    color: var(--faq-color-text-light);
}

.ws-faq-answer-content p:first-child {
    margin-top: 0;
}

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

.ws-faq-answer-content a {
    color: var(--faq-color-primary);
    text-decoration: none;
}

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

.ws-faq-answer-content ul,
.ws-faq-answer-content ol {
    margin: 16px 0;
    padding-left: 24px;
}

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

.ws-faq-answer-content img {
    max-width: 100%;
    height: auto;
    border-radius: var(--faq-radius);
}

/* ==========================================================================
   Empty State
   ========================================================================== */

.ws-faq-empty {
    padding: 48px 24px;
    text-align: center;
    color: var(--faq-color-text-light);
    font-size: 15px;
}

/* ==========================================================================
   Search Highlight
   ========================================================================== */

.ws-faq-highlight {
    background: var(--faq-color-secondary);
    color: #fff;
    padding: 1px 4px;
    border-radius: 3px;
}

/* ==========================================================================
   Responsive
   ========================================================================== */

@media (max-width: 640px) {
    .ws-faq-item {
        width: 100%;
        max-width: 100%;
    }

    .ws-faq-question {
        width: 100%;
        max-width: 100%;
        white-space: normal !important;
    }

    .ws-faq-question-text {
        min-width: 0;
        white-space: normal !important;
        overflow-wrap: anywhere !important;
        word-break: break-word !important;
    }

    .ws-faq-hub .ws-faq-search-input,
    .ws-faq-hub .ws-faq-search-input[type="text"] {
        padding: 12px 44px 12px 14px !important;
        font-size: 15px !important;
    }

    .ws-faq-filter {
        gap: 8px;
        margin-bottom: 24px;
    }

    .ws-faq-filter-btn {
        padding: 8px 16px;
    }

    .ws-faq-question {
        padding: 14px 16px;
        font-size: 15px;
    }

    .ws-faq-answer-content {
        font-size: 14px;
        padding: 12px 16px 16px;
    }

    .ws-faq-list {
        gap: 10px;
    }
}

