/* Media query for mobile devices */
@media (max-width: 768px) {
    #faq {
        width: 100% !important; /* Set full width */
        padding: 10px; /* Adjust padding as needed */
        margin: 0 auto; /* Centering might still be desired */
        box-sizing: border-box; /* Ensures padding does not add to the width */
    }

    #faq h2 {
        width: 100% !important; /* Set full width */
        margin: 0; /* Remove margins if necessary */
        padding: 10px 0; /* Optional: Add some vertical padding */
        box-sizing: border-box; /* Ensures padding does not add to the width */
    }

    #faq p {
        width: 100% !important; /* Set full width */
        margin: 10px 0; /* Adjust margins as needed */
        padding: 0 15px; /* Add horizontal padding for better text alignment */
        box-sizing: border-box; /* Ensures padding does not add to the width */
    }

    .faq-container {
        margin-top: 20px;
        display: flex;
        flex-direction: column;
        gap: 15px;
        width: 100% !important;
        margin: 0 auto; /* Center the FAQ container */
    }
}


#faq {
    text-align: center;
    padding: 20px;
    margin: auto;
    width: 80%;
}

#faq h2, #faq p {
    margin-bottom: 20px;
}

a {
    color: #ff7b00; /* Example color - adjust to match your site's theme */
    text-decoration: none; /* Removes underline - add it back on hover for clarity */
}
a:hover, a:focus {
    text-decoration: underline; /* Helps users recognize it as a clickable link */
    cursor: pointer;
}

.faq-container {
    margin-top: 20px;
    display: flex;
    flex-direction: column;
    gap: 15px;
    width: 90%;
    margin: 0 auto; /* Center the FAQ container */
    position: relative;
    z-index: 20;
}

.faq-item {
    background-color: #f9f9f9;
    border: 1px solid #ddd;
    border-radius: 5px;
    overflow: hidden;
    transition: max-height 0.3s ease-out, border-color 0.3s ease-out; /* Add transition for border color */
    cursor: pointer;
    box-shadow: 2px 2px 10px rgba(0, 0, 0, 0.1);
    position: relative;
    z-index: 20;
}

.faq-item:hover {
    border-color: #ff7b00; /* Change border color on hover */
}

.faq-question {
    padding: 15px;
    font-size: 18px;
    font-weight: bold;
    color: #333;
    position: relative;
    text-align: left; /* Align text to the left */
}

.faq-question::after {
    content: '\002B'; /* Plus sign */
    font-size: 24px;
    position: absolute;
    right: 20px;
    top: 50%;
    transform: translateY(-50%);
    color: #888;
    transition: transform 0.3s ease-out;
}

.faq-item.active .faq-question::after {
    content: '\2212'; /* Minus sign */
    transform: translateY(-50%) rotate(180deg);
}

.faq-answer {
    padding: 0px 20px 20px 20px; /* Add padding to match question */
    font-size: 16px;
    color: #666;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease-out;
    text-align: left; /* Align text to the left */
}

.faq-item.active .faq-answer {
    max-height: 200px; /* Adjust according to your content length */
}

/* Card Pile at Bottom of FAQ Section */
#faq {
    position: relative;
    padding-bottom: 20px; /* Make room for card pile */
}

.faq-card-pile {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 180px;
    pointer-events: none;
    overflow: visible;
    perspective: 1000px;
    z-index: -1;
}

.pile-card {
    position: absolute;
    bottom: 0;
    width: 160px;
    height: 220px;
    transform-origin: bottom center;
    transform-style: preserve-3d;
    transition: none; /* Remove default transition to prevent twitching */
}

/* Override analytics card styles for pile cards */
.faq-card-pile .analytics-card.pile-card {
    opacity: 0.95;
    position: absolute;
    bottom: 0;
    pointer-events: none;
}

.faq-card-pile .analytics-card .card-inner {
    height: 100%;
    font-size: 0.85em; /* Slightly smaller text for pile cards */
}

.faq-card-pile .analytics-card .card-content {
    padding: 8px;
}

.faq-card-pile .analytics-card .metric-value {
    font-size: 14px;
}

.faq-card-pile .analytics-card .big-value {
    font-size: 20px;
}

.faq-card-pile .analytics-card .card-title {
    font-size: 9px;
}

.faq-card-pile .analytics-card .card-subtitle {
    font-size: 8px;
}

.faq-card-pile .analytics-card .histogram {
    height: 60px;
    padding: 5px;
}

.faq-card-pile .analytics-card .plot-area {
    min-height: 80px;
}

/* Card pile - offset to left with varied orientations */
.pile-card-1 {
    left: -5%;
    transform: rotateX(78deg) rotateZ(-45deg) rotateY(15deg);
    z-index: 1;
}

.pile-card-2 {
    left: -2%;
    transform: rotateX(80deg) rotateZ(65deg) rotateY(-10deg);
    z-index: 3;
}

.pile-card-3 {
    left: 2%;
    transform: rotateX(82deg) rotateZ(-70deg) rotateY(5deg);
    z-index: 2;
}

.pile-card-4 {
    left: 5%;
    transform: rotateX(79deg) rotateZ(35deg) rotateY(-20deg);
    z-index: 4;
}

.pile-card-5 {
    left: 8%;
    transform: rotateX(81deg) rotateZ(-85deg) rotateY(12deg);
    z-index: 5;
}

.pile-card-6 {
    left: 10%;
    transform: rotateX(83deg) rotateZ(50deg) rotateY(-8deg);
    z-index: 3;
}

.pile-card-7 {
    left: 13%;
    transform: rotateX(77deg) rotateZ(-55deg) rotateY(18deg);
    z-index: 6;
}

.pile-card-8 {
    left: 15%;
    transform: rotateX(80deg) rotateZ(75deg) rotateY(-15deg);
    z-index: 2;
}

.pile-card-9 {
    left: 18%;
    transform: rotateX(82deg) rotateZ(-40deg) rotateY(10deg);
    z-index: 7;
}

.pile-card-10 {
    left: 20%;
    transform: rotateX(79deg) rotateZ(88deg) rotateY(-5deg);
    z-index: 4;
}

.pile-card-11 {
    left: 23%;
    transform: rotateX(81deg) rotateZ(-65deg) rotateY(22deg);
    z-index: 8;
}

.pile-card-12 {
    left: 25%;
    transform: rotateX(83deg) rotateZ(42deg) rotateY(-18deg);
    z-index: 5;
}

.pile-card-13 {
    left: 28%;
    transform: rotateX(78deg) rotateZ(-78deg) rotateY(8deg);
    z-index: 9;
}

.pile-card-14 {
    left: 30%;
    transform: rotateX(80deg) rotateZ(58deg) rotateY(-12deg);
    z-index: 3;
}

.pile-card-15 {
    left: 33%;
    transform: rotateX(82deg) rotateZ(-30deg) rotateY(15deg);
    z-index: 10;
}

.pile-card-16 {
    left: 35%;
    transform: rotateX(79deg) rotateZ(70deg) rotateY(-7deg);
    z-index: 6;
}

.pile-card-17 {
    left: 38%;
    transform: rotateX(81deg) rotateZ(-82deg) rotateY(20deg);
    z-index: 11;
}

.pile-card-18 {
    left: 40%;
    transform: rotateX(83deg) rotateZ(48deg) rotateY(-14deg);
    z-index: 4;
}

.pile-card-19 {
    left: 43%;
    transform: rotateX(77deg) rotateZ(-60deg) rotateY(11deg);
    z-index: 12;
}

.pile-card-20 {
    left: 45%;
    transform: rotateX(80deg) rotateZ(80deg) rotateY(-9deg);
    z-index: 7;
}

/* Add depth shadow effect for pile cards */
.faq-card-pile .analytics-card.pile-card {
    box-shadow: 
        0 2px 4px rgba(0, 0, 0, 0.1),
        0 8px 16px rgba(0, 0, 0, 0.1),
        0 16px 32px rgba(0, 0, 0, 0.1);
}

/* Adjust opacity based on z-index for depth effect */
.pile-card-1, .pile-card-2, .pile-card-3 {
    opacity: 0.85;
}

.pile-card-4, .pile-card-5, .pile-card-6, .pile-card-7 {
    opacity: 0.88;
}

.pile-card-8, .pile-card-9, .pile-card-10, .pile-card-11 {
    opacity: 0.91;
}

.pile-card-12, .pile-card-13, .pile-card-14, .pile-card-15 {
    opacity: 0.94;
}

.pile-card-16, .pile-card-17, .pile-card-18, .pile-card-19, .pile-card-20 {
    opacity: 0.82;
}


/* Mobile responsive */
@media (max-width: 768px) {
    #faq {
        padding-bottom: 40px;
    }
    
    /* Hide the entire card pile on mobile */
    .faq-card-pile {
        display: none;
    }
}
