@import url('https://fonts.googleapis.com/css2?family=Cinzel:wght@700;800;900&family=Playfair+Display:wght@700;800;900&display=swap');

/* =========================================
   1. VARIABLES, RESET & SCROLLBAR
   ========================================= */
:root {
    --text-main: #334155; --text-light: #f8fafc; --text-muted: #94a3b8; --text-blueLight: #e5e1fc; --bg-dark: #0f172a;
    --blue: #38bdf8; --blue-strong: #86c1ff; --gold: #fbbf24; --goldBright: #ffca43; --green: #10b981; --red: #f43f5e; --teal: #2dd4bf; --amber: #f59e0b;
    --glass-bg: rgba(255, 255, 255, 0.15); --glass-border: rgba(255, 255, 255, 0.2); --glass-shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.37); --modal-bg: rgba(30, 41, 59, 0.95);
    --bg-play-state: running; --orb-display: block; --orb-speed-1: 35s; --orb-speed-2: 40s;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { height: 100%; background-color: #0f172a; }
body { font-family: 'Poppins', sans-serif; min-height: 100vh; overflow-x: hidden; width: 100%; color: var(--text-light); background-color: var(--bg-dark); }
:focus { outline: none; }
:focus-visible { outline: none; box-shadow: 0 0 10px rgba(255, 255, 255, 0.3); border-color: rgba(255, 255, 255, 0.8); }
input::-webkit-outer-spin-button, input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
input[type=number] { appearance: textfield; -moz-appearance: textfield; }
input:-webkit-autofill, input:-webkit-autofill:hover, input:-webkit-autofill:focus, input:-webkit-autofill:active { -webkit-text-fill-color: white; transition: background-color 9999999s ease-in-out 0s; box-shadow: none; -webkit-box-shadow: 0 0 0 30px rgba(0,0,0,0) inset; background-color: transparent; }

::-webkit-scrollbar { width: 18px; height: 12px; }
::-webkit-scrollbar-track { background: rgba(0, 0, 0, 0.2); border-left: 1px solid rgba(255, 255, 255, 0.05); }
::-webkit-scrollbar-thumb { background: rgba(176, 188, 206, 0.411); border-radius: 4px; border: 3px solid transparent; background-clip: content-box; }
::-webkit-scrollbar-thumb:hover { background-color: rgba(198, 183, 211, 0.603); }

/* =========================================
   2. BACKGROUND MODES & THEMES
   ========================================= */
body.home-mode { background: transparent; }
body.home-mode::before { content: ""; position: fixed; top: 0; left: 0; width: 100vw; height: 100vh; background-image: linear-gradient(-45deg, #0f172a, #1e1b4b, #060d2c, #062b4e); background-size: 400% 400%; animation: gradient var(--bg-duration, 15s) ease infinite var(--bg-play-state); z-index: -100; pointer-events: none; }
@keyframes gradient { 0% { background-position: 0% 50%; } 50% { background-position: 100% 50%; } 100% { background-position: 0% 50%; } }
body.quiz-mode { background-color: var(--bg-dark); background-image: radial-gradient(at 10% 10%, hsla(253,16%,7%,1) 0, transparent 50%), radial-gradient(at 50% 50%, rgb(67, 43, 94) 0, transparent 50%), radial-gradient(at 90% 90%, hsla(339,49%,30%,1) 0, transparent 50%); background-attachment: fixed; background-size: 100% 100%; padding-bottom: 100px; position: relative; z-index: 0; }
@media (min-width: 769px) { body.quiz-mode { background-image: radial-gradient(at 0% 100%, rgba(80, 39, 114, 0.6) 0, transparent 60%), radial-gradient(at 100% 0%, rgba(80, 39, 114, 0.6) 0, transparent 60%); } body.quiz-mode::before, body.quiz-mode::after { content: ''; position: fixed; width: 45vw; height: 45vw; filter: blur(150px); z-index: -1; display: var(--orb-display); } body.quiz-mode::before { top: 10%; left: 10%; background: radial-gradient(circle, rgba(247, 217, 255, 0.7) 0%, transparent 30%); animation: hover-1 var(--orb-speed-1) ease-in-out infinite var(--bg-play-state); } body.quiz-mode::after { bottom: 10%; right: 10%; background: radial-gradient(circle, rgba(173, 228, 252, 0.7) 0%, transparent 30%); animation: hover-2 var(--orb-speed-2) ease-in-out infinite var(--bg-play-state); } }
@keyframes hover-1 { 0%, 100% { transform: translate(0, 0); } 33% { transform: translate(25vw, 5vh); } 66% { transform: translate(10vw, 25vh); } }
@keyframes hover-2 { 0%, 100% { transform: translate(0, 0); } 33% { transform: translate(-25vw, -5vh); } 66% { transform: translate(-10vw, -25vh); } }
body.immersive-mode .navbar, body.immersive-mode .nav-extension { display: none; }
body.immersive-mode .app-wrapper { padding-top: 0; }
.navbar, .nav-extension { transition: transform 0.3s ease, opacity 0.3s ease; }

/* =========================================
   3. GLOBAL UTILITIES & TYPOGRAPHY
   ========================================= */
.container { width: 90%; max-width: 800px; margin: 0 auto; padding: 20px; }
.center-screen { display: flex; flex-direction: column; justify-content: center; align-items: center; min-height: 85vh; padding: 20px 0; width: 100%; }
.fade-in { opacity: 0; animation: fadeIn 0.5s ease-in-out forwards; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }
.brand-title { font-family: 'Playfair Display', serif; letter-spacing: 2px; font-weight: 800; font-size: 3rem; }
.brand-subtitle { font-size: 1.1rem; opacity: 0.9; margin-bottom: 25px; }
.error-msg { background: rgba(255, 0, 0, 0.2); color: #fff; padding: 10px; border-radius: 8px; margin-top: 15px; font-weight: 600; border: 1px solid rgba(255,0,0,0.3); }
.placeholder-msg { padding: 40px; background: rgba(255,255,255,0.1); border-radius: 15px; margin-top: 20px; font-size: 1.1rem; }
body.home-mode strong { color: white; }
strong { color: var(--blue-strong); font-weight: 700; }
em { color: var(--gold); font-style: italic; font-weight: 500; }
u { text-decoration: none; border-bottom: 2px solid var(--text-muted); padding-bottom: 2px; color: white; }
kbd { display: inline-block; padding: 4px 8px; font-family: 'Consolas', 'Monaco', monospace; font-size: 0.9rem; font-weight: 700; line-height: 1; color: #f8fafc; vertical-align: middle; background-color: rgba(255, 255, 255, 0.1); border: 1px solid rgba(255, 255, 255, 0.3); border-radius: 6px; box-shadow: 0 4px 0 rgba(255, 255, 255, 0.1), 0 5px 10px rgba(0,0,0,0.2); margin: 0 2px; transition: all 0.1s; }
kbd:active { transform: translateY(4px); box-shadow: 0 0 0 rgba(255, 255, 255, 0.1); }
body[data-user-role="guest"] .report-btn { display: none; }

/* =========================================
   4. NAVBAR, MENUS & EXTENSIONS
   ========================================= */
.navbar { height: 70px; position: sticky; top: 0; z-index: 2000; background: rgba(15, 23, 42, 0.6); backdrop-filter: blur(15px); border-bottom: 1px solid var(--glass-border); display: flex; align-items: center; justify-content: space-between; padding: 0 5%; }
.nav-brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: white; font-weight: 700; font-size: 1.5rem; }
.nav-brand span { text-align: center; line-height: 1.1; display: inline-block; text-wrap: balance; font-family: 'Cinzel', serif; letter-spacing: 1px; font-weight: 700; }
.brand-logo {
   height: 60px;
   width: auto;
   object-fit: contain;
   margin-right: 5px;
   filter: drop-shadow(1px -1px 2px rgba(255, 255, 255, 0.3)) brightness(1.09);
   transition: all 0.3s ease;
}

.nav-menu { display: flex; gap: 5px; height: 100%; align-items: center; margin-left: 50px; margin-right: 50px; }
.nav-link { text-decoration: none; color: rgb(231, 244, 255); padding: 10px 18px; border-radius: 20px; font-weight: 600; transition: 0.3s; font-size: 1.1rem; cursor: pointer; letter-spacing: 0.3px; white-space: nowrap; display: inline-flex; align-items: center; justify-content: center; }
.nav-link:hover { color: white; background: rgba(255,255,255,0.1); }
.nav-link.active { background: rgba(255,255,255,0.2); color: white; font-weight: 700; box-shadow: 0 4px 15px rgba(0,0,0,0.1); }
.guest-auth-btns { display: flex; align-items: center; gap: 12px; margin-left: auto; }
.guest-auth-btns .nav-link { border-radius: 20px; padding: 8px 20px; font-size: 0.95rem; border: 1px solid rgba(255,255,255,0.2); background: rgba(255,255,255,0.05); backdrop-filter: blur(5px); }
/* --- Enterprise Shimmer Animation for Sign Up --- */
.guest-auth-btns .btn-signup { 
   color: white; 
   position: relative;
   overflow: hidden;
   border-color: rgba(56, 189, 248, 0.4); /* Subtle blue border default */
   z-index: 1;
}

/* The light sweep element */
.guest-auth-btns .btn-signup::before {
   content: '';
   position: absolute;
   top: 0; 
   left: -150%;
   width: 100%; 
   height: 100%;
   background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
   transform: skewX(-20deg);
   /* SMOOTHER FIX: Increased to 7 seconds, using ease-in-out for a natural glide */
   animation: enterpriseShimmer 7s infinite ease-in-out;
   z-index: -1;
}

@keyframes enterpriseShimmer {
   0% { left: -150%; }
   30% { left: 150%; } /* Takes ~2.1 seconds to sweep across smoothly */
   100% { left: 150%; } /* Rests gracefully before sweeping again */
}
.guest-auth-btns .btn-signup:hover { 
   background: rgba(255, 255, 255, 0.15); 
   border-color: var(--blue); 
   box-shadow: 0 4px 15px rgba(56, 189, 248, 0.2); 
   color: white; 
   transform: translateY(-2px); 
}

.btn-login { color: rgba(255,255,255,0.8); }
.btn-login:hover { background: rgba(255, 255, 255, 0.1); border-color: rgba(255, 255, 255, 0.4); color: white; transform: translateY(-2px); }

.nav-profile { position: relative; display: flex; align-items: center; gap: 10px; cursor: pointer; margin-left: 20px; }
.profile-img-wrapper { width: 50px; height: 50px; border-radius: 50%; border: 2px solid rgba(255, 255, 255, 0.3); overflow: hidden; flex-shrink: 0; }
.profile-img { width: 100%; height: 100%; object-fit: cover; transform: scale(1.1); }
.profile-info { display: flex; flex-direction: column; align-items: flex-end; justify-content: center; line-height: 1.2; text-align: right; margin-right: 12px; }
.profile-main-text { font-size: 0.9rem; color: white; font-weight: 600; max-width: 150px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.profile-sub-text { font-size: 0.7rem; color: var(--blue); text-transform: uppercase; font-weight: 700; letter-spacing: 0.5px; opacity: 0.9; }

.dropdown-menu { display: none; position: absolute; top: 55px; right: 0; width: 240px; background: rgba(15, 23, 42, 0.85); backdrop-filter: blur(20px); border: 1px solid rgba(255, 255, 255, 0.1); border-top: 1px solid rgba(255, 255, 255, 0.2); border-radius: 16px; padding: 10px; box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5); flex-direction: column; gap: 4px; z-index: 2500; }
.dropdown-menu.show { display: flex; }
.dd-item { padding: 10px 15px; color: #dce8f5; text-decoration: none; font-size: 0.9rem; border-radius: 8px; transition: 0.2s; display: flex; align-items: center; gap: 12px; }
.dd-item:hover { background: rgba(255,255,255,0.1); color: white; }
.dd-item.danger { color: var(--red); border-top: 1px solid rgba(255,255,255,0.1); margin-top: 5px; }

.exam-dropdown { top: 50px; left: 50%; transform: translateX(-50%); width: 220px; }

.nav-extension { width: 100%; background: rgb(56 60 69 / 39%); backdrop-filter: blur(15px); border-bottom: 1px solid rgba(56,189,248,0.3); padding: 10px 5%;
   position: sticky; top: 70px; z-index: 900; display: flex; justify-content: space-between; align-items: center; box-shadow: 0 10px 30px rgba(0,0,0,0.2); }

.nav-extension h2 { margin: 0; font-size: 1.1rem; font-weight: 600; color: rgb(245, 240, 255); position: absolute; left: 50%; transform: translateX(-50%); text-align: center; white-space: nowrap; text-transform: uppercase; }
.nav-extension .back-link { color: rgba(255,255,255,0.7); text-decoration: none; font-size: 0.9rem; display: flex; align-items: center; gap: 5px; transition: 0.2s; }
.nav-extension .back-link:hover { color: white; }

.mobile-toggle { display: none; background: none; border: none; color: white; cursor: pointer; align-items: center; justify-content: center; padding: 8px; margin-right: 5px; border-radius: 8px; transition: background 0.2s; }
.mobile-toggle:hover { background: rgba(255, 255, 255, 0.05); }
.theme-toggle-btn-quiz { display: inline-flex; align-items: center; justify-content: center; gap: 8px; }

/* Navbar Responsiveness */
@media (min-width: 1401px) {
   .mobile-toggle { display: none; }
   .nav-menu { position: static; transform: none; flex: 1; justify-content: center; margin-left: 20px; margin-right: 20px; gap: clamp(2px, 0.5vw, 5px); }
   .nav-link { padding: 10px clamp(8px, 1.2vw, 18px); }
}
@media (max-width: 1400px) {
    .mobile-toggle { display: flex; }
    .nav-menu { display: none; }
    .nav-brand { position: absolute; left: 50%; transform: translateX(-50%); white-space: nowrap; }
    .profile-info { display: flex; }
    .nav-menu.mobile-open { display: flex; position: absolute; top: 70px; left: 0; width: 100%; height: auto; margin: 0; background: rgba(61, 67, 82, 0.986); backdrop-filter: blur(20px); border-bottom: 1px solid rgba(255, 255, 255, 0.1); box-shadow: 0 20px 50px rgba(0,0,0,0.5); flex-direction: column; gap: 10px; z-index: 1999; }
    .nav-menu.mobile-open .nav-link { width: 100%; text-align: center; padding: 15px; border-radius: 0; background: transparent; font-size: 1rem; border-bottom: 1px solid rgba(255,255,255,0.05); }
    .nav-dropdown-container { width: 100%; display: block; }
    .exam-dropdown { position: static; transform: none; width: 100%; box-shadow: none; border: none; border-radius: 0; background: rgba(0, 0, 0, 0.15); margin-top: 0px; padding-bottom: 10px; display: flex; flex-direction: column; align-items: center; }
    .exam-dropdown .dd-item { justify-content: flex-start; width: 190px; padding-left: 20px; }
    body[data-user-role="guest"] .nav-brand { position: static; transform: none; margin-right: auto; }
}
@media (max-width: 1000px) { .profile-info { display: none; } }
@media (max-width: 900px) { .quiz-theme-text { display: none; } .theme-toggle-btn-quiz { padding: 0; width: 40px; height: 40px; border-radius: 50%; } }
@media (max-width: 600px) { .nav-brand { position: absolute; left: 50%; transform: translateX(-50%); margin: 0; } .nav-brand span { display: none; } .brand-logo { height: 60px; } .mobile-toggle { margin-right: 10px; } }
@media (max-width: 500px) { .guest-auth-btns .btn-login { display: none; } .badge { display: none; } .level-tag { display: none; } .header-divider { display: none; } #admin-shortcuts .badge { display: inline-flex; } }

/* =========================================
   5. SHARED UI: CARDS, MODALS, BUTTONS & FORMS
   ========================================= */
.glass-card, .main-card { background: var(--glass-bg); backdrop-filter: blur(12px); max-width: 1100px; border: 1px solid var(--glass-border); border-radius: 20px; padding: 2rem; box-shadow: var(--glass-shadow); text-align: center; color: white; width: 100%; margin-bottom: 20px; }
.center-screen .glass-card { max-width: 400px; width: 90%; margin: 0 auto; }
@media (max-width: 1100px) { .center-screen .glass-card { max-width: 400px; width: 95%; margin: 0 auto; } .glass-card, .main-card { padding: 2rem 1rem; } }
@media (max-width: 600px) { .center-screen .glass-card { max-width: 400px; width: 98%; margin: 0 auto; } .glass-card, .main-card { padding: 2rem 0.3rem; } }

/* Modals & Loaders */
.modal-overlay { display: none; position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0, 0, 0, 0.7); backdrop-filter: blur(5px); z-index: 9999; justify-content: center; align-items: center; animation: fadeIn 0.2s ease; }
.modal-overlay.open { display: flex; }
.glass-modal { background: var(--modal-bg); border: 1px solid var(--glass-border); border-top: 1px solid rgba(255,255,255,0.3); box-shadow: 0 20px 50px rgba(0,0,0,0.5); padding: 30px; border-radius: 20px; width: 90%; max-width: 400px; text-align: center; color: white; }
.glass-modal h3 { margin-bottom: 15px; font-size: 1.4rem; }
.glass-modal p { font-size: 0.95rem; color: #cbd5e1; margin-bottom: 25px; line-height: 1.5; }
.glass-textarea { width: 100%; height: 100px; background: rgba(0, 0, 0, 0.3); border: 1px solid rgba(255, 255, 255, 0.1); border-radius: 10px; padding: 10px; color: white; font-family: 'Poppins', sans-serif; margin-bottom: 20px; resize: none; }
.glass-textarea:focus { outline: none; border-color: var(--blue); }
.modal-actions { display: flex; gap: 15px; justify-content: center; }
.glass-toast { position: fixed; top: 0; left: 50%; transform: translate(-50%, -150%); background: rgba(255, 255, 255, 0.25); backdrop-filter: blur(12px); border: 1px solid rgba(255, 255, 255, 0.5); color: white; box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1); padding: 12px 25px; border-radius: 50px; font-weight: 600; font-size: 0.95rem; display: flex; align-items: center; gap: 10px; z-index: 10000; transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275); text-shadow: 0 1px 3px rgba(0, 0, 0, 0.2); }
.glass-toast.show { transform: translate(-50%, 70px); }
.glass-toast.dark-mode { background: rgba(8, 21, 53, 0.644); border: 1px solid rgba(255, 255, 255, 0.15); box-shadow: 0 10px 40px rgba(22, 21, 26, 0.6); color: #f8fafc; }
@media (max-width: 600px) { .glass-toast { width: 90%; justify-content: center; white-space: normal; text-align: center; z-index: 10000; } }

#global-loader { position: fixed; top: 0; left: 0; width: 100%; height: 100%; background-color: var(--bg-dark); z-index: 20000; display: flex; justify-content: center; align-items: center; opacity: 0; pointer-events: none; transition: opacity 0.2s ease; }
#global-loader.show { opacity: 1; pointer-events: all; }
.spinner { width: 50px; height: 50px; border: 4px solid rgba(255, 255, 255, 0.1); border-top: 4px solid var(--blue); border-radius: 50%; animation: spin 1s linear infinite; }
@keyframes spin { 0% { transform: rotate(0deg); } 100% { transform: rotate(360deg); } }

/* TRUE GLASSMORPHISM BUTTONS */
.start-btn { padding: 15px 30px; border-radius: 12px; background: rgba(255, 255, 255, 0.05); backdrop-filter: blur(12px); border: 1px solid var(--glass-border); border-top: 1px solid rgba(255, 255, 255, 0.4); color: white; cursor: pointer; font-weight: 600; letter-spacing: 0.5px; transition: all 0.3s ease; box-shadow: -2px 1px 8px rgba(0, 0, 0, 0.2); text-decoration: none; display: inline-block; font-family: 'Poppins', sans-serif; flex: 1 0 auto; }
.start-btn:hover { background: rgba(255, 255, 255, 0.1); border-color: rgba(255, 255, 255, 0.6); transform: translateY(-2px); box-shadow: 0 0 15px rgba(56, 189, 248, 0.3); color: white; }
.start-btn:active { transform: translateY(0); box-shadow: 0 0 5px rgba(56, 189, 248, 0.2); }
#dict-form .start-btn, #owq-form .start-btn { flex: 0 0 auto; width: auto; min-width: 0; }
@media (max-width: 400px) { #dict-form .start-btn, #owq-form .start-btn { flex: 1 0 auto; width: 100%; } }

.btn-primary { background: rgba(255, 255, 255, 0.05); border: 1px solid rgba(255, 255, 255, 0.2); color: white; padding: 12px 25px; border-radius: 30px; cursor: pointer; font-weight: 600; transition: all 0.3s ease; text-decoration: none; display: inline-block; }
.btn-primary:hover { background: rgba(255, 255, 255, 0.1); transform: translateY(-2px); box-shadow: 0 0 15px rgba(255, 255, 255, 0.15); border-color: rgba(255, 255, 255, 0.4); }

.btn-previous, .btn-next { background: rgba(255, 255, 255, 0.05); border: 1px solid rgba(255, 255, 255, 0.2); color: white; padding: 12px 25px; border-radius: 30px; cursor: pointer; font-weight: 600; transition: all 0.3s ease; text-decoration: none; display: inline-block; }
.btn-previous:hover { background: rgba(255, 255, 255, 0.1); transform: translateY(-2px); box-shadow: 0 0 15px rgba(255, 255, 255, 0.15); border-color: rgba(255, 255, 255, 0.4); }
.btn-next:hover { background: rgba(255, 255, 255, 0.1); transform: translateY(-2px); box-shadow: 0 0 15px rgba(255, 255, 255, 0.15); border-color: rgba(255, 255, 255, 0.4); }

.btn-secondary { background: rgba(255, 255, 255, 0.05); border: 1px solid rgba(255, 255, 255, 0.2); color: white; padding: 12px 25px; border-radius: 30px; cursor: pointer; font-weight: 600; transition: all 0.3s ease; text-decoration: none; display: inline-block; }
.btn-secondary:hover { background: rgba(255, 255, 255, 0.1); transform: translateY(-2px); box-shadow: 0 0 15px rgba(255, 255, 255, 0.15); border-color: rgba(255, 255, 255, 0.4); }

.nav-control-btn { padding: 12px 25px; border-radius: 30px; border: 1px solid rgba(255,255,255,0.2); background: rgba(255,255,255,0.05); color: white; font-weight: 600; cursor: pointer; transition: all 0.3s ease; font-family: 'Poppins', sans-serif; }
.nav-control-btn:hover { background: rgba(255,255,255,0.1); transform: translateY(-2px); box-shadow: 0 0 15px rgba(255, 255, 255, 0.15); border-color: rgba(255,255,255,0.4); }
.nav-control-btn.disabled { opacity: 0.5; cursor: not-allowed; pointer-events: none; box-shadow: none; }

.submit-exam-btn { background: rgba(255, 255, 255, 0.05); color: white; border: 1px solid rgba(255, 255, 255, 0.2); padding: 10px 20px; border-radius: 30px; font-weight: 600; cursor: pointer; transition: all 0.3s ease; font-family: Arial, Helvetica, sans-serif; font-size: 14px;}
.submit-exam-btn:hover { background: rgba(255, 255, 255, 0.1); border-color: var(--blue); box-shadow: 0 0 15px rgba(56, 189, 248, 0.3); transform: translateY(-2px); }

.btn-exit-quiz { text-decoration: none; background: rgba(255, 255, 255, 0.05); color: rgb(231, 244, 255); padding: 12px 25px; border-radius: 10px; font-weight: 600; transition: all 0.3s ease; font-size: 1.1rem; cursor: pointer; letter-spacing: 0.3px; white-space: nowrap; display: inline-flex; align-items: center; justify-content: center; border: 1px solid rgba(255, 255, 255, 0.2); }
.btn-exit-quiz:hover { background: rgba(255, 255, 255, 0.1); transform: translateY(-2px); box-shadow: 0 0 15px rgba(255, 255, 255, 0.15); border-color: rgba(255,255,255,0.4); }

.btn-cancel { padding: 10px 20px; border-radius: 10px; border: 1px solid rgba(255, 255, 255, 0.2); background: rgba(255, 255, 255, 0.05); color: white; cursor: pointer; font-weight: 500; transition: all 0.3s ease; }
.btn-cancel:hover { background: rgba(255, 255, 255, 0.1); transform: translateY(-2px); box-shadow: 0 0 15px rgba(255, 255, 255, 0.15); }

.btn-submit { padding: 10px 20px; border-radius: 10px; border: 1px solid rgba(255, 255, 255, 0.2); background: rgba(255, 255, 255, 0.05); color: white; cursor: pointer; font-weight: 700; transition: all 0.3s ease; }
.btn-submit:hover { background: rgba(255, 255, 255, 0.1); border-color: var(--blue); transform: translateY(-2px); box-shadow: 0 0 15px rgba(56, 189, 248, 0.3); }

.fab-btn { position: fixed; bottom: 30px; right: 30px; width: 60px; height: 60px; border-radius: 30%; background: rgba(255, 255, 255, 0.1); border: 1px solid rgba(255,255,255,0.2); color: white; box-shadow: 0 10px 25px rgba(0,0,0,0.4); display: flex; align-items: center; justify-content: center; cursor: pointer; transition: all 0.3s ease; z-index: 1000; backdrop-filter: blur(10px); }
.fab-btn:hover { transform: scale(1.1) rotate(90deg); background: rgba(255, 255, 255, 0.2); color: var(--blue); box-shadow: 0 0 20px rgba(56, 189, 248, 0.3); border-color: var(--blue); }
@media (max-width: 600px) { .fab-btn { bottom: 20px; right: 20px; width: 50px; height: 50px; } }

.fav-btn { color: #94a3b8; transition: all 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275); }
.fav-btn:hover { color: var(--blue); transform: scale(1.1); }
.fav-btn.active svg { fill: var(--blue-strong); stroke: var(--blue-strong); }
.audio-btn.save-btn { color: #94a3b8; transition: all 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275); }
.audio-btn.save-btn:hover { color: var(--gold); transform: scale(1.1); }
.audio-btn.save-btn.active svg { fill: var(--gold); stroke: var(--gold); }

.focus-btn { background: none; border: none; cursor: pointer; color: #94a3b8; padding: 5px; display: inline-flex; align-items: center; justify-content: center; transition: 0.2s; }
.focus-btn:hover, .focus-active .focus-btn { color: var(--blue); }
.focus-active .brand-title, .focus-active .brand-subtitle, .focus-active .tab-description, .focus-active .nav-control-btn, .focus-active .nav-control-container, .focus-active .tip-text { display: none; }
.focus-active #study-card-container { margin-top: 10px; transition: margin 0.3s ease; }
@media (max-width: 600px) { .focus-active .glass-card { padding: 15px; margin-top: 0; } .focus-active { padding-top: 10px; } }

/* Inputs & Forms */
.input-group { display: flex; gap: 10px; margin: 1rem 0; max-width: 600px; margin-left: auto; margin-right: auto; flex-wrap: wrap; }
input, .custom-select { flex: 1; padding: 15px; border-radius: 12px; outline: none; background: rgba(255, 255, 255, 0.05); border: 1px solid var(--glass-border); border-top: 1px solid rgba(255, 255, 255, 0.4); color: white; font-family: 'Poppins', sans-serif; font-size: 1rem; box-shadow: 0 4px 10px rgba(0,0,0,0.1); transition: all 0.3s ease; }
input:focus, .custom-select:focus { background: rgba(255, 255, 255, 0.1); border-color: rgba(255, 255, 255, 0.9); box-shadow: 0 0 10px rgba(255,255,255,0.1); }
input::placeholder { color: rgba(255, 255, 255, 0.41); }
@media screen and (max-width: 768px) { input, .custom-select, .glass-input, textarea, select { font-size: 16px; } }
.glass-select { flex: 1; padding: 15px; border-radius: 12px; cursor: pointer; font-size: 1rem; color: white; background: rgba(255, 255, 255, 0.05); border: 1px solid var(--glass-border); border-top: 1px solid rgba(255, 255, 255, 0.4); box-shadow: 0 4px 10px rgba(0,0,0,0.1); display: flex; justify-content: space-between; align-items: center; position: relative; min-width: 200px; user-select: none; transition: all 0.2s ease; z-index: 10; }
.glass-select.open .glass-arrow { transform: rotate(180deg); }
.glass-options-list { display: none; position: absolute; top: 110%; left: 0; width: 100%; background: rgba(30, 41, 59, 0.288); backdrop-filter: blur(15px); border: 1px solid var(--glass-border); border-radius: 12px; padding: 5px; box-shadow: 0 10px 40px rgba(0,0,0,0.5); z-index: 1000; overflow: hidden; animation: fadeIn 0.2s ease; }
.glass-select.open .glass-options-list { display: block; }
.glass-option { padding: 12px 15px; border-radius: 8px; color: rgba(255,255,255,0.8); transition: all 0.2s; }
.glass-option:hover { background: rgba(255, 255, 255, 0.15); color: white; padding-left: 20px; }
.glass-select.disabled { opacity: 0.5; cursor: not-allowed; pointer-events: none; background: rgba(0, 0, 0, 0.2); border-color: rgba(255, 255, 255, 0.1); }
#tab-grammar .glass-options-list { background: rgba(15, 23, 42, 0.65); backdrop-filter: blur(20px); border: 1px solid rgba(255, 255, 255, 0.2); box-shadow: 0 15px 50px rgba(0, 0, 0, 0.8); }
#tab-grammar .glass-option:hover { background: rgba(45, 212, 191, 0.2); color: white; }
.form-checkbox-label { display: flex; align-items: center; gap: 10px; cursor: pointer; color: rgba(255,255,255,0.9); font-size: 0.9rem; user-select: none; }
.form-checkbox-input { display: none; }
.form-checkbox-custom { width: 20px; height: 20px; background: rgba(255, 255, 255, 0.1); border: 1px solid rgba(255, 255, 255, 0.4); border-radius: 6px; position: relative; transition: all 0.2s ease; }
.form-checkbox-label:hover .form-checkbox-custom { border-color: white; background: rgba(255,255,255,0.2); }
.form-checkbox-input:checked + .form-checkbox-custom { background: var(--blue); border-color: var(--blue); }
.form-checkbox-input:checked + .form-checkbox-custom::after { content: ''; position: absolute; left: 6px; top: 2px; width: 6px; height: 10px; border: solid white; border-width: 0 2px 2px 0; transform: rotate(45deg); }
.password-wrapper { position: relative; width: 100%; }
.password-wrapper input { width: 100%; padding-right: 45px; }
.password-toggle-btn { position: absolute; right: 12px; top: 50%; transform: translateY(-50%); background: none; border: none; padding: 0; color: rgba(255, 255, 255, 0.5); cursor: pointer; display: flex; align-items: center; justify-content: center; transition: color 0.2s; z-index: 10; }
.password-toggle-btn:hover { color: var(--blue); }

/* Modal specific modifications */
.modal-role-text { color: var(--blue); }
.glass-modal-danger { border-color: var(--red); }
.danger-title { color: var(--red); }
.del-user-name-text { color: white; }
.danger-warning-box { background: rgba(244, 63, 94, 0.1); padding: 10px; border-radius: 8px; margin-bottom: 20px; border: 1px solid rgba(244, 63, 94, 0.3); }
.danger-warning-text { font-size: 0.85rem; color: #fda4af; margin: 0; }
.modal-actions .btn-danger { background: var(--red); border-color: var(--red); color: white; }
.modal-actions .btn-danger:hover { box-shadow: 0 4px 15px rgba(244, 63, 94, 0.4); background: #e11d48; }

/* =========================================
   CRITICAL RESTORATIONS (SHARED GLOBALS)
   ========================================= */
/* 1. Icons & Text Colors (Dictionary, Random Study, Drills) */
.audio-btn, .focus-btn, .report-btn { background: none; border: none; cursor: pointer; color: #94a3b8; padding: 5px; display: inline-flex; align-items: center; justify-content: center; transition: 0.2s; }
.audio-btn:hover, .focus-btn:hover { color: var(--blue); transform: scale(1.1); }
.audio-btn.loading { animation: pulse 1s infinite; color: var(--blue); }
.report-btn:hover { color: var(--red); transform: scale(1.1); }
.fav-btn { color: #94a3b8; transition: all 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275); }
.fav-btn:hover { color: var(--blue); transform: scale(1.1); }
.fav-btn.active svg { fill: var(--blue-strong); stroke: var(--blue-strong); }
.audio-btn.save-btn { color: #94a3b8; transition: all 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275); }
.audio-btn.save-btn:hover { color: var(--gold); transform: scale(1.1); }
.audio-btn.save-btn.active svg { fill: var(--gold); stroke: var(--gold); }
.focus-active .focus-btn { color: var(--blue); }

.text-green { color: var(--green) !important; }
.text-red { color: var(--red) !important; }
.text-faded { color: rgba(255,255,255,0.6) !important; }
.text-muted { color: #27a1c7 !important; }

/* 2. Options Grid (Lessons, Quiz, Exams) */
.options-grid { display: flex; flex-direction: column; gap: 12px; counter-reset: option-counter; }
.glass-option-btn { width: 100%; text-align: left; background: rgba(255, 255, 255, 0.05); border: 1px solid rgba(255, 255, 255, 0.2); color: rgba(255, 255, 255, 0.9); padding: 18px; border-radius: 15px; cursor: pointer; font-size: 1.05rem; transition: all 0.3s ease; margin-bottom: 12px; font-weight: 500; position: relative; padding-left: 50px; display: flex; align-items: center; }
.glass-option-btn::before { counter-increment: option-counter; content: counter(option-counter, upper-alpha) "."; position: absolute; left: 15px; font-weight: 800; font-size: 1.1rem; color: #f1fbffe5; opacity: 0.8; }
.glass-option-btn:hover::before, .glass-option-btn.selected::before { color: white; opacity: 1; }
.glass-option-btn:hover { background: rgba(255, 255, 255, 0.1); transform: translateX(5px); border-color: rgba(255, 255, 255, 0.4); box-shadow: 0 0 15px rgba(255, 255, 255, 0.15); }
.glass-option-btn.correct { background-color: rgba(16, 185, 129, 0.1) !important; border: 1px solid rgba(16, 185, 129, 0.5) !important; color: #6ee7b7 !important; box-shadow: 0 0 15px rgba(16, 185, 129, 0.3) !important; }
.glass-option-btn.wrong { background-color: rgba(244, 63, 94, 0.1) !important; border: 1px solid rgba(244, 63, 94, 0.5) !important; color: #fda4af !important; box-shadow: 0 0 15px rgba(244, 63, 94, 0.3) !important; }
.glass-option-btn.selected { background: rgba(56, 189, 248, 0.1); border-color: rgba(56, 189, 248, 0.5); color: white; box-shadow: 0 0 15px rgba(56, 189, 248, 0.3); }

.explanation-box { margin-top: 20px; padding: 20px; border-radius: 16px; background: rgba(30, 41, 59, 0.8); border: 1px solid rgba(45, 212, 191, 0.3); border-left: 4px solid var(--teal); color: rgba(255, 255, 255, 0.9); font-size: 0.95rem; line-height: 1.6; opacity: 0; transform: translateY(-10px); transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275); }
.explanation-box.reveal, .explanation-box.admin-visible { display: block; animation: revealExp 0.5s forwards; opacity: 1; transform: translateY(0); }
.explanation-box.admin-visible { border-color: rgba(251, 191, 36, 0.6); box-shadow: 0 0 15px rgba(251, 191, 36, 0.1); }
.explanation-box.admin-visible .exp-header { color: var(--gold); }
.exp-header { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; color: var(--teal); font-weight: 700; text-transform: uppercase; font-size: 0.8rem; letter-spacing: 1px; }
.exp-content { color: #cbd5e1; font-family: 'Merriweather', serif; }
.exp-content p { display: block; margin-bottom: 12px; margin-top: 0; }
.exp-content ul { list-style: none; padding-left: 10px; }
.exp-content li { position: relative; padding-left: 25px; margin-bottom: 8px; }
.exp-content li::before { content: "❖"; position: absolute; left: 0; top: 0px; font-size: 1.1rem; color: var(--text-blueLight); }

/* 3. Alphabet Nav (Dictionary, Checklists) */
.alphabet-nav { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; margin-top: 30px; }
.letter-link { text-decoration: none; color: white; background: rgba(255,255,255,0.05); width: 32px; height: 32px; display: flex; align-items: center; justify-content: center; border-radius: 6px; font-weight: 500; border: 1px solid rgba(255,255,255,0.2); transition: all 0.3s ease; }
.letter-link:hover { background: rgba(255,255,255,0.15); color: white; transform: translateY(-5px); border-color: var(--blue); box-shadow: 0 0 10px rgba(56,189,248,0.3); }
.letter-link.active { background: rgba(56, 189, 248, 0.15); color: var(--blue); border-color: var(--blue); box-shadow: inset 0px 0px 10px 0px rgba(56, 189, 248, 0.2); }

/* 4. Mock Exams List */
.mock-card { background: rgba(255,255,255,0.05); border: 1px solid rgba(255,255,255,0.1); border-left: 4px solid #a78bfa; padding: 20px; border-radius: 12px; display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 15px; }

/* 5. Admin Overlays & Tables (Profile, Dashboard, Maintainer) */
.profile-card-large { background: rgba(255, 255, 255, 0.05); backdrop-filter: blur(15px); border: 1px solid rgba(255, 255, 255, 0.2); border-radius: 24px; width: 90%; max-width: 1100px; overflow: hidden; position: relative; box-shadow: -9px 0px 17px 1px rgb(0 0 0 / 20%); margin: 20px auto; }
.profile-grid { display: grid; grid-template-columns: 280px 1fr 1fr; min-height: 450px; }
.p-col { padding: 30px; display: flex; flex-direction: column; justify-content: center; }
.p-col-left { background: rgba(0, 0, 0, 0.2); border-right: 1px solid rgba(255,255,255,0.1); align-items: center; text-align: center; }
.p-avatar-box { width: 200px; height: 300px; border-radius: 24px; border: 3px solid var(--blue); padding: 5px; background: rgba(56, 189, 248, 0.1); margin-bottom: 20px; box-shadow: 0 10px 30px rgba(56, 189, 248, 0.2); }
.p-avatar { width: 100%; height: 100%; border-radius: 18px; object-fit: cover; object-position: top center; image-rendering: high-quality; transform: translateZ(0); }
.p-role { font-size: 1.1rem; font-weight: 700; text-transform: uppercase; color: var(--blue); letter-spacing: 2px; }
.p-col-mid { border-right: 1px solid rgba(255,255,255,0.1); }
.p-section-title { color: var(--blue); font-size: 1.3rem; font-weight: 800; margin-bottom: 25px; text-transform: uppercase; letter-spacing: 0.5px; }
.p-row { display: flex; justify-content: space-between; margin-bottom: 18px; font-size: 0.95rem; align-items: flex-start; gap: 15px; }
.p-label { color: rgba(255, 255, 255, 0.6); font-weight: 600; white-space: nowrap; }
.p-val { color: white; font-weight: 500; text-align: right; font-family: 'Poppins', sans-serif; word-break: break-all; line-height: 1.2; }
.p-divider { height: 2px; background: rgba(255, 255, 255, 0.1); margin: 25px 0; width: 50%; }

.edit-overlay { position: absolute; top: 0; left: 0; width: 100%; height: 100%; background: rgb(43 52 73); backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px); display: none; align-items: center; justify-content: center; z-index: 50; opacity: 0; transition: opacity 0.3s ease; border-radius: 24px; }
.edit-overlay.open { display: flex; opacity: 1; }
.edit-content-wrapper { width: 100%; max-width: 700px; margin: auto; animation: zoomIn 0.3s ease; color: white; }
.edit-content-wrapper > h2 { margin-bottom: 30px; text-align: center; color: white; }
.edit-content-wrapper p { color: #98a2b7; }
.edit-label { display: block; font-size: 0.8rem; color: rgba(255, 255, 255, 0.7); margin-bottom: 8px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.5px; text-align: left; }
.edit-row { margin-bottom: 20px; }
.edit-grid-row { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; margin-bottom: 30px; width: 100%; }
.edit-col { display: flex; flex-direction: column; min-width: 0; }
.glass-input-wide { width: 100%; padding: 15px; border-radius: 12px; background: rgba(255, 255, 255, 0.05); border: 1px solid rgba(255, 255, 255, 0.2); color: white; font-family: 'Poppins', sans-serif; font-size: 1rem; outline: none; transition: 0.3s ease; color-scheme: dark; }
.glass-input-wide:focus { background: rgba(255, 255, 255, 0.1); border-color: rgba(255, 255, 255, 0.8); box-shadow: 0 0 15px rgba(255, 255, 255, 0.2); }
.edit-buttons-row { display: flex; gap: 20px; width: 100%; margin-top: 10px; background: transparent; border: none; box-shadow: none; height: auto; }
.edit-buttons-row .btn-secondary, .edit-buttons-row .start-btn { flex: 1; width: 100%; height: 50px; font-size: 1rem; border-radius: 12px; display: flex; align-items: center; justify-content: center; box-shadow: none; background-image: none; }
.edit-buttons-row .start-btn:hover { border-color: var(--blue); color: white; box-shadow: 0 0 15px rgba(56, 189, 248, 0.3); }
.btn-glassy-profile { width: 100%; margin-top: auto; background: rgba(255, 255, 255, 0.05); border: 1px solid rgba(255, 255, 255, 0.2); color: white; padding: 12px 0; border-radius: 12px; font-weight: 600; cursor: pointer; transition: all 0.3s ease; text-align: center; text-transform: uppercase; font-size: 0.9rem; letter-spacing: 1px; }
.btn-glassy-profile:hover { background: rgba(255, 255, 255, 0.1); border-color: rgba(255,255,255,0.4); transform: translateY(-3px) scale(1.02); box-shadow: 0 0 15px rgba(255, 255, 255, 0.15); }
@media (max-width: 1100px) { .profile-grid { grid-template-columns: 1fr; } .p-col-left, .p-col-mid { border-right: none; border-bottom: 1px solid rgba(255,255,255,0.1); } .p-col { padding: 30px 20px; } .p-divider { width: 100%; } .profile-card-large { width: 95%; margin: 20px auto; } .edit-grid-row { grid-template-columns: 1fr; } .edit-content-wrapper { padding: 20px; } }

.role-badge { padding: 6px 12px; border-radius: 20px; font-weight: 700; font-size: 0.75rem; text-transform: uppercase; letter-spacing: 1px; box-shadow: 0 2px 10px rgba(0,0,0,0.1); }
.role-admin { background: rgba(251, 191, 36, 0.2); color: var(--gold); border: 1px solid var(--gold); }
.role-maintainer { background: rgba(16, 185, 129, 0.2); color: var(--green); border: 1px solid var(--green); }
.role-user { background: rgba(255, 255, 255, 0.1); color: white; border: 1px solid rgba(255,255,255,0.3); }

.glass-table-container { overflow: visible; min-height: auto; }
.glass-table { width: 100%; border-collapse: collapse; }
.glass-table td { padding: 15px; vertical-align: middle; border-bottom: 1px solid rgba(255,255,255,0.05); overflow: visible; position: relative; }
.glass-table thead { border-radius: 20px 20px 0 0; background: rgba(255,255,255,0.05); }
.glass-table th { padding: 15px; text-align: left; font-weight: 600; color: rgba(255,255,255,0.8); }

/* =========================================
   PERFECTLY CENTERED CHECKMARKS
   ========================================= */
   .form-checkbox-input:checked + .form-checkbox-custom::after {
      left: 50% !important;
      top: 42% !important; /* Visually balanced to account for the checkmark's tail */
      width: 6px !important;
      height: 11px !important;
      border-width: 0 2.5px 2.5px 0 !important; /* Slightly bolder for a premium look */
      transform: translate(-50%, -50%) rotate(45deg) !important;
  }

/* =========================================
   AVATAR ALT-TEXT FLASH FIX
   ========================================= */
/* Hides the ugly 'alt' text while the profile image is decoding/loading */
.profile-img {
   color: transparent !important;
}

/* Gives the empty circle a subtle loading background color */
.profile-img-wrapper {
   background-color: rgba(255, 255, 255, 0.1) !important;
}

html.light-mode .profile-img-wrapper {
   background-color: rgba(0, 0, 0, 0.05) !important;
}