/* ============================================================
   ELITE EXAM PORTAL — UNIFIED SPA STYLESHEET
   All page styles merged & namespaced under #page-* selectors
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;600;700&family=Orbitron:wght@700&display=swap');

/* ============= GLOBAL RESET & SPA CORE ============= */
* { margin: 0; padding: 0; box-sizing: border-box; }
body { margin: 0; overflow-x: hidden; }
.spa-page { display: none; }
.spa-page.active { display: block; }
#page-instruction.active,
#page-test.active,
#page-result.active { display: flex; }

/* Smooth page transitions */
.spa-page { animation: spaFadeIn 0.3s ease-out; }
@keyframes spaFadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* ============= PAGE: HOME (Login/Register) ============= */
#page-home {
    background: #eef4ff;
    min-height: 100vh;
    font-family: "Poppins", sans-serif;
}

#page-home .navbar {
    background: #002b5c;
    padding: 18px 0;
}
#page-home .navbar-brand {
    font-size: 42px;
    font-weight: 800;
    letter-spacing: 2px;
    color: #ffdd00 !important;
    display: flex;
    align-items: center;
    gap: 12px;
    text-transform: uppercase;
}
#page-home .logo-icon {
    font-size: 48px;
    color: #ffdd00;
    text-shadow: 0 0 8px rgba(255,255,255,0.6);
}
#page-home .navbar-nav .nav-link {
    color: #ffffff !important;
    font-size: 15px;
    font-weight: 500;
    margin-left: 12px;
}
#page-home .navbar-nav .nav-link:hover {
    color: #ffdd00 !important;
    text-decoration: underline;
}
#page-home .hero {
    text-align: center;
    padding: 90px 20px;
    background: linear-gradient(to right, #004aadcc, #0078ffcc),
    url("https://img.freepik.com/free-vector/online-education-isometric-illustration_23-2148570198.jpg") center/cover no-repeat;
    color: #fff;
}
#page-home .hero h1 { font-size: 48px; font-weight: 800; }
#page-home .hero p { font-size: 20px; opacity: 0.9; }

#page-home .card {
    border-radius: 18px;
    border: none;
    box-shadow: 0 0 18px rgba(0,0,0,0.15);
}
#page-home input,
#page-home select {
    height: 48px;
    border-radius: 10px !important;
    border: 1.4px solid #004aad;
}
#page-home input:focus,
#page-home select:focus {
    box-shadow: 0 0 10px rgba(0,75,173,0.5);
    border-color: #002b5c;
}
#page-home .home-btn {
    height: 48px;
    font-size: 18px;
    border-radius: 10px !important;
    font-weight: 600;
}
#page-home .card h3 { color: #002b5c; }

/* Tab Buttons */
#page-home .tab-buttons {
    display: flex;
    justify-content: space-between;
    border-radius: 12px;
    overflow: hidden;
    background: #e6edff;
}
#page-home .tab-btn {
    width: 50%; padding: 12px 0; border: none;
    font-weight: 600; background: transparent;
    color: #002b5c; cursor: pointer; transition: 0.2s;
    height: auto; font-size: 16px;
}
#page-home .tab-btn.active { background: #002b5c; color: #fff; }
#page-home .tab-content { display: none; animation: fadeTab 0.2s ease-in-out; }
#page-home .tab-content.active { display: block; }

/* Official Form */
#page-home .official-form .input-group-text {
    background: #002b5c; color: #fff;
    border-radius: 10px 0 0 10px;
    width: 48px; justify-content: center;
}
#page-home .official-form input,
#page-home .official-form select {
    border-radius: 0 10px 10px 0 !important;
}
#page-home .official-form input::placeholder { font-size: 14px; }
#page-home .official-form button { letter-spacing: 0.5px; }

@keyframes fadeTab {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Popup */
.popup-container {
    position: fixed; top: 0; left: 0;
    width: 100%; height: 100%;
    background: rgba(0,0,0,0.4);
    backdrop-filter: blur(5px);
    display: none; justify-content: center;
    align-items: center; z-index: 9999;
}
.popup-box {
    background-color: #fff; padding: 30px 50px;
    border-radius: 20px; text-align: center;
    box-shadow: 0 0 35px rgba(0,0,0,0.5);
    animation: popupFadeIn 0.2s ease-in-out;
    max-width: 90%;
}
.popup-box h2 {
    margin-bottom: 18px; font-size: 26px;
    font-weight: 700; color: #002b5c;
    word-wrap: break-word;
}
#popupBtn {
    padding: 10px 35px; font-size: 18px;
    font-weight: bold; background: #002b5c;
    border: none; color: #ffffff;
    border-radius: 10px; cursor: pointer;
    height: auto;
}
#popupBtn:hover { background: #0056b3; }
@keyframes popupFadeIn {
    from { transform: scale(0.6); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}

/* Loader (shared) */
.loader-container {
    position: fixed; top: 0; left: 0;
    width: 100%; height: 100%;
    background: rgba(255,255,255,0.9);
    backdrop-filter: blur(10px);
    display: none; justify-content: center;
    align-items: center; z-index: 10000;
    transition: 0.1s;
}
.loader-box {
    text-align: center; background: white;
    padding: 30px 50px; border-radius: 20px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.1);
}
.spinner {
    width: 60px; height: 60px;
    border: 5px solid #eef4ff;
    border-top: 5px solid #002b5c;
    border-radius: 50%; margin: 0 auto;
    animation: spin 1s linear infinite;
}
@keyframes spin { 0% { transform: rotate(0deg); } 100% { transform: rotate(360deg); } }


/* ============= PAGE: DASHBOARD ============= */
#page-dashboard {
    --primary: #6366f1; --dark: #0f172a; --bg: #f8fafc;
    background-color: var(--bg);
    font-family: 'Outfit', sans-serif;
    min-height: 100vh;
}
#page-dashboard .hero-section {
    background: linear-gradient(135deg, #6366f1 0%, #4f46e5 100%);
    color: white; padding: 60px 0;
    border-radius: 0 0 50px 50px; margin-bottom: 40px;
}
#page-dashboard .nav-pills .nav-link {
    color: rgba(255,255,255,0.7);
    background: rgba(255,255,255,0.1);
    margin: 0 10px; border-radius: 12px;
    font-weight: 600; transition: 0.3s;
}
#page-dashboard .nav-pills .nav-link.active {
    background: white; color: var(--primary);
    box-shadow: 0 10px 15px rgba(0,0,0,0.1);
}
#page-dashboard .glass-card {
    background: white; border-radius: 24px;
    padding: 30px; border: none;
    box-shadow: 0 10px 15px -3px rgba(0,0,0,0.05);
    height: 100%;
}
#page-dashboard .digital-num {
    font-family: 'Orbitron', sans-serif;
    font-size: 3rem; color: var(--primary);
    text-shadow: 0 0 10px rgba(99,102,241,0.2);
}
#page-dashboard .digital-label {
    text-transform: uppercase; letter-spacing: 2px;
    font-weight: 700; color: #94a3b8; font-size: 0.8rem;
}
#page-dashboard .profile-img {
    width: 120px; height: 120px; border-radius: 50%;
    object-fit: cover; border: 4px solid white;
    box-shadow: 0 4px 10px rgba(0,0,0,0.1);
}
#page-dashboard .chart-container {
    position: relative; height: 300px; width: 100%;
}
#page-dashboard .logout-btn {
    position: absolute; top: 20px; right: 20px;
    background: rgba(255,255,255,0.2); color: white;
    border: none; padding: 8px 20px; border-radius: 50px;
    font-weight: 600; transition: 0.3s;
    backdrop-filter: blur(5px); cursor: pointer;
}
#page-dashboard .logout-btn:hover {
    background: #f43f5e; color: white;
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(244,63,94,0.4);
}


/* ============= PAGE: SUBJECTS ============= */
#page-subjects {
    --primary: #6366f1; --secondary: #4f46e5;
    --accent: #f43f5e; --bg: #f8fafc;
    --card-bg: rgba(255,255,255,0.95);
    font-family: 'Outfit', sans-serif;
    background: linear-gradient(135deg, #eef2ff 0%, #f8fafc 100%);
    color: #1e293b; min-height: 100vh;
    scroll-behavior: smooth;
}
#page-subjects .navbar-dashboard {
    background: white; padding: 18px 0;
    box-shadow: 0 4px 6px -1px rgba(0,0,0,0.05);
    position: sticky; top: 0; z-index: 1000;
}
#page-subjects .subjects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px; padding: 40px 0;
}
#page-subjects .subject-card {
    background: var(--card-bg); border-radius: 24px;
    padding: 35px; text-align: center;
    transition: all 0.6s cubic-bezier(0.16,1,0.3,1), opacity 0.6s ease-out, transform 0.6s cubic-bezier(0.16,1,0.3,1);
    border: 1px solid rgba(255,255,255,0.3);
    box-shadow: 0 10px 15px -3px rgba(0,0,0,0.05);
    position: relative; overflow: hidden;
    opacity: 0; transform: translateY(30px);
}
#page-subjects .subject-card.revealed { opacity: 1; transform: translateY(0); }
#page-subjects .subject-card::before {
    content: ''; position: absolute;
    top: 0; left: 0; width: 100%; height: 6px;
    background: var(--primary);
}
#page-subjects .subject-card:hover {
    transform: translateY(-12px);
    box-shadow: 0 20px 25px -5px rgba(0,0,0,0.1);
}
#page-subjects .subject-card i { font-size: 3rem; margin-bottom: 20px; display: block; }
#page-subjects .subject-card h3 { font-size: 1.5rem; font-weight: 700; margin-bottom: 15px; color: #0f172a; }
#page-subjects .subject-card p { font-size: 0.95rem; color: #64748b; line-height: 1.6; margin-bottom: 25px; }
#page-subjects .card-buttons { display: flex; flex-direction: column; gap: 12px; }
#page-subjects .card-buttons button {
    width: 100%; padding: 12px; border: none;
    border-radius: 12px; font-weight: 600;
    background: var(--primary); color: white;
    cursor: pointer; transition: 0.3s; height: auto;
}
#page-subjects .card-buttons button:hover { background: var(--secondary); transform: scale(1.02); }
#page-subjects .card-buttons a { text-decoration: none; font-weight: 600; color: var(--primary); font-size: 0.9rem; transition: 0.3s; }
#page-subjects .card-buttons a:hover { color: var(--secondary); text-decoration: underline; }

/* Subject card color variants */
#page-subjects .subject-card.red i { color: #f43f5e; }
#page-subjects .subject-card.red::before { background: #f43f5e; }
#page-subjects .subject-card.blue i { color: #3b82f6; }
#page-subjects .subject-card.blue::before { background: #3b82f6; }
#page-subjects .subject-card.green i { color: #10b981; }
#page-subjects .subject-card.green::before { background: #10b981; }
#page-subjects .subject-card.yellow i { color: #f59e0b; }
#page-subjects .subject-card.yellow::before { background: #f59e0b; }
#page-subjects .subject-card.purple i { color: #8b5cf6; }
#page-subjects .subject-card.purple::before { background: #8b5cf6; }
#page-subjects .subject-card.sky i { color: #0ea5e9; }
#page-subjects .subject-card.sky::before { background: #0ea5e9; }
#page-subjects .subject-card.orange i { color: #f97316; }
#page-subjects .subject-card.orange::before { background: #f97316; }
#page-subjects .subject-card.indigo i { color: #6366f1; }
#page-subjects .subject-card.indigo::before { background: #6366f1; }
#page-subjects .subject-card.dark i { color: #1e293b; }
#page-subjects .subject-card.dark::before { background: #1e293b; }
#page-subjects .subject-card.brown i { color: #78350f; }
#page-subjects .subject-card.brown::before { background: #78350f; }
#page-subjects .subject-card.pink i { color: #ec4899; }
#page-subjects .subject-card.pink::before { background: #ec4899; }
#page-subjects .subject-card.teal i { color: #14b8a6; }
#page-subjects .subject-card.teal::before { background: #14b8a6; }

/* Subjects mobile */
@media (max-width: 768px) {
    #page-subjects .subjects-grid { grid-template-columns: 1fr; gap: 20px; padding: 20px 0; }
    #page-subjects .subject-card { padding: 25px; border-radius: 20px; margin-bottom: 10px; }
    #page-subjects .subject-card i { font-size: 2.5rem; margin-bottom: 15px; }
    #page-subjects .subject-card h3 { font-size: 1.25rem; margin-bottom: 10px; }
    #page-subjects .subject-card p { font-size: 0.9rem; margin-bottom: 20px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
    #page-subjects .card-buttons { flex-direction: row; justify-content: center; gap: 10px; }
    #page-subjects .card-buttons button { width: auto; padding: 8px 20px; font-size: 0.9rem; }
    #page-subjects .card-buttons a { display: flex; align-items: center; }
}
@media (max-width: 480px) {
    #page-subjects .subject-card { min-height: 220px; display: flex; flex-direction: column; justify-content: center; padding: 20px; }
    #page-subjects .card-buttons { margin-top: auto; }
    #page-subjects .subjects-grid { padding: 10px 0; gap: 15px; }
}


/* ============= PAGE: INSTRUCTION ============= */
#page-instruction {
    font-family: "Poppins", sans-serif;
    background: linear-gradient(135deg, #4facfe, #00f2fe);
    justify-content: center; align-items: center;
    min-height: 100vh;
}
#page-instruction .instr-container { width: 100%; max-width: 650px; }
#page-instruction .instr-card {
    background: white; padding: 40px;
    border-radius: 18px;
    box-shadow: 0px 0px 20px rgba(0,0,0,0.2);
    text-align: center;
}
#page-instruction .instr-card h1 { font-size: 36px; margin-bottom: 10px; color: #00509e; font-weight: 800; }
#page-instruction .instr-card h3 { font-size: 22px; margin-bottom: 20px; color: #333; }
#page-instruction .instruction-list { text-align: left; font-size: 18px; line-height: 1.7; color: #444; margin-bottom: 32px; }
#page-instruction .instr-btn {
    width: 100%; padding: 15px;
    background: #007bff; border: none;
    color: white; font-size: 22px;
    border-radius: 10px; cursor: pointer;
    transition: 0.3s; font-weight: 600;
}
#page-instruction .instr-btn:hover { background: #005cbf; }


/* ============= PAGE: TEST ============= */
#page-test {
    font-family: 'Outfit', sans-serif;
    background: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 100%);
    min-height: 100vh; justify-content: center;
    align-items: center; color: #1e293b;
}
#page-test .test-container {
    background: white; width: 90%; max-width: 800px;
    padding: 50px; border-radius: 30px;
    box-shadow: 0 20px 50px rgba(0,0,0,0.1);
    position: relative;
    border: 1px solid rgba(255,255,255,0.3);
}
#page-test .test-container h1 {
    font-size: 2rem; font-weight: 700;
    color: #0f172a; margin-bottom: 30px; text-align: center;
}
#page-test #test-loader { text-align: center; font-weight: 600; color: #6366f1; }
#page-test #question-text {
    font-size: 1.4rem; font-weight: 600;
    line-height: 1.5; margin-bottom: 25px; color: #334155;
}
#page-test #options { display: grid; gap: 15px; }
#page-test .option-item {
    background: #f1f5f9; padding: 18px 25px;
    border-radius: 16px; cursor: pointer;
    transition: 0.3s; border: 2px solid transparent;
}
#page-test .option-item:hover { background: #e2e8f0; transform: translateX(10px); }
#page-test .option-item label { cursor: pointer; display: block; font-weight: 500; width: 100%; }
#page-test .option-item input[type="radio"] { margin-right: 15px; transform: scale(1.2); accent-color: #6366f1; }
#page-test .controls { display: flex; justify-content: space-between; margin-top: 40px; }
#page-test .test-btn {
    padding: 12px 30px; border-radius: 12px;
    border: none; font-weight: 700; cursor: pointer;
    transition: 0.3s; text-transform: uppercase; letter-spacing: 1px;
}
#page-test #prevBtn { background: #cbd5e1; color: #475569; }
#page-test #prevBtn:hover { background: #94a3b8; }
#page-test #nextBtn { background: #6366f1; color: white; }
#page-test #nextBtn:hover { background: #4f46e5; box-shadow: 0 4px 15px rgba(99,102,241,0.4); }
#page-test #submitBtn {
    background: #10b981; color: white;
    width: 100%; margin-top: 30px;
    font-size: 1.1rem; padding: 15px;
    border-radius: 12px; border: none;
    font-weight: 700; cursor: pointer;
    transition: 0.3s; text-transform: uppercase; letter-spacing: 1px;
}
#page-test #submitBtn:hover { background: #059669; transform: scale(1.02); }


/* ============= PAGE: RESULT ============= */
#page-result {
    background: linear-gradient(135deg, #e0f2fe 0%, #f0f9ff 100%);
    font-family: 'Outfit', sans-serif;
    min-height: 100vh;
    align-items: center; justify-content: center;
    color: #0f172a; padding: 20px;
}
#page-result .result-card {
    background: white; border-radius: 40px;
    padding: 50px; width: 100%; max-width: 600px;
    box-shadow: 0 25px 50px -12px rgba(0,0,0,0.1);
    text-align: center;
    border: 1px solid rgba(0,0,0,0.05);
}
#page-result .digital-score {
    font-family: 'Orbitron', sans-serif;
    font-size: 5rem; color: #0369a1;
    text-shadow: 2px 2px 0px rgba(14,165,233,0.1);
    margin: 20px 0;
}
#page-result .chart-box { width: 250px; height: 250px; margin: 0 auto 30px; }
#page-result .btn-action {
    padding: 15px 30px; border-radius: 15px;
    font-weight: 700; text-transform: uppercase;
    letter-spacing: 1px; transition: 0.3s; border: none;
}
#page-result .btn-dashboard { background: #0ea5e9; color: white; }
#page-result .btn-dashboard:hover { background: #0284c7; transform: scale(1.03); color: white; }
#page-result .btn-subject { background: #f0f9ff; color: #0369a1; border: 2px solid #bae6fd !important; }
#page-result .btn-subject:hover { background: #e0f2fe; }


/* ============= SHARED: FOOTER ============= */
.spa-footer {
    background: #0f172a; color: #94a3b8;
    padding: 60px 0 30px 0; margin-top: 80px;
}
.spa-footer h5 { color: white; }
.spa-footer a.feedback-link {
    display: inline-block;
}
