/**
 * FAQ Section Styles
 * Apple-inspired accordion design
 */

/* ========================================
   FAQ SECTION CONTAINER
   ======================================== */

.faq-section {
    max-width: 800px;
    margin: 48px auto 32px;
    padding: 0 20px;
}

.faq-section-header {
    text-align: center;
    margin-bottom: 32px;
}

.faq-section-title {
    font-size: 28px;
    font-weight: 700;
    color: var(--color-text-primary, #1C1C1E);
    margin: 0 0 8px 0;
    letter-spacing: -0.5px;
}

.faq-section-subtitle {
    font-size: 16px;
    color: var(--color-text-secondary, #6E6E73);
    margin: 0;
}

/* ========================================
   FAQ ITEMS
   ======================================== */

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

.faq-item {
    background: var(--color-card, #FFFFFF);
    border-radius: 18px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.06);
    overflow: hidden;
    transition: box-shadow 0.2s ease;
}

.faq-item:hover {
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
}

.faq-item-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 24px;
    cursor: pointer;
    gap: 16px;
    -webkit-tap-highlight-color: transparent;
    user-select: none;
}

.faq-item-header:focus {
    outline: none;
}

.faq-item-header:focus-visible {
    outline: 2px solid var(--color-accent, #0071E3);
    outline-offset: -2px;
    border-radius: 18px;
}

.faq-question {
    font-size: 16px;
    font-weight: 600;
    color: var(--color-text-primary, #1C1C1E);
    margin: 0;
    line-height: 1.4;
    flex: 1;
}

.faq-toggle {
    flex-shrink: 0;
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--color-input-bg, rgba(0, 0, 0, 0.05));
    border-radius: 50%;
    transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1),
                background 0.2s ease;
}

.faq-toggle svg {
    width: 16px;
    height: 16px;
    color: var(--color-text-tertiary, #8E8E93);
    transition: color 0.2s ease;
}

.faq-item.expanded .faq-toggle {
    transform: rotate(180deg);
    background: var(--color-accent, #0071E3);
}

.faq-item.expanded .faq-toggle svg {
    color: white;
}

/* ========================================
   FAQ ANSWER
   ======================================== */

.faq-answer {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.faq-item.expanded .faq-answer {
    max-height: 500px;
}

.faq-answer-content {
    padding: 0 24px 24px;
    font-size: 15px;
    line-height: 1.7;
    color: var(--color-text-secondary, #6E6E73);
}

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

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

.faq-answer-content strong {
    color: var(--color-text-primary, #1C1C1E);
    font-weight: 600;
}

.faq-answer-content a {
    color: var(--color-accent, #0071E3);
    text-decoration: none;
}

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

/* ========================================
   INTERNAL LINKING SECTION
   ======================================== */

.related-tools-section {
    max-width: 800px;
    margin: 32px auto;
    padding: 0 20px;
}

.related-tools-title {
    font-size: 18px;
    font-weight: 600;
    color: var(--color-text-primary, #1C1C1E);
    margin: 0 0 16px 0;
}

.related-tools-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 12px;
}

.related-tool-card {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px 20px;
    background: var(--color-card, #FFFFFF);
    border-radius: 14px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
    text-decoration: none;
    cursor: pointer;
    transition: all 0.2s ease;
    border: none;
    width: 100%;
    text-align: left;
}

.related-tool-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
}

.related-tool-icon {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #007AFF 0%, #0071E3 100%);
    border-radius: 10px;
    flex-shrink: 0;
}

.related-tool-icon svg {
    width: 20px;
    height: 20px;
    color: white;
}

.related-tool-info {
    flex: 1;
    min-width: 0;
}

.related-tool-name {
    font-size: 14px;
    font-weight: 600;
    color: var(--color-text-primary, #1C1C1E);
    margin: 0 0 2px 0;
}

.related-tool-desc {
    font-size: 12px;
    color: var(--color-text-secondary, #6E6E73);
    margin: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.related-tool-arrow {
    flex-shrink: 0;
    width: 20px;
    height: 20px;
    color: var(--color-text-tertiary, #8E8E93);
    transition: transform 0.2s ease;
}

.related-tool-card:hover .related-tool-arrow {
    transform: translateX(4px);
}

/* ========================================
   DARK THEME
   ======================================== */

:root[data-theme="dark"] .faq-item {
    background: var(--color-card, #2C2C2E);
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.2);
}

:root[data-theme="dark"] .faq-item:hover {
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

:root[data-theme="dark"] .faq-question {
    color: var(--color-text-primary, #FFFFFF);
}

:root[data-theme="dark"] .faq-toggle {
    background: rgba(255, 255, 255, 0.1);
}

:root[data-theme="dark"] .faq-toggle svg {
    color: #AEAEB2;
}

:root[data-theme="dark"] .faq-answer-content {
    color: var(--color-text-secondary, #AEAEB2);
}

:root[data-theme="dark"] .faq-answer-content strong {
    color: var(--color-text-primary, #FFFFFF);
}

:root[data-theme="dark"] .related-tool-card {
    background: var(--color-card, #2C2C2E);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

:root[data-theme="dark"] .related-tool-card:hover {
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
}

:root[data-theme="dark"] .related-tool-name {
    color: var(--color-text-primary, #FFFFFF);
}

:root[data-theme="dark"] .related-tool-desc {
    color: var(--color-text-secondary, #AEAEB2);
}

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

@media (max-width: 640px) {
    .faq-section {
        margin: 32px auto 24px;
        padding: 0 16px;
    }

    .faq-section-title {
        font-size: 24px;
    }

    .faq-item-header {
        padding: 16px 20px;
    }

    .faq-question {
        font-size: 15px;
    }

    .faq-answer-content {
        padding: 0 20px 20px;
        font-size: 14px;
    }

    .related-tools-section {
        padding: 0 16px;
    }

    .related-tools-grid {
        grid-template-columns: 1fr;
    }
}

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

@media print {
    .faq-section {
        page-break-inside: avoid;
    }

    .faq-item {
        box-shadow: none;
        border: 1px solid #E5E5E5;
    }

    .faq-answer {
        max-height: none !important;
    }

    .faq-toggle {
        display: none;
    }

    .related-tools-section {
        display: none;
    }
}
