/* --- 1. Reset & Main Background --- */
body {
    background-color: #0d1b2a;
    background-image: 
        radial-gradient(circle at 10% 90%, rgba(45, 156, 153, 0.6) 0%, transparent 40%),
        radial-gradient(circle at 90% 10%, rgba(30, 85, 170, 0.6) 0%, transparent 50%);
    color: white;
    font-family: sans-serif;
    margin: 0;
    min-height: 100vh;
    display: flex;
    justify-content: center; 
    align-items: center;
    overflow-x: hidden;
}

/* --- 2. Portal Wrapper --- */
.portal-wrapper {
    display: flex;
    flex-direction: column; /* Text aur Buttons upar niche ayen */
    justify-content: center; 
    align-items: center;
    width: 100vw;
    min-height: 100vh;
    padding: 20px;
    box-sizing: border-box;
}

/* --- 3. SIDEBAR REMOVED --- */
/* Sidebar ka section yahan se khatam kar diya gaya hai taake layout center rahe */

.QuestionCard{
    width: 80%;
    display: flex;
    justify-content: center;
    flex-direction: column;
}

.header-flex {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.Logout {
    /* Base color jo aapne manga tha */
    background-color: #df1717;
    /* background-image: 
        radial-gradient(circle at 10% 90%, rgba(45, 156, 153, 0.6) 0%, transparent 40%),
        radial-gradient(circle at 90% 10%, rgba(30, 85, 170, 0.6) 0%, transparent 50%); */
    color: white !important;
    border: 1px solid rgba(255, 255, 255, 0.1) !important;
    padding: 10px 25px !important;
    border-radius: 8px !important;
    cursor: pointer !important;
    font-weight: 600 !important;
    transition: all 0.3s ease !important;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3) !important;
    width: 200px;
    margin: 30px auto 0 auto; /* Card ke niche center karne ke liye */
    display: block;
}

.Logout:hover {
    background-color: #49d6d199;
    transform: translateY(-2px) !important;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.4) !important;
    filter: brightness(1.3) !important;
}

/* --- 4. Content Area --- */
.content-area {
    width: 100%;
    max-width: 500px; /* Card ki munasib width */
    display: flex;
    justify-content: center;
    flex-direction: column;
    align-items: center;
    margin: auto;
    text-align: center;
    
}

.subjects {
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 15px;
    padding: 50px;
    border-radius: 10px; 
    box-shadow: 0 0 20px rgba(0,0,0,0.5); 
    /* margin: auto;  */
    
    background: radial-gradient(circle at 50% 100%, #152d35 0%, #0d0f11 60%, #090a0b 100%);
}

/* Welcome Text ko center karo */
#welcome-text {
    margin-bottom: 30px;
    text-align: center;
    font-size: 24px;
    width: 100%;
}


/* --- 6. Quiz Box Styling --- */
#quiz-box, #result-box {
    width: 550px; 
    max-width: 90%;
    
    background: radial-gradient(circle at 50% 100%, #152d35 0%, #0d0f11 60%, #090a0b 100%);
    padding: 30px; 
    border-radius: 10px; 
    box-shadow: 0 0 20px rgba(0,0,0,0.5); 
    margin: auto; 
}

/* --- 7. Login & Signup Containers --- */
#login-box, #signup-box {
    background: radial-gradient(circle at 50% 100%, #152d35 0%, #0d0f11 60%, #090a0b 100%);
    padding: 30px; 
    border-radius: 10px; 
    width: 400px; 
    text-align: center; 
    box-shadow: 0 0 20px rgba(0,0,0,0.5); 
}

/* --- 8. UI Elements & Buttons --- */
input { 
    width: 90%; 
    padding: 12px; 
    margin: 10px 0; 
    border-radius: 5px; 
    border: 1px solid #333; 
    background: #1a1a1a99; 
    color: white; 
}



button { 
    width: 100%; 
    padding: 12px; 
    background: #2D9C9999; 
    border: none; 
    color: white; 
    font-weight: bold; 
    cursor: pointer; 
    border-radius: 5px; 
    margin-top: 10px; 
    transition: 0.3s;
}


button:hover { background: #2D9C99; }
button:disabled {  background: #49d6d199;  cursor: not-allowed; }

/* Quiz Specifics */
.timer { font-size: 26px; color: #ff4444; margin-bottom: 15px; font-weight: bold; text-align: center; }
.question { font-size: 20px; margin-bottom: 25px; text-align: left; line-height: 1.4; }

/* Options Styling */
.options label {
    display: flex;
    align-items: center;
    padding: 15px;
    margin-bottom: 12px;
    border-radius: 8px;
    cursor: pointer;
    background-color: #1a1a1a99; 
    transition: background-color 0.3s ease;
}

.options input[type="radio"]:checked + span, 
.options label:has(input[type="radio"]:checked) {
    background-color: #2D9C99 !important; 
    color: white;
}

.options label:hover {
    background-color: rgba(45, 156, 153, 0.2);
}

/* Utility */
.hidden { display: none !important; }

/* Result Screen Main Container */
#result-screen {
    width: 700px;
    max-width: 95%;
    margin: auto;
}

/* Achievement Banner */
.achievement-banner {
    background: linear-gradient(90deg, #f2994a, #f2c94c);
    color: #fff;
    padding: 15px 25px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 20px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.3);
}

/* Main Result Card */
.result-card {
    background: radial-gradient(circle at 50% 100%, #152d35 0%, #0d0f11 60%, #090a0b 100%);
    padding: 40px;
    border-radius: 15px;
    text-align: center;
    position: relative;
    box-shadow: 0 20px 40px rgba(0,0,0,0.5);
}

.status-badge {
    position: absolute;
    top: 20px;
    right: 20px;
    background: rgba(45, 156, 153, 0.2);
    color: #49d6d1;
    padding: 5px 15px;
    border-radius: 20px;
    font-size: 14px;
    border: 1px solid #2d9c99;
}

/* Stats Grid */
.stats-row {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
    margin: 30px 0;
    padding: 20px 0;
    border-top: 1px solid #ffffff10;
}

.stat-box span { display: block; font-size: 12px; color: #aaa; margin-bottom: 5px; }
.stat-box strong { font-size: 24px; color: #fff; }

/* Score Distribution */
.score-distribution {
    display: flex;
    align-items: center;
    gap: 30px;
    background: rgba(255,255,255,0.03);
    padding: 20px;
    border-radius: 10px;
}

.progress-container {
    flex-grow: 1;
    height: 12px;
    background: #222;
    border-radius: 10px;
    overflow: hidden;
}

.progress-bar {
    height: 100%;
    background: #2d9c99; 
    width: 0%; 
    transition: width 1s ease-in-out;
}

.percentage-display h1 { font-size: 48px; margin: 0; color: #fff; }
.percentage-display p { font-size: 14px; color: #888; margin: 0; }

/* Footer */
.result-footer {
    margin-top: 30px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.footer-btns { display: flex; gap: 10px; }

.btn-outline {
    background: transparent;
    border: 1px solid #2d9c99;
    width: auto;
    padding: 10px 20px;
    color: white;
    cursor: pointer;
}

.btn-solid {
    background: #2d9c99;
    width: auto;
    padding: 10px 20px;
    color: white;
    cursor: pointer;
}

/* --- MOBILE RESPONSIVE QUERIES --- */

@media screen and (max-width: 768px) {
    /* 1. Body ko grid bana do taake har cheez dead center rahe */
    body {
        display: grid;
        place-items: center;
        padding: 20px 10px;
        height: auto;
        min-height: 100vh;
        overflow-x: hidden;
    }

    /* 2. Wrapper ko column mein set karo */
    .portal-wrapper {
        flex-direction: column;
        width: 100%;
        height: auto;
        justify-content: center;
        align-items: center;
        gap: 20px;
    }

    /* Subject Selection Card (Welcome Screen) Fix */
.sidebar, .subject-selection-container {
    width: 95% !important; /* Width kam ki taake sides par gap aaye */
    max-width: 450px !important;
    margin: 0 auto !important; /* Horizontally center */
    padding: 20px !important;
    box-sizing: border-box;
    
    /* Agar aapne pehle position fixed di thi, to ise use karein */
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    
    border-radius: 15px; /* Corners ko smooth karne ke liye */
}

/* Buttons ke darmiyan thoda gap aur side space */
.sidebar button, .subject-btn {
    width: 100% !important;
    margin-bottom: 15px !important;
    display: block !important;
}

    /* 3. Sidebar (Dashboard) Fix */

    @media screen and (max-width: 768px) {
    /* Jab quiz-box active ho to sidebar ke andar ke buttons hide kar do */
    .portal-wrapper:has(#quiz-box:not(.hidden)) .sidebar .subjects {
        display: none !important;
    }

    /* Agar aap poora sidebar header (Welcome Sameer) bhi hatana chahte hain 
       to is rule ko use karein: */
    .portal-wrapper:has(#quiz-box:not(.hidden)) .sidebar {
        display: none !important;
    }
}

    /* 4. Sare Boxes (Login, Signup, Quiz, Result) */
    #login-box, #signup-box, #quiz-box, #result-screen, .result-card {
    width: 95% !important;
    max-width: 500px; 
    padding: 20px !important;
    box-sizing: border-box;

    /* SIRF LOCATION FIX: Isse card top-bottom se ek dum barabar center ho jayega */
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    margin: 0 !important; 
}

    /* 5. Result Stats Grid (2x2 Layout) */
    .stats-row {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 15px;
        border: none;
    }

    /* 6. Performance Summary & Progress Bar */
    .performance-grid {
        grid-template-columns: 1fr !important; /* Stack horizontally to vertically */
        text-align: center;
    }

    .score-distribution {
        flex-direction: column;
        gap: 10px;
    }

    /* 7. Footer Buttons Full Width */
    .result-footer {
        flex-direction: column;
        gap: 15px;
    }

    .footer-btns {
        width: 100%;
        flex-direction: column;
        gap: 10px;
    }

    .btn-outline, .btn-solid {
        width: 100% !important;
        margin: 0;
    }

    /* Input fields and labels optimization */
    input, .options label {
        width: 100% !important;
        box-sizing: border-box;
    }
}

/* --- Options Styling Fix --- */
.options label {
    display: flex !important;
    align-items: center !important; /* Dot aur text ko vertically center rakhega */
    justify-content: flex-start !important; /* Content ko left se start karega */
    padding: 15px 20px !important;
    margin-bottom: 12px !important;
    border-radius: 8px !important;
    cursor: pointer !important;
    background-color: rgba(255, 255, 255, 0.05) !important;
    transition: 0.2s !important;
    width: 100% !important;
    box-sizing: border-box !important;
}

/* Dot (Radio Button) ki setting */
.options input[type="radio"] {
    margin: 0 15px 0 0 !important; /* Sirf right side par gap rakho */
    width: 10px !important;
    height: 10px !important;
    cursor: pointer !important;
    flex-shrink: 0 !important; /* Dot ko chota hone se rokega */
}

/* Options ke andar jo text hai uski alignment */
.options span, .options label {
    text-align: left !important;
    font-size: 16px !important;
    line-height: 1.2 !important;
}

/* Hover effect */
.options label:hover {
    background-color: rgba(255, 255, 255, 0.1) !important;
}

