/* ==========================================
   FAQ Page - Modern Elegant Design
   ========================================== */

/* ==========================================
   Hero Section
   ========================================== */

.faq-hero {
    position: relative;
    padding: var(--space-20) 0 var(--space-16);
    background: linear-gradient(135deg, var(--color-accent-light) 0%, var(--bg-primary) 50%, var(--color-accent-light) 100%);
    text-align: center;
    overflow: hidden;
}

/* Decorative elements */
.faq-hero::before {
    content: '';
    position: absolute;
    top: -100px;
    right: -100px;
    width: 300px;
    height: 300px;
    background: radial-gradient(circle, rgba(var(--color-primary-rgb), 0.08) 0%, transparent 70%);
    border-radius: var(--rounded-full);
    animation: floatSlow 8s ease-in-out infinite;
}

.faq-hero::after {
    content: '';
    position: absolute;
    bottom: -50px;
    left: -50px;
    width: 200px;
    height: 200px;
    background: radial-gradient(circle, rgba(var(--color-primary-rgb), 0.06) 0%, transparent 70%);
    border-radius: var(--rounded-full);
    animation: floatSlow 10s ease-in-out infinite reverse;
}

@keyframes floatSlow {
    0%, 100% {
        transform: translate(0, 0) scale(1);
    }
    50% {
        transform: translate(20px, -20px) scale(1.1);
    }
}

/* Geometric decorations */
.faq-hero-decoration {
    position: absolute;
    opacity: 0.4;
    pointer-events: none;
}

.faq-hero-decoration--1 {
    top: 20%;
    left: 10%;
    width: 60px;
    height: 60px;
    border: 2px solid var(--color-primary);
    border-radius: var(--rounded-full);
    animation: rotate 20s linear infinite;
}

.faq-hero-decoration--2 {
    top: 30%;
    right: 15%;
    width: 40px;
    height: 40px;
    background: var(--color-accent);
    transform: rotate(45deg);
    animation: pulse 4s ease-in-out infinite;
}

.faq-hero-decoration--3 {
    bottom: 25%;
    left: 20%;
    width: 8px;
    height: 8px;
    background: var(--color-primary);
    border-radius: var(--rounded-full);
    animation: pulse 3s ease-in-out infinite 0.5s;
}

.faq-hero-decoration--4 {
    bottom: 35%;
    right: 25%;
    width: 12px;
    height: 12px;
    background: var(--color-accent);
    border-radius: var(--rounded-full);
    animation: pulse 3.5s ease-in-out infinite 1s;
}

@keyframes rotate {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

@keyframes pulse {
    0%, 100% {
        opacity: 0.4;
        transform: scale(1);
    }
    50% {
        opacity: 0.7;
        transform: scale(1.2);
    }
}

.faq-hero-content {
    position: relative;
    z-index: 1;
}

.faq-hero-title {
    font-family: var(--font-heading);
    font-size: var(--text-6xl);
    margin-bottom: var(--space-4);
    color: var(--text-primary);
    animation: fadeSlideUp 0.8s ease-out forwards;
    opacity: 0;
}

.faq-hero-subtitle {
    font-size: var(--text-xl);
    color: var(--text-secondary);
    max-width: 600px;
    margin: 0 auto;
    line-height: var(--leading-relaxed);
    animation: fadeSlideUp 0.8s ease-out 0.2s forwards;
    opacity: 0;
}

@keyframes fadeSlideUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Search box (optional) */
.faq-search {
    max-width: 500px;
    margin: var(--space-8) auto 0;
    position: relative;
    animation: fadeSlideUp 0.8s ease-out 0.4s forwards;
    opacity: 0;
}

.faq-search-input {
    width: 100%;
    padding: var(--space-4) var(--space-6);
    padding-left: var(--space-12);
    font-family: var(--font-body);
    font-size: var(--text-base);
    background: var(--bg-primary);
    border: 2px solid var(--color-gray-200);
    border-radius: var(--rounded-full);
    box-shadow: var(--shadow-md);
    transition: all var(--transition-base);
}

.faq-search-input:focus {
    outline: none;
    border-color: var(--color-primary);
    box-shadow: var(--shadow-lg), 0 0 0 4px rgba(var(--color-primary-rgb), 0.1);
}

.faq-search-icon {
    position: absolute;
    left: var(--space-4);
    top: 50%;
    transform: translateY(-50%);
    width: 24px;
    height: 24px;
    color: var(--text-muted);
}

/* ==========================================
   Category Cards
   ========================================== */

.faq-categories {
    padding: var(--space-12) 0;
    background: var(--bg-secondary);
}

.faq-categories-grid {
    display: grid;
    grid-template-columns: repeat(1, 1fr);
    gap: var(--space-6);
    max-width: 1000px;
    margin: 0 auto;
}

@media (min-width: 640px) {
    .faq-categories-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

.faq-category-card {
    background: var(--bg-primary);
    border-radius: var(--rounded-xl);
    padding: var(--space-8);
    text-align: center;
    box-shadow: var(--shadow-md);
    transition: all var(--transition-base);
    cursor: pointer;
    border: 2px solid transparent;
    opacity: 0;
    transform: translateY(20px);
}

.faq-category-card.is-visible {
    animation: fadeSlideUp 0.6s ease-out forwards;
}

.faq-category-card:nth-child(1).is-visible {
    animation-delay: 0.1s;
}

.faq-category-card:nth-child(2).is-visible {
    animation-delay: 0.2s;
}

.faq-category-card:nth-child(3).is-visible {
    animation-delay: 0.3s;
}

.faq-category-card:hover {
    transform: translateY(-8px);
    box-shadow: var(--shadow-xl);
    border-color: var(--color-primary);
}

.faq-category-card.is-active {
    border-color: var(--color-primary);
    background: var(--color-accent-light);
}

.faq-category-icon {
    width: 72px;
    height: 72px;
    margin: 0 auto var(--space-4);
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--color-accent) 0%, var(--color-accent-light) 100%);
    border-radius: var(--rounded-2xl);
    color: var(--color-primary);
    transition: all var(--transition-base);
}

.faq-category-card:hover .faq-category-icon {
    background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-primary-light) 100%);
    color: var(--color-white);
    transform: scale(1.1);
}

.faq-category-icon svg {
    width: 36px;
    height: 36px;
}

.faq-category-title {
    font-family: var(--font-display);
    font-size: var(--text-xl);
    font-weight: var(--font-bold);
    margin-bottom: var(--space-2);
    color: var(--text-primary);
}

.faq-category-count {
    font-size: var(--text-sm);
    color: var(--text-muted);
}

/* ==========================================
   FAQ Accordion Section
   ========================================== */

.faq-content {
    padding: var(--space-16) 0;
}

.faq-section {
    max-width: 800px;
    margin: 0 auto var(--space-12);
}

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

.faq-section-header {
    display: flex;
    align-items: center;
    gap: var(--space-4);
    margin-bottom: var(--space-6);
    padding-bottom: var(--space-4);
    border-bottom: 2px solid var(--color-gray-200);
}

.faq-section-icon {
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--color-accent);
    border-radius: var(--rounded-xl);
    color: var(--color-primary);
    flex-shrink: 0;
}

.faq-section-icon svg {
    width: 24px;
    height: 24px;
}

.faq-section-title {
    font-family: var(--font-display);
    font-size: var(--text-2xl);
    font-weight: var(--font-bold);
    color: var(--text-primary);
    margin: 0;
}

/* Modern Card-based Accordion */
.faq-accordion {
    display: flex;
    flex-direction: column;
    gap: var(--space-4);
}

.faq-item {
    background: var(--bg-primary);
    border-radius: var(--rounded-xl);
    box-shadow: var(--shadow);
    overflow: hidden;
    transition: all var(--transition-base);
    border: 1px solid var(--color-gray-200);
    opacity: 0;
    transform: translateY(20px);
}

.faq-item.is-visible {
    animation: fadeSlideUp 0.5s ease-out forwards;
}

/* Staggered animation delays */
.faq-item:nth-child(1).is-visible { animation-delay: 0.05s; }
.faq-item:nth-child(2).is-visible { animation-delay: 0.1s; }
.faq-item:nth-child(3).is-visible { animation-delay: 0.15s; }
.faq-item:nth-child(4).is-visible { animation-delay: 0.2s; }
.faq-item:nth-child(5).is-visible { animation-delay: 0.25s; }
.faq-item:nth-child(6).is-visible { animation-delay: 0.3s; }
.faq-item:nth-child(7).is-visible { animation-delay: 0.35s; }
.faq-item:nth-child(8).is-visible { animation-delay: 0.4s; }
.faq-item:nth-child(9).is-visible { animation-delay: 0.45s; }
.faq-item:nth-child(10).is-visible { animation-delay: 0.5s; }

.faq-item:hover {
    box-shadow: var(--shadow-md);
    border-color: var(--color-gray-300);
}

.faq-item.is-open {
    box-shadow: var(--shadow-lg);
    border-color: var(--color-primary);
}

.faq-question {
    display: flex;
    align-items: center;
    gap: var(--space-4);
    width: 100%;
    padding: var(--space-5) var(--space-6);
    background: none;
    border: none;
    font-family: var(--font-body);
    font-size: var(--text-base);
    font-weight: var(--font-medium);
    text-align: left;
    color: var(--text-primary);
    cursor: pointer;
    transition: all var(--transition-fast);
}

.faq-question:hover {
    background: var(--color-gray-50);
}

.faq-item.is-open .faq-question {
    background: var(--color-accent-light);
}

.faq-number {
    flex-shrink: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--color-gray-100);
    border-radius: var(--rounded-lg);
    font-size: var(--text-sm);
    font-weight: var(--font-bold);
    color: var(--text-muted);
    transition: all var(--transition-base);
}

.faq-item.is-open .faq-number {
    background: var(--color-primary);
    color: var(--color-white);
}

.faq-question-text {
    flex: 1;
    line-height: var(--leading-snug);
}

.faq-toggle-icon {
    flex-shrink: 0;
    width: 24px;
    height: 24px;
    color: var(--text-muted);
    transition: all var(--transition-base);
}

.faq-item.is-open .faq-toggle-icon {
    transform: rotate(180deg);
    color: var(--color-primary);
}

.faq-answer {
    max-height: 0;
    overflow: hidden;
    transition: max-height var(--transition-base) ease-out;
}

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

.faq-answer-content {
    padding: 0 var(--space-6) var(--space-6);
    padding-left: calc(var(--space-6) + 32px + var(--space-4));
    font-size: var(--text-base);
    color: var(--text-secondary);
    line-height: var(--leading-relaxed);
}

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

.faq-answer-content ul {
    margin: var(--space-3) 0;
    padding-left: var(--space-6);
}

.faq-answer-content li {
    margin-bottom: var(--space-2);
}

/* ==========================================
   CTA Section
   ========================================== */

.faq-cta {
    position: relative;
    padding: var(--space-16) 0;
    background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-primary-dark) 100%);
    overflow: hidden;
}

/* Pattern background */
.faq-cta::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image:
        radial-gradient(circle at 20% 80%, rgba(255,255,255,0.1) 0%, transparent 50%),
        radial-gradient(circle at 80% 20%, rgba(255,255,255,0.1) 0%, transparent 50%),
        url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.05'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
    pointer-events: none;
}

/* Floating decorations */
.faq-cta-decoration {
    position: absolute;
    border-radius: var(--rounded-full);
    background: rgba(255, 255, 255, 0.1);
    pointer-events: none;
}

.faq-cta-decoration--1 {
    width: 200px;
    height: 200px;
    top: -50px;
    right: -50px;
    animation: floatSlow 12s ease-in-out infinite;
}

.faq-cta-decoration--2 {
    width: 150px;
    height: 150px;
    bottom: -30px;
    left: 10%;
    animation: floatSlow 10s ease-in-out infinite reverse;
}

.faq-cta-decoration--3 {
    width: 100px;
    height: 100px;
    top: 30%;
    left: -30px;
    animation: floatSlow 8s ease-in-out infinite 2s;
}

.faq-cta-content {
    position: relative;
    z-index: 1;
    text-align: center;
    max-width: 600px;
    margin: 0 auto;
}

.faq-cta-icon {
    width: 80px;
    height: 80px;
    margin: 0 auto var(--space-6);
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.2);
    border-radius: var(--rounded-full);
    color: var(--color-white);
}

.faq-cta-icon svg {
    width: 40px;
    height: 40px;
}

.faq-cta-title {
    font-family: var(--font-heading);
    font-size: var(--text-4xl);
    font-weight: var(--font-bold);
    color: var(--color-white);
    margin-bottom: var(--space-4);
}

.faq-cta-text {
    font-size: var(--text-lg);
    color: rgba(255, 255, 255, 0.9);
    margin-bottom: var(--space-8);
    line-height: var(--leading-relaxed);
}

.faq-cta-buttons {
    display: flex;
    flex-direction: column;
    gap: var(--space-4);
    justify-content: center;
    align-items: center;
}

@media (min-width: 640px) {
    .faq-cta-buttons {
        flex-direction: row;
    }
}

.faq-cta .btn-white {
    background: var(--color-white);
    color: var(--color-primary);
    padding: var(--space-4) var(--space-8);
    font-weight: var(--font-semibold);
    border-radius: var(--rounded-full);
    transition: all var(--transition-base);
    box-shadow: var(--shadow-lg);
}

.faq-cta .btn-white:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-xl);
    background: var(--color-white);
    color: var(--color-primary-dark);
}

.faq-cta .btn-outline-white {
    background: transparent;
    color: var(--color-white);
    padding: var(--space-4) var(--space-8);
    font-weight: var(--font-semibold);
    border: 2px solid rgba(255, 255, 255, 0.5);
    border-radius: var(--rounded-full);
    transition: all var(--transition-base);
}

.faq-cta .btn-outline-white:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: var(--color-white);
    color: var(--color-white);
}

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

.faq-empty {
    text-align: center;
    padding: var(--space-16) var(--space-4);
}

.faq-empty-icon {
    width: 80px;
    height: 80px;
    margin: 0 auto var(--space-6);
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--color-gray-100);
    border-radius: var(--rounded-full);
    color: var(--text-muted);
}

.faq-empty-icon svg {
    width: 40px;
    height: 40px;
}

.faq-empty-title {
    font-size: var(--text-xl);
    font-weight: var(--font-semibold);
    color: var(--text-primary);
    margin-bottom: var(--space-2);
}

.faq-empty-text {
    color: var(--text-muted);
}

/* ==========================================
   Dark Mode
   ========================================== */

[data-theme="dark"] .faq-hero {
    background: linear-gradient(135deg, var(--bg-tertiary) 0%, var(--bg-primary) 50%, var(--bg-tertiary) 100%);
}

[data-theme="dark"] .faq-hero::before,
[data-theme="dark"] .faq-hero::after {
    background: radial-gradient(circle, rgba(var(--color-primary-rgb), 0.15) 0%, transparent 70%);
}

[data-theme="dark"] .faq-hero-decoration--1 {
    border-color: var(--color-primary-light);
}

[data-theme="dark"] .faq-hero-decoration--2 {
    background: var(--bg-tertiary);
}

[data-theme="dark"] .faq-search-input {
    background: var(--bg-secondary);
    border-color: var(--bg-tertiary);
    color: var(--text-primary);
}

[data-theme="dark"] .faq-categories {
    background: var(--bg-secondary);
}

[data-theme="dark"] .faq-category-card {
    background: var(--bg-primary);
}

[data-theme="dark"] .faq-category-card.is-active {
    background: var(--bg-tertiary);
}

[data-theme="dark"] .faq-category-icon {
    background: linear-gradient(135deg, var(--bg-tertiary) 0%, var(--bg-secondary) 100%);
}

[data-theme="dark"] .faq-section-header {
    border-bottom-color: var(--bg-tertiary);
}

[data-theme="dark"] .faq-section-icon {
    background: var(--bg-tertiary);
}

[data-theme="dark"] .faq-item {
    background: var(--bg-primary);
    border-color: var(--bg-tertiary);
}

[data-theme="dark"] .faq-item:hover {
    border-color: var(--bg-tertiary);
}

[data-theme="dark"] .faq-item.is-open {
    border-color: var(--color-primary);
}

[data-theme="dark"] .faq-question:hover {
    background: var(--bg-secondary);
}

[data-theme="dark"] .faq-item.is-open .faq-question {
    background: var(--bg-tertiary);
}

[data-theme="dark"] .faq-number {
    background: var(--bg-tertiary);
}

[data-theme="dark"] .faq-empty-icon {
    background: var(--bg-tertiary);
}

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

@media (max-width: 767px) {
    .faq-hero {
        padding: var(--space-12) 0;
    }

    .faq-hero-title {
        font-size: var(--text-4xl);
    }

    .faq-hero-subtitle {
        font-size: var(--text-base);
        padding: 0 var(--space-4);
    }

    .faq-hero-decoration {
        display: none;
    }

    .faq-categories {
        padding: var(--space-8) 0;
    }

    .faq-category-card {
        padding: var(--space-6);
    }

    .faq-category-icon {
        width: 56px;
        height: 56px;
    }

    .faq-category-icon svg {
        width: 28px;
        height: 28px;
    }

    .faq-content {
        padding: var(--space-10) 0;
    }

    .faq-section-header {
        flex-direction: column;
        text-align: center;
    }

    .faq-question {
        padding: var(--space-4);
        gap: var(--space-3);
    }

    .faq-number {
        width: 28px;
        height: 28px;
        font-size: var(--text-xs);
    }

    .faq-answer-content {
        padding: 0 var(--space-4) var(--space-4);
        padding-left: calc(var(--space-4) + 28px + var(--space-3));
        font-size: var(--text-sm);
    }

    .faq-cta {
        padding: var(--space-12) 0;
    }

    .faq-cta-title {
        font-size: var(--text-3xl);
    }

    .faq-cta-text {
        font-size: var(--text-base);
    }

    .faq-cta-icon {
        width: 64px;
        height: 64px;
    }

    .faq-cta-icon svg {
        width: 32px;
        height: 32px;
    }

    .faq-cta-decoration {
        opacity: 0.5;
    }
}

@media (min-width: 768px) and (max-width: 1023px) {
    .faq-hero-title {
        font-size: var(--text-5xl);
    }

    .faq-category-card {
        padding: var(--space-6);
    }
}
