/* Inherit branding variables from styles.css */
body {
    background-color: var(--blue-light);
}

.prakriti-page {
    padding-top: 140px;
    padding-bottom: 80px;
}

/* Instruction Box */
.instruction-box {
    background-color: #fff3cd;
    border: 1px solid #ffeeba;
    border-left: 5px solid var(--peach);
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 40px;
    color: #856404;
}

.instruction-box h4 {
    color: #856404;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 10px;
}

/* Quiz Grid Layout */
/* 1. Remove padding from the container */
.quiz-header {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr 1fr;
    background-color: var(--green);
    color: var(--white);
    /* padding: 15px;  <-- REMOVED THIS CAUSE OF ERROR */
    border-radius: 8px 8px 0 0;
    font-weight: 600;
    font-family: var(--font-secondary);
    letter-spacing: 1px;
}

/* 2. Add padding to the cells instead (New Rule) */
.quiz-header div {
    padding: 15px; /* Matches .feature-cell and .option-cell padding */
    display: flex;
    align-items: center; /* Vertically centers the text */
    line-height: 1.4;
}

.quiz-row {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr 1fr;
    background-color: var(--white);
    border-bottom: 1px solid #eee;
    transition: background-color 0.2s;
}

.quiz-row:nth-child(even) {
    background-color: #fafafa;
}

.quiz-row.error {
    border: 1px solid #e74c3c;
    background-color: #fdedee;
    animation: shake 0.5s ease-in-out;
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    10%, 30%, 50%, 70%, 90% { transform: translateX(-5px); }
    20%, 40%, 60%, 80% { transform: translateX(5px); }
}

.feature-cell {
    padding: 15px;
    font-weight: 600;
    color: var(--sapphire);
    border-right: 1px solid #eee;
    display: flex;
    align-items: center;
}

.option-cell {
    padding: 15px;
    border-right: 1px solid #eee;
    cursor: pointer;
    position: relative;
    transition: background-color 0.2s ease;
}

.option-cell:hover {
    background-color: var(--green-tint);
}

.option-label {
    display: block;
    cursor: pointer;
    font-size: 14px;
    color: var(--text-color);
    line-height: 1.4;
}

.option-input {
    position: absolute;
    opacity: 0;
    cursor: pointer;
    height: 0;
    width: 0;
}

.option-input:checked + .option-label {
    color: var(--green);
    font-weight: 700;
}

.option-cell:has(.option-input:checked) {
    background-color: rgba(12, 151, 42, 0.1);
    box-shadow: inset 0 0 0 2px var(--green);
}

.form-action {
    margin-top: 40px;
    text-align: center;
}

/* --- Result Modal Styles (Refined for Scrollbar) --- */
.result-modal {
    display: none;
    position: fixed;
    z-index: 2000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.6);
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(5px);
}

/* The Frame */
.result-content {
    background-color: var(--white);
    border-radius: 20px;
    text-align: center;
    max-width: 550px;
    width: 90%;
    position: relative;
    box-shadow: 0 15px 40px rgba(0,0,0,0.25);
    display: flex;
    flex-direction: column;
    overflow: hidden; /* Clips the scrollbar of the child to rounded corners */
    max-height: 90vh;
}

/* The Green Top Bar */
.result-content::before {
    content: "";
    display: block;
    height: 8px;
    background: var(--green);
    width: 100%;
    flex-shrink: 0; /* Prevents it from shrinking */
}

/* The Scrollable Area */
.modal-scroll-area {
    padding: 40px;
    overflow-y: auto; /* Scrollbar appears here */
    flex: 1; /* Takes up remaining space */
}

.close-result {
    position: absolute;
    top: 15px;
    right: 15px;
    background: var(--white);
    border: none;
    font-size: 24px;
    color: var(--text-color-light);
    cursor: pointer;
    z-index: 10;
    width: 35px;
    height: 35px;
    border-radius: 50%;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    display: flex;
    align-items: center;
    justify-content: center;
}

.result-header h3 {
    margin-top: 0;
    margin-bottom: 5px;
    color: var(--sapphire);
}

.result-header .subtitle {
    font-size: 14px;
    color: var(--text-color-light);
    margin-bottom: 30px;
}

/* Pie Chart Styles */
.chart-wrapper {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 40px;
    margin-bottom: 30px;
}

.pie-chart {
    width: 180px;
    height: 180px;
    border-radius: 50%;
    background: conic-gradient(#ddd 0% 100%);
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
    border: 5px solid #fff;
    outline: 1px solid #eee;
}

.chart-legend {
    display: flex;
    flex-direction: column;
    gap: 12px;
    text-align: left;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 12px;
}

.dot {
    width: 15px;
    height: 15px;
    border-radius: 4px;
    display: block;
}

.vata-dot { background-color: #a29bfe; }
.pitta-dot { background-color: #ff7675; }
.kapha-dot { background-color: #55efc4; }

.legend-text {
    display: flex;
    flex-direction: column;
    line-height: 1.2;
}

.l-name {
    font-weight: 700;
    color: var(--sapphire);
    font-size: 14px;
}

.l-percent {
    font-size: 13px;
    color: var(--text-color-light);
}

/* Verdict Box */
.verdict-box {
    background-color: var(--green-tint);
    padding: 15px;
    border-radius: 12px;
    margin-bottom: 20px;
    border: 1px solid var(--green);
}

.verdict-box p {
    font-size: 12px;
    text-transform: uppercase;
    font-weight: 600;
    color: var(--green-dark);
    margin-bottom: 5px;
}

#final-verdict {
    color: var(--green);
    font-size: 32px;
    margin-bottom: 0;
}

.modal-footer .btn i {
    margin-right: 10px;
}

/* Mobile Responsiveness */
@media (max-width: 768px) {
    .quiz-header { display: none; }
    
    .quiz-row {
        grid-template-columns: 1fr;
        margin-bottom: 20px;
        border: 1px solid #ddd;
        border-radius: 8px;
        overflow: hidden;
        box-shadow: 0 2px 5px rgba(0,0,0,0.05);
    }

    .feature-cell {
        background-color: var(--green-tint);
        border-bottom: 1px solid #ddd;
        border-right: none;
        justify-content: center;
        text-align: center;
    }

    .option-cell {
        border-bottom: 1px solid #eee;
        padding: 15px 20px;
    }
    
    .option-label::before {
        content: attr(data-dosha) ": ";
        font-weight: 600;
        color: var(--peach);
        display: inline-block;
        width: 60px;
    }

    /* Stack chart and legend on mobile */
    .chart-wrapper {
        flex-direction: column;
        gap: 20px;
    }
    
    .chart-legend {
        flex-direction: row;
        flex-wrap: wrap;
        justify-content: center;
        gap: 20px;
    }

    .modal-scroll-area {
        padding: 30px 20px; /* Less padding on mobile */
    }
}

/* --- Force Menu Bars Visibility --- */
.mobile-menu-btn {
    display: none; /* Hidden on desktop */
    cursor: pointer;
}

@media (max-width: 992px) {
    .mobile-menu-btn {
        display: block; /* Visible on mobile */
    }

    .mobile-menu-btn .bar {
        width: 25px;
        height: 3px;
        background-color: var(--sapphire); /* Uses your blue brand color */
        margin: 5px auto;
        transition: all 0.3s ease-in-out;
        display: block;
    }
    
    /* Animation for the X shape when active */
    .mobile-menu-btn.active .bar:nth-child(2) {
        opacity: 0;
    }
    .mobile-menu-btn.active .bar:nth-child(1) {
        transform: translateY(8px) rotate(45deg);
    }
    .mobile-menu-btn.active .bar:nth-child(3) {
        transform: translateY(-8px) rotate(-45deg);
    }
}