/* FAQ Container */
.faq-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 40px 20px;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

/* FAQ Header */
.faq-header {
    margin-bottom: 50px;
}

.faq-title {
    font-size: 4rem;
    font-weight: 900;
    color: #000;
    margin: 0 0 10px 0;
    letter-spacing: 0.5rem;
    text-transform: uppercase;
}

.faq-subtitle {
    font-size: 1.1rem;
    color: #666;
    margin: 0;
    font-weight: 300;
}

/* Main FAQ Layout - Horizontal Flexbox */
.faq-layout {
    display: flex;
    gap: 60px;
    align-items: flex-start;
    justify-content: flex-start;
}

/* FAQ Grid Container - Left Side */
.faq-grid {
    flex-shrink: 0;
    display: grid;
    grid-template-columns: repeat(3, 150px);
    grid-template-rows: repeat(2, 150px);
    gap: 0;
    border: 2px solid #000;
    overflow: hidden;
}

/* FAQ Items - Individual Boxes */
.faq-item {
    width: 150px;
    height: 150px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    padding: 15px;
    box-sizing: border-box;
    position: relative;
    border: none;
}

/* Add internal borders */
.faq-item:not(:nth-child(3n)) {
    border-right: 2px solid #000;
}

.faq-item:nth-child(-n+3) {
    border-bottom: 2px solid #000;
}

/* Checkerboard Pattern Colors */
.faq-item:nth-child(1), /* Top Left - White */
.faq-item:nth-child(3), /* Top Right - White */
.faq-item:nth-child(5)  /* Bottom Middle - White */ {
    background: #ffffff;
    color: #000;
}

.faq-item:nth-child(2), /* Top Middle - Black */
.faq-item:nth-child(4), /* Bottom Left - Black */
.faq-item:nth-child(6)  /* Bottom Right - Black */ {
    background: #000000;
    color: #ffffff;
}

/* Hover and Active States */
.faq-item:hover {
    opacity: 0.8;
    transform: scale(0.98);
}

.faq-item.active {
    transform: scale(0.95);
    box-shadow: inset 0 0 0 3px #ff6b6b;
}

/* FAQ Question Text */
.faq-question {
    font-size: 0.85rem;
    font-weight: 600;
    text-align: center;
    margin: 0;
    line-height: 1.2;
    word-break: break-word;
    hyphens: auto;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Expanded Container - Right Side */
.faq-expanded-container {
    flex-shrink: 0;
}

.faq-expanded {
    background: #333333;
    color: #ffffff;
    width: 400px;
    height: 300px;
    border: 2px solid #000;
    padding: 30px;
    box-sizing: border-box;
    opacity: 0;
    transform: translateX(20px);
    transition: all 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    display: flex;
    flex-direction: column;
    position: relative;
}

.faq-expanded.show {
    opacity: 1;
    transform: translateX(0);
}

/* Expanded Content */
.faq-expanded-content {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
}

.faq-expanded-title {
    font-size: 1.8rem;
    font-weight: 900;
    color: #fff;
    margin: 0 0 5px 0;
    letter-spacing: 0.15rem;
    text-transform: uppercase;
}

.faq-expanded-subtitle {
    font-size: 0.8rem;
    color: #ccc;
    margin: 0 0 20px 0;
    font-weight: 300;
}

.faq-expanded-question {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 15px;
    line-height: 1.4;
    opacity: 0;
    transform: translateY(10px);
    transition: all 0.3s ease 0.1s;
    color: #fff;
}

.faq-expanded.show .faq-expanded-question {
    opacity: 1;
    transform: translateY(0);
}

.faq-expanded-answer {
    font-size: 0.85rem;
    line-height: 1.5;
    color: #e0e0e0;
    opacity: 0;
    transform: translateY(10px);
    transition: all 0.3s ease 0.2s;
    flex-grow: 1;
    overflow-y: auto;
}

.faq-expanded.show .faq-expanded-answer {
    opacity: 1;
    transform: translateY(0);
}

/* Default state - show placeholder */
.faq-expanded-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
    font-size: 1rem;
    color: #888;
    text-align: center;
}

.faq-expanded.show .faq-expanded-placeholder {
    display: none;
}

/* Override any Elementor or theme styles that might interfere */
.faq-container .faq-item h3.faq-question {
    all: unset;
    font-size: 0.85rem;
    font-weight: 600;
    text-align: center;
    margin: 0;
    line-height: 1.2;
    word-break: break-word;
    hyphens: auto;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: inherit;
}

/* Hide any content that might be outside the grid */
.faq-container > *:not(.faq-header):not(.faq-layout) {
    display: none !important;
}

/* Responsive Design */
@media (max-width: 1024px) {
    .faq-layout {
        flex-direction: column;
        gap: 40px;
        align-items: center;
    }
    
    .faq-expanded {
        width: 100%;
        max-width: 500px;
        transform: translateY(20px);
    }
    
    .faq-expanded.show {
        transform: translateY(0);
    }
}

@media (max-width: 768px) {
    .faq-grid {
        grid-template-columns: repeat(3, 120px);
        grid-template-rows: repeat(2, 120px);
    }
    
    .faq-item {
        width: 120px;
        height: 120px;
        padding: 10px;
    }
    
    .faq-question {
        font-size: 0.75rem;
    }
    
    .faq-title {
        font-size: 3rem;
        letter-spacing: 0.3rem;
    }
    
    .faq-expanded {
        height: 250px;
        padding: 25px;
    }
    
    .faq-expanded-title {
        font-size: 1.5rem;
    }
}

@media (max-width: 600px) {
    .faq-container {
        padding: 30px 15px;
    }
    
    .faq-layout {
        gap: 30px;
    }
    
    .faq-grid {
        grid-template-columns: repeat(3, 100px);
        grid-template-rows: repeat(2, 100px);
    }
    
    .faq-item {
        width: 100px;
        height: 100px;
        padding: 8px;
    }
    
    .faq-question {
        font-size: 0.7rem;
        line-height: 1.1;
    }
    
    .faq-title {
        font-size: 2.5rem;
        letter-spacing: 0.2rem;
    }
    
    .faq-expanded {
        height: 200px;
        padding: 20px;
    }
    
    .faq-expanded-title {
        font-size: 1.3rem;
    }
}

/* Loading Animation */
.faq-item {
    animation: fadeInScale 0.6s ease forwards;
    opacity: 0;
    transform: scale(0.8);
}

.faq-item:nth-child(1) { animation-delay: 0.1s; }
.faq-item:nth-child(2) { animation-delay: 0.2s; }
.faq-item:nth-child(3) { animation-delay: 0.3s; }
.faq-item:nth-child(4) { animation-delay: 0.4s; }
.faq-item:nth-child(5) { animation-delay: 0.5s; }
.faq-item:nth-child(6) { animation-delay: 0.6s; }

@keyframes fadeInScale {
    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* Scrollbar Styling */
.faq-expanded-answer::-webkit-scrollbar {
    width: 4px;
}

.faq-expanded-answer::-webkit-scrollbar-track {
    background: transparent;
}

.faq-expanded-answer::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.3);
    border-radius: 2px;
}

.faq-expanded-answer::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.5);
}