/**
 * FAQ Page Styles
 * よくある質問ページのスタイル
 */

/* ==========================================================================
   FAQ Hero Section
   ========================================================================== */
.faq-hero {
    position: relative;
    padding: 8rem 0 4rem;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    overflow: hidden;
}

/* Background Pattern */
.faq-bg-pattern {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
}

.pattern-grid {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: 
        linear-gradient(rgba(0, 134, 123, 0.03) 1px, transparent 1px),
        linear-gradient(90deg, rgba(0, 134, 123, 0.03) 1px, transparent 1px);
    background-size: 50px 50px;
}

/* Floating Shapes */
.floating-shapes {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

.shape {
    position: absolute;
    border-radius: 50%;
    opacity: 0.1;
}

.shape-1 {
    width: 200px;
    height: 200px;
    background: var(--primary-color);
    top: 10%;
    left: 5%;
    animation: float 20s ease-in-out infinite;
}

.shape-2 {
    width: 150px;
    height: 150px;
    background: var(--secondary-color);
    top: 60%;
    right: 10%;
    animation: float 25s ease-in-out infinite reverse;
}

.shape-3 {
    width: 100px;
    height: 100px;
    background: var(--primary-color);
    bottom: 20%;
    left: 50%;
    animation: float 15s ease-in-out infinite;
}

@keyframes float {
    0%, 100% {
        transform: translateY(0) rotate(0deg);
    }
    33% {
        transform: translateY(-20px) rotate(120deg);
    }
    66% {
        transform: translateY(20px) rotate(240deg);
    }
}

/* Hero Content */
.faq-hero .hero-content {
    position: relative;
    z-index: 10;
    text-align: center;
}

.faq-subtitle {
    display: inline-block;
    font-size: 0.875rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--primary-color);
    margin-bottom: 1rem;
}

.faq-title {
    font-size: 3rem;
    font-weight: 700;
    color: var(--text-color);
    margin-bottom: 1rem;
}

.faq-description {
    font-size: 1.125rem;
    color: var(--text-light);
    line-height: 1.8;
    margin-bottom: 2rem;
}

/* Search Box */
.faq-search {
    max-width: 600px;
    margin: 0 auto;
    position: relative;
}

.faq-search-input {
    width: 100%;
    padding: 1rem 3.5rem 1rem 1.5rem;
    font-size: 1rem;
    border: 2px solid #e5e7eb;
    border-radius: 50px;
    background: white;
    transition: all 0.3s ease;
}

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

.faq-search-button {
    position: absolute;
    right: 5px;
    top: 50%;
    transform: translateY(-50%);
    width: 45px;
    height: 45px;
    background: var(--primary-color);
    border: none;
    border-radius: 50%;
    color: white;
    cursor: pointer;
    transition: all 0.3s ease;
}

.faq-search-button:hover {
    background: var(--primary-dark);
    transform: translateY(-50%) scale(1.05);
}

/* ==========================================================================
   FAQ Categories
   ========================================================================== */
.faq-categories {
    background: white;
    padding: 2rem 0;
    border-bottom: 1px solid #e5e7eb;
    position: sticky;
    top: 80px;
    z-index: 100;
}

.category-tabs {
    display: flex;
    gap: 1rem;
    overflow-x: auto;
    padding-bottom: 0.5rem;
    -webkit-overflow-scrolling: touch;
}

.category-tabs::-webkit-scrollbar {
    height: 4px;
}

.category-tabs::-webkit-scrollbar-track {
    background: #f3f4f6;
    border-radius: 2px;
}

.category-tabs::-webkit-scrollbar-thumb {
    background: var(--primary-color);
    border-radius: 2px;
}

.category-tab {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text-light);
    background: #f3f4f6;
    border: none;
    border-radius: 50px;
    cursor: pointer;
    white-space: nowrap;
    transition: all 0.3s ease;
}

.category-tab:hover {
    background: #e5e7eb;
    color: var(--text-color);
}

.category-tab.active {
    background: var(--primary-color);
    color: white;
}

.category-tab i {
    font-size: 1rem;
}

/* ==========================================================================
   FAQ Content
   ========================================================================== */
.faq-content {
    padding: 4rem 0;
    background: #f8f9fa;
}

.faq-wrapper {
    max-width: 900px;
    margin: 0 auto;
}

/* FAQ Category */
.faq-category {
    margin-bottom: 3rem;
    opacity: 0;
    animation: fadeInUp 0.5s ease forwards;
}

.faq-category[data-category]:not(.active) {
    display: none;
}

.category-title {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--text-color);
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid var(--primary-color);
}

.category-title i {
    color: var(--primary-color);
}

/* FAQ Item */
.faq-item {
    background: white;
    border-radius: 12px;
    margin-bottom: 1rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    transition: all 0.3s ease;
    overflow: visible;
    position: relative;
}

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

/* FAQ Question */
.faq-question {
    width: 100%;
    padding: 1.5rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    font-size: 1.125rem;
    font-weight: 500;
    color: var(--text-color);
    background: transparent;
    border: none;
    cursor: pointer;
    text-align: left;
    transition: all 0.3s ease;
}

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

.faq-question i {
    flex-shrink: 0;
    font-size: 0.875rem;
    transition: transform 0.3s ease;
}

.faq-question[aria-expanded="true"] i {
    transform: rotate(180deg);
}

/* FAQ Answer */
.faq-answer {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease, padding 0.3s ease;
}

.faq-question[aria-expanded="true"] + .faq-answer {
    max-height: 2000px;
    padding: 0 1.5rem 1.5rem;
    overflow: visible;
}

.faq-answer p {
    color: var(--text-light);
    line-height: 1.8;
    margin-bottom: 1rem;
}

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

.faq-answer ul,
.faq-answer ol {
    margin: 1rem 0;
    padding-left: 1.5rem;
    color: var(--text-light);
}

.faq-answer li {
    margin-bottom: 0.5rem;
    line-height: 1.8;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

.faq-answer strong {
    color: var(--text-color);
    font-weight: 600;
}

/* Highlighted Search Results */
.faq-item.highlighted {
    border: 2px solid var(--primary-color);
}

.search-highlight {
    background: #fef3c7;
    padding: 0.125rem 0.25rem;
    border-radius: 3px;
}

/* ==========================================================================
   FAQ CTA Section
   ========================================================================== */
.faq-cta {
    padding: 5rem 0;
    background: white;
    text-align: center;
}

.cta-content {
    max-width: 800px;
    margin: 0 auto;
}

.cta-title {
    font-size: 2rem;
    font-weight: 700;
    color: var(--text-color);
    margin-bottom: 1rem;
}

.cta-text {
    font-size: 1.125rem;
    color: var(--text-light);
    line-height: 1.8;
    margin-bottom: 2rem;
}

.cta-buttons {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
}

.btn-primary,
.btn-secondary {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.875rem 2rem;
    font-size: 1rem;
    font-weight: 600;
    border-radius: 50px;
    text-decoration: none;
    transition: all 0.3s ease;
}

.btn-primary {
    background: var(--primary-color);
    color: white;
    border: 2px solid var(--primary-color);
}

.btn-primary:hover {
    background: var(--primary-dark);
    border-color: var(--primary-dark);
    transform: translateY(-2px);
    box-shadow: 0 5px 20px rgba(0, 134, 123, 0.3);
}

.btn-secondary {
    background: transparent;
    color: var(--primary-color);
    border: 2px solid var(--primary-color);
}

.btn-secondary:hover {
    background: var(--primary-color);
    color: white;
}

/* ==========================================================================
   Animations
   ========================================================================== */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ==========================================================================
   Responsive
   ========================================================================== */
@media (max-width: 768px) {
    .faq-hero {
        padding: 6rem 0 3rem;
    }
    
    .faq-title {
        font-size: 2rem;
    }
    
    .faq-description {
        font-size: 1rem;
        padding: 0 1rem;
    }
    
    /* Search Box Mobile */
    .faq-search {
        padding: 0 1rem;
    }
    
    .faq-search-input {
        font-size: 0.9rem;
        padding: 0.875rem 3rem 0.875rem 1.25rem;
    }
    
    .faq-search-button {
        width: 40px;
        height: 40px;
    }
    
    /* Categories Section Mobile */
    .faq-categories {
        top: 60px;
        padding: 1rem 0;
        overflow: hidden;
    }
    
    .category-tabs {
        gap: 0.5rem;
        padding: 0 1rem 0.5rem;
        margin: 0 -1rem;
        overflow-x: auto;
        scroll-snap-type: x mandatory;
        scrollbar-width: none; /* Firefox */
        -ms-overflow-style: none; /* IE and Edge */
        display: flex;
        flex-wrap: nowrap;
    }
    
    /* Hide scrollbar for Chrome, Safari and Opera */
    .category-tabs::-webkit-scrollbar {
        display: none;
    }
    
    .category-tab {
        padding: 0.5rem 1rem;
        font-size: 0.8rem;
        flex-shrink: 0;
        scroll-snap-align: start;
        min-width: fit-content;
    }
    
    .category-tab i {
        font-size: 0.875rem;
    }
    
    /* FAQ Content Mobile */
    .faq-content {
        padding: 3rem 0;
    }
    
    .faq-wrapper {
        padding: 0 1rem;
    }
    
    .category-title {
        font-size: 1.25rem;
        margin-bottom: 1.5rem;
        padding-bottom: 0.75rem;
    }
    
    .category-title i {
        font-size: 1.125rem;
    }
    
    /* FAQ Items Mobile */
    .faq-item {
        margin-bottom: 0.75rem;
    }
    
    .faq-question {
        font-size: 0.9rem;
        padding: 1rem;
        gap: 0.5rem;
    }
    
    .faq-question i {
        font-size: 0.75rem;
    }
    
    .faq-question[aria-expanded="true"] + .faq-answer {
        padding: 0 1rem 1rem;
    }
    
    .faq-answer {
        font-size: 0.875rem;
    }
    
    .faq-answer p {
        line-height: 1.6;
        margin-bottom: 0.75rem;
    }
    
    .faq-answer ul,
    .faq-answer ol {
        margin: 0.75rem 0;
        padding-left: 1.25rem;
    }
    
    .faq-answer li {
        margin-bottom: 0.375rem;
        font-size: 0.875rem;
    }
    
    /* CTA Section Mobile */
    .faq-cta {
        padding: 3rem 0;
    }
    
    .cta-content {
        padding: 0 1rem;
    }
    
    .cta-title {
        font-size: 1.5rem;
        margin-bottom: 0.75rem;
    }
    
    .cta-text {
        font-size: 1rem;
        margin-bottom: 1.5rem;
    }
    
    .cta-buttons {
        flex-direction: column;
        align-items: center;
    }
    
    .btn-primary,
    .btn-secondary {
        width: 100%;
        max-width: 300px;
        justify-content: center;
        font-size: 0.9rem;
    }
    
    /* Hero Shapes Mobile */
    .shape-1 {
        width: 100px;
        height: 100px;
    }
    
    .shape-2 {
        width: 80px;
        height: 80px;
    }
    
    .shape-3 {
        width: 60px;
        height: 60px;
    }
}

/* Extra Small Devices */
@media (max-width: 480px) {
    .faq-hero {
        padding: 5rem 0 2rem;
    }
    
    .faq-title {
        font-size: 1.75rem;
    }
    
    .faq-subtitle {
        font-size: 0.75rem;
    }
    
    .faq-description {
        font-size: 0.9rem;
    }
    
    .category-tab {
        padding: 0.375rem 0.75rem;
        font-size: 0.75rem;
    }
    
    .category-title {
        font-size: 1.125rem;
    }
    
    .faq-question {
        font-size: 0.875rem;
    }
}

/* Loading State */
.faq-loading {
    text-align: center;
    padding: 3rem;
    color: var(--text-light);
}

.faq-loading i {
    font-size: 2rem;
    color: var(--primary-color);
    animation: spin 1s linear infinite;
}

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