/* WP Easy FAQs Frontend Styles */

/* Dialog Styles - Native HTML Dialog Element */

.wpef-generate-dialog,
.wpef-loading-dialog,
.wpef-success-dialog,
.wpef-error-dialog {
    border: none;
    border-radius: 8px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
    padding: 0;
    width: 90%;
    max-width: 500px;
}

.wpef-generate-dialog::backdrop,
.wpef-loading-dialog::backdrop,
.wpef-success-dialog::backdrop,
.wpef-error-dialog::backdrop {
    background: rgba(0, 0, 0, 0.5);
}

.wpef-dialog-content {
    padding: 30px;
}

.wpef-dialog-content h2 {
    margin: 0 0 15px 0;
    font-size: 20px;
    color: #333;
}

.wpef-dialog-content p {
    margin: 0 0 20px 0;
    font-size: 16px;
    color: #555;
}

.wpef-faq-count-selector {
    display: flex;
    align-items: center;
    gap: 20px;
    margin: 25px 0 30px 0;
}

.wpef-faq-count-selector input[type="range"] {
    flex: 1;
    height: 6px;
    border-radius: 3px;
    background: #e0e0e0;
    outline: none;
    -webkit-appearance: none;
    cursor: pointer;
}

.wpef-faq-count-selector input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #0066cc;
    cursor: pointer;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
}

.wpef-faq-count-selector input[type="range"]::-moz-range-thumb {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #0066cc;
    cursor: pointer;
    border: none;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
}

.wpef-faq-count-selector span {
    font-weight: bold;
    font-size: 18px;
    min-width: 40px;
    text-align: center;
    color: #0066cc;
}

.wpef-dialog-buttons {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
    margin: 0;
}

.wpef-dialog-buttons button {
    padding: 8px 16px;
    font-size: 14px;
}

.wpef-spinner {
    border: 4px solid #f3f3f3;
    border-top: 4px solid #0066cc;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: wpef-spin 1s linear infinite;
    margin: 20px auto 0;
}

@keyframes wpef-spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Accordion Styles */

.wpef-accordion {
    margin: 20px 0;
    font-family: inherit;
}

.wpef-controls {
    display: flex;
    gap: 10px;
    margin-bottom: 15px;
}

.wpef-toggle-all {
    padding: 8px 16px;
    background: var(--wpef-button-bg, #0066cc);
    color: var(--wpef-button-text, #ffffff);
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: background-color 0.3s ease;
}

.wpef-toggle-all:hover {
    background: var(--wpef-button-hover, #0052a3);
}

.wpef-items {
    border: 2px solid var(--wpef-button-bg, #0066cc);
    border-radius: 4px;
    overflow: hidden;
}

.wpef-item {
    border-bottom: 1px solid var(--wpef-button-bg, #0066cc);
}

.wpef-item:last-child {
    border-bottom: none;
}

.wpef-button {
    width: 100%;
    padding: 15px 20px;
    background: var(--wpef-button-bg, #0066cc);
    color: var(--wpef-button-text, #ffffff);
    border: none;
    cursor: pointer;
    font-size: var(--wpef-font-size, 16px);
    font-weight: 500;
    transition: all 0.3s ease;
    display: flex;
    justify-content: space-between;
    align-items: center;
    text-align: left;
    gap: 15px;
}

.wpef-button:hover {
    background: var(--wpef-button-hover, #0052a3);
}

.wpef-button:focus {
    outline: 2px solid var(--wpef-button-bg, #0066cc);
    outline-offset: 2px;
}

.wpef-question {
    flex: 1;
}

.wpef-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    font-size: 18px;
    font-weight: bold;
    transition: transform 0.3s ease;
    flex-shrink: 0;
}

.wpef-button.active .wpef-icon {
    transform: rotate(45deg);
}

.wpef-content {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease, padding 0.3s ease;
    background: var(--wpef-content-bg, #f0f5ff);
}

.wpef-content.active {
    max-height: 2000px;
}

.wpef-content-inner {
    padding: 20px;
    line-height: 1.6;
    font-size: var(--wpef-font-size, 16px);
}

.wpef-content-inner p {
    margin: 0 0 15px 0;
}

.wpef-content-inner p:last-child {
    margin-bottom: 0;
}

/* Responsive Design */

@media (max-width: 768px) {
    .wpef-button {
        padding: 12px 15px;
        font-size: 15px;
    }

    .wpef-content-inner {
        padding: 15px;
    }

    .wpef-icon {
        width: 20px;
        height: 20px;
        font-size: 16px;
    }

    .wpef-controls {
        flex-direction: column;
    }

    .wpef-toggle-all {
        width: 100%;
    }
}

/* Accessibility */

.wpef-button:focus-visible {
    outline: 2px solid #0066cc;
    outline-offset: -2px;
}

/* Dark Mode Support */

@media (prefers-color-scheme: dark) {
    .wpef-items {
        border-color: #444;
    }

    .wpef-item {
        border-bottom-color: #444;
    }
}
