/* Robust Flex/Grid Layout for Quiz */

#question {
    width: 95%;
    max-width: 85%; /* Slightly wider as requested */
    min-height: 80px; 
    padding: 32px 48px; /* Generous padding for content isolation */
    background: rgba(255, 255, 255, 0.4); 
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    color: var(--text-main);
    display: none; 
    justify-content: center;
    align-items: center;
    text-align: center;
    font-size: 21px; /* Slightly larger for impact */
    font-weight: 600;
    line-height: 1.5;
    text-wrap: balance; /* Modern magic to prevent hanging words and balance lines */
    border: 1px solid rgba(255, 255, 255, 0.5); 
    border-radius: var(--border-radius-lg);
    margin: 30px auto; 
    flex: 0 0 auto;
    z-index: 10;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.04);
}

#ansGrid {
    width: 100%;
    padding: 16px 24px 60px 24px; /* Increased bottom padding to about 3x more space */
    display: none; /* Hidden by default */
    grid-template-columns: 1fr;
    grid-auto-rows: 1fr; /* Equal height rows */
    gap: 12px;
    flex: 1 1 auto; /* Take up remaining space */
    overflow-y: auto; /* Scroll if content overflows */
    margin: 0;
    /* Hide scrollbar */
    scrollbar-width: none;
}

@media (min-width: 1024px) {
    #question {
        max-width: 850px; /* 85% of 1000px container */
        margin-top: 50px;
        margin-bottom: 40px;
    }
    #ansGrid {
        max-width: 850px; 
        margin-left: auto;
        margin-right: auto;
    }
}

#ansGrid::-webkit-scrollbar {
    display: none;
}

.ans {
    width: 100%;
    padding: 16px 20px;
    border-radius: var(--border-radius-md);
    background: #ffffff;
    border: 1px solid #e5e5e7;
    cursor: pointer;
    font-size: 17px;
    font-weight: 400;
    color: var(--text-main);
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    box-shadow: 0 2px 8px rgba(0,0,0,0.02);
}

@media (hover: hover) {
    .ans:hover {
        border-color: var(--primary-color);
        background: #f0f7ff;
        transform: translateY(-2px);
        box-shadow: 0 4px 12px rgba(0, 122, 255, 0.08);
    }
}

.ans:active {
    transform: scale(0.98);
}

#indicator {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100vw;
    height: 8px; /* Slightly thicker for impact */
    background: #e5e5e7;
    margin: 0;
    overflow: hidden;
    display: none; /* Hidden by default */
    z-index: 2000; /* Above main but below modals if any */
}

#indicatorBall {
    height: 100%;
    background: var(--primary-gradient);
    transition: width 0.3s ease;
}

/* Media Queries for Small Screens */
@media (max-width: 480px) {
    #question {
        font-size: 15px;
        padding: 16px 16px;
        min-height: 60px;
    }
    #ansGrid {
        padding: 12px 16px 33px 16px;
    }
    .ans {
        padding: 12px 16px;
        font-size: 14px;
    }
}

@media (max-height: 600px) {
    #question {
        padding: 12px 16px;
        min-height: 50px;
        font-size: 14px;
    }
    .ans {
        padding: 10px 12px;
        font-size: 13px;
    }
    #ansGrid {
        padding: 8px 16px 33px 16px;
        gap: 8px;
    }
}

@media (min-width: 1024px) and (max-height: 600px) {
    #ansGrid {
        grid-template-columns: 1fr 1fr;
    }
}
