/**
 * Hushly FAQs - Frontend Styles
 *
 * @package Hushly_GEOSherpa
 */

/* Base Block Styles */
.hushly-geosherpa-block {
    --ac-primary: #0073aa;
    --ac-text: #1e1e1e;
    --ac-text-muted: #757575;
    --ac-border: #ddd;
    --ac-bg: #fff;
    --ac-bg-alt: #f7f7f7;
    --ac-radius: 8px;
    --ac-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    --ac-gap: 20px;
    
    font-family: inherit;
    color: var(--ac-text);
}

.hushly-geosherpa-block-title {
    margin: 0 0 var(--ac-gap);
    font-size: 1.5em;
    font-weight: 600;
    color: var(--ac-text);
}

/* Placeholder & Error States */
.hushly-geosherpa-placeholder,
.hushly-geosherpa-error {
    padding: 40px;
    text-align: center;
    background: var(--ac-bg-alt);
    border-radius: var(--ac-radius);
}

.hushly-geosherpa-placeholder p,
.hushly-geosherpa-error p {
    margin: 0;
    color: var(--ac-text-muted);
}

.hushly-geosherpa-error {
    background: #fef2f2;
    color: #991b1b;
}

.hushly-geosherpa-error strong {
    color: #7f1d1d;
}

/* Persona Name */
.hushly-geosherpa-persona-name {
    font-size: 1.25em;
    font-weight: 600;
    color: var(--ac-text);
    margin: 0 0 16px 0;
    padding: 8px 0;
    border-bottom: 2px solid var(--ac-primary);
}

/* FAQ Accordion Container */
.hushly-geosherpa-accordion {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

/* FAQ Item */
.hushly-faq-item {
    border: 1px solid var(--ac-border);
    border-radius: var(--ac-radius);
    background: var(--ac-bg);
    overflow: hidden;
    transition: box-shadow 0.2s ease;
}

.hushly-faq-item:hover {
    box-shadow: var(--ac-shadow);
}

/* FAQ Question Button */
.hushly-faq-question {
    display: flex;
    align-items: start;
    justify-content: space-between;
    padding: 16px 20px;
    margin: 0;
    border: none;
    background: transparent;
    cursor: pointer;
    text-align: left;
    font-family: inherit;
    font-size: 1rem;
    font-weight: 600;
    line-height: 1.5;
    color: var(--ac-text);
    transition: background-color 0.2s ease;
}

.hushly-faq-question:hover {
    background: var(--ac-bg-alt);
}

.hushly-faq-question:focus {
    outline: 2px solid var(--ac-primary);
    outline-offset: -2px;
}

.hushly-faq-question:focus:not(:focus-visible) {
    outline: none;
}

.hushly-faq-question:focus-visible {
    outline: 2px solid var(--ac-primary);
    outline-offset: -2px;
}

.hushly-faq-question-text {
    flex: 1;
    padding-right: 16px;
}

/* FAQ Icon */
.hushly-faq-icon {
    flex-shrink: 0;
    width: 24px;
    height: 24px;
    position: relative;
    transition: transform 0.3s ease;
}

.hushly-faq-icon::before,
.hushly-faq-icon::after {
    content: '';
    position: absolute;
    background-color: var(--ac-primary);
    transition: transform 0.3s ease;
}

.hushly-faq-icon::before {
    top: 50%;
    left: 4px;
    right: 4px;
    height: 2px;
    transform: translateY(-50%);
}

.hushly-faq-icon::after {
    left: 50%;
    top: 4px;
    bottom: 4px;
    width: 2px;
    transform: translateX(-50%);
}

/* Expanded State */
.hushly-faq-item.is-open .hushly-faq-icon::after {
    transform: translateX(-50%) rotate(90deg);
    opacity: 0;
}

.hushly-faq-question[aria-expanded="true"] + .hushly-faq-answer {
    display: block;
}

/* FAQ Answer */
.hushly-faq-answer {
    overflow: hidden;
}

.hushly-faq-answer[hidden] {
    display: none;
}

.hushly-faq-answer-content {
    padding: 0 20px 20px 20px;
    color: var(--ac-text-muted);
    font-size: 0.95rem;
    line-height: 1.7;
}

.hushly-faq-answer-content p {
    margin: 0 0 12px 0;
}

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

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

.hushly-faq-answer-content li {
    margin-bottom: 6px;
}

.hushly-faq-answer-content a {
    color: var(--ac-primary);
    text-decoration: underline;
}

.hushly-faq-answer-content a:hover {
    text-decoration: none;
}

/* Legacy List Format (for backwards compatibility) */
.hushly-geosherpa-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.hushly-geosherpa-list-item {
    padding: 12px 16px;
    border-bottom: 1px solid var(--ac-border);
}

/* Generic Data Display */
.hushly-geosherpa-data {
    margin: var(--ac-gap) 0;
}

.hushly-geosherpa-title {
    margin: 0 0 15px;
    font-size: 1.3em;
    font-weight: 600;
}

.hushly-geosherpa-item {
    padding: 10px 0;
    border-bottom: 1px solid var(--ac-border);
}

.hushly-geosherpa-content {
    line-height: 1.7;
}

/* Loading State */
.hushly-geosherpa-block.is-loading {
    position: relative;
    min-height: 100px;
}

.hushly-geosherpa-block.is-loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 32px;
    height: 32px;
    margin: -16px 0 0 -16px;
    border: 3px solid var(--ac-border);
    border-top-color: var(--ac-primary);
    border-radius: 50%;
    animation: ac-spin 0.8s linear infinite;
}

@keyframes ac-spin {
    to { transform: rotate(360deg); }
}

/* Dark Theme Support */
@media (prefers-color-scheme: dark) {
    .hushly-geosherpa-block {
        --ac-text: #e4e4e7;
        --ac-text-muted: #a1a1aa;
        --ac-border: #3f3f46;
        --ac-bg: #27272a;
        --ac-bg-alt: #18181b;
        --ac-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
    }
    
    .hushly-geosherpa-error {
        background: #450a0a;
        color: #fca5a5;
    }
    
    .hushly-geosherpa-error strong {
        color: #fecaca;
    }
}

/* Theme Override Classes */
.hushly-geosherpa-block.theme-light {
    --ac-text: #1e1e1e;
    --ac-text-muted: #757575;
    --ac-border: #ddd;
    --ac-bg: #fff;
    --ac-bg-alt: #f7f7f7;
}

.hushly-geosherpa-block.theme-dark {
    --ac-text: #e4e4e7;
    --ac-text-muted: #a1a1aa;
    --ac-border: #3f3f46;
    --ac-bg: #27272a;
    --ac-bg-alt: #18181b;
}

/* Responsive */
@media screen and (max-width: 768px) {
    .hushly-faq-question {
        padding: 14px 16px;
    }
    
    .hushly-faq-answer-content {
        padding: 0 16px 16px 16px;
    }
}
