/* RESET */
* { margin:0; padding:0; box-sizing:border-box; }

/* BODY */
body {
    font-family: Arial;
    background: linear-gradient(135deg,#0f172a,#1e293b);
    color:white;
    transition:0.3s;
}

/* NAVBAR */
.navbar{
    position:sticky;
    top:0;
    padding:15px 50px;
    display:flex;
    justify-content:space-between;
    align-items:center;
    background:rgba(255,255,255,0.08);
    backdrop-filter:blur(12px);
}

.nav-links{ display:flex; gap:30px; }

.nav-links a{
    color:white;
    text-decoration:none;
    position:relative;
}

.nav-links a:hover{ color:#38bdf8; }

.nav-links a::after{
    content:"";
    position:absolute;
    width:0;
    height:2px;
    bottom:-5px;
    left:0;
    background:#38bdf8;
    transition:0.3s;
}

.nav-links a:hover::after{ width:100%; }

/* BUTTON */
button{
    width:90%;
    padding:10px;
    margin:8px;
    border:none;
    border-radius:8px;
    background:#38bdf8;
    cursor:pointer;
}

button:hover{
    transform:scale(1.05);
    background:#0ea5e9;
}

.theme-btn{
    width:auto !important;
    border-radius:20px;
    padding:6px 14px;
}

/* CARD */
.container{
    width:360px;
    margin:80px auto;
    padding:25px;
    border-radius:15px;
    background:rgba(255,255,255,0.1);
    backdrop-filter:blur(10px);
    text-align:center;
}

/* INPUT */
input{
    width:90%;
    padding:10px;
    margin:10px;
    border-radius:6px;
    border:none;
}

/* ================= CUSTOM DROPDOWN ================= */

.dropdown{
    position:relative;
    width:90%;
    margin:10px auto;
}

.dropdown-btn{
    padding:10px;
    border-radius:8px;
    background:rgba(255,255,255,0.1);
    cursor:pointer;
    text-align:left;
}

.dropdown-content{
    display:none;
    position:absolute;
    width:100%;
    max-height:200px;
    overflow-y:auto;
    background:#1e293b;
    border-radius:8px;
    margin-top:5px;
    z-index:100;
}

.dropdown-content div{
    padding:10px;
    cursor:pointer;
}

.dropdown-content div:hover{
    background:#38bdf8;
    color:black;
}

/* ================= LIGHT MODE ================= */

body.light{
    background:#f1f5f9;
    color:black;
}

body.light .navbar{
    background:rgba(0,0,0,0.1);
}

body.light .nav-links a{ color:black; }

body.light .container{
    background:rgba(0,0,0,0.05);
}

body.light .dropdown-btn{
    background:rgba(0,0,0,0.1);
}

body.light .dropdown-content{
    background:white;
    color:black;
}

body.light .dropdown-content div:hover{
    background:#38bdf8;
    color:white;
}
.dropdown-content div.active {
    background: #38bdf8;
    color: black;
}
.dropdown-content {
    transition: 0.2s;
}
button:active {
    transform: scale(0.95);
}
.action-box {
    position: absolute;
    right: 10px;
    top: 10px;
    background: #38bdf8;
    padding: 6px;
    border-radius: 6px;
    display: flex;
    gap: 6px;
}

.action-box {
    animation: fadeIn 0.2s ease;
}

@keyframes fadeIn {
    from { opacity:0; transform: translateY(-5px); }
    to { opacity:1; transform: translateY(0); }
}
.question-card {
    position: relative;
    margin: 10px;
    padding: 15px;
    border: 1px solid #ccc;
    border-radius: 8px;
}

.qCheck {
    position: absolute;
    left: 10px;
    top: 18px;
    transform: scale(1.2);
}

.q-content {
    margin-left: 35px;
}
input[type="checkbox"] {
    width: auto !important;
}
/* ===== QUIZ UI ===== */

.quiz-top {
    display: flex;
    justify-content: flex-end;
    margin-bottom: 10px;
}

#timerBox {
    background: #38bdf8;
    padding: 8px 14px;
    border-radius: 8px;
    font-weight: bold;
    color: black;
}

/* QUESTION BOX */
.question-card {
    padding: 15px;
    margin-bottom: 15px;
    border-radius: 10px;
    background: rgba(255,255,255,0.1);
}

/* OPTIONS */
.option {
    padding: 12px;
    margin: 8px 0;
    border-radius: 8px;
    background: rgba(255,255,255,0.1);
    cursor: pointer;
    transition: 0.3s;
}

.option:hover {
    background: rgba(56,189,248,0.4);
}

/* STATES */
.option.selected {
    background: #38bdf8;
    color: black;
}

.option.correct {
    background: #22c55e;
    color: black;
}

.option.wrong {
    background: #ef4444;
    color: white;
}

/* NEXT BUTTON DISABLE */
#nextBtn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}
/* ===== HISTORY CARDS ===== */

/* SCORE COLORS */
.score-good {
    background: #22c55e;
    color: black;
}

.score-medium {
    background: #facc15;
    color: black;
}

.score-bad {
    background: #ef4444;
    color: white;
}

/* ===== HISTORY TABLE ===== */

.history-wrapper {
    width: 85%;
    margin: 50px auto;
}

.history-wrapper h2 {
    text-align: center;
    margin-bottom: 20px;
}

/* TABLE BOX */

/* HEADER */
.history-header {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr 1fr 2fr;
    padding: 12px;
    font-weight: bold;
    background: rgba(255,255,255,0.15);
}

/* ROW */
.history-row {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr 1fr 2fr;
    padding: 12px;
    border-top: 1px solid rgba(255,255,255,0.1);
    transition: 0.3s;
}

.history-row:hover {
    background: rgba(255,255,255,0.1);
}

/* SCORE COLORS */
.score-good { color: #22c55e; font-weight: bold; }
.score-medium { color: #facc15; font-weight: bold; }
.score-bad { color: #ef4444; font-weight: bold; }
.history-wrapper {
    width: 90% !important;
    max-width: 1100px;
    margin: 50px auto;
}
.login-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-top: 80px;
}

.logo {
    font-size: 40px;
    margin-bottom: 20px;
}

.auth-box {
    width: 350px;
    padding: 25px;
    border-radius: 12px;
    background: rgba(255,255,255,0.1);
    text-align: center;
}

.auth-box input {
    width: 90%;
    padding: 10px;
    margin: 10px;
}

.switch {
    cursor: pointer;
    color: #38bdf8;
}
.switch:hover {
    text-decoration: underline;
}
.quiz-top{
    display: flex;
    justify-content: space-between;
    margin-bottom: 15px;
}

.box-left, .box-right{
    padding: 8px 15px;
    background: #1e293b;
    border-radius: 8px;
    color: white;
}
.history-container{
    width: 90%;
    max-width: 900px;
    margin: 40px auto;
    color: white;
}

.history-container h2{
    text-align: center;
    margin-bottom: 20px;
}

.history-header,
.history-row{
    display: grid;
    grid-template-columns: 1fr 1fr 1fr 1fr 2fr;
    padding: 12px 15px;
    border-radius: 10px;
}

.history-header{
    background: rgba(255,255,255,0.1);
    font-weight: bold;
}

.history-row{
    margin-top: 10px;
    background: rgba(255,255,255,0.05);
    transition: 0.3s;
}

.history-row:hover{
    background: rgba(255,255,255,0.1);
}

/* SCORE COLORS */
.score-good{
    color: #22c55e;
    font-weight: bold;
}

.score-medium{
    color: #facc15;
    font-weight: bold;
}

.score-bad{
    color: #ef4444;
    font-weight: bold;
}
/* 🔥 FORCE REMOVE RED BAR */
.history-row div {
    background: none !important;
    width: auto !important;
}

/* SCORE TEXT ONLY */
.score-good,
.score-medium,
.score-bad {
    background: none !important;
    display: inline !important;
    width: auto !important;
}
/* ===== LEADERBOARD ===== */
/* ===== LEADERBOARD FIX ===== */

.leaderboard-container{
    width: 90%;
    max-width: 900px;
    margin: 40px auto;
}

.leaderboard-container h2{
    text-align: center;
    margin-bottom: 20px;
}

/* HEADER */
.leaderboard-header{
    display: grid;
    grid-template-columns: 1fr 2fr 1fr 1fr;
    padding: 14px;
    background: rgba(255,255,255,0.12);
    border-radius: 10px;
    font-weight: bold;
}

/* ROW */
.leaderboard-row{
    display: grid;
    grid-template-columns: 1fr 2fr 1fr 1fr;
    padding: 14px;
    margin-top: 10px;
    background: rgba(255,255,255,0.06);
    border-radius: 10px;
    transition: 0.2s;
}

.leaderboard-row:hover{
    background: rgba(255,255,255,0.12);
}

/* TOP 3 */
.rank-1 { color: gold; font-weight: bold; }
.rank-2 { color: silver; font-weight: bold; }
.rank-3 { color: #cd7f32; font-weight: bold; }
.auth-box h2{
    margin-bottom: 15px;
}

.auth-box button{
    width: 90%;
    margin-top: 10px;
}
.question-card{
    background: rgba(255,255,255,0.08);
    padding: 15px;
    margin: 10px 0;
    border-radius: 10px;
}
.question-card{
    background: rgba(255,255,255,0.08);
    padding: 15px 20px;
    margin: 15px auto;
    border-radius: 12px;
    width: 85%;
    max-width: 900px;
    transition: 0.3s;
}

.question-card:hover{
    transform: translateY(-3px);
    background: rgba(255,255,255,0.12);
}

.q-text{
    font-weight: bold;
    font-size: 18px;
    margin-bottom: 10px;
}

.options p{
    margin: 4px 0;
}

.actions{
    margin-top: 12px;
    display: flex;
    gap: 10px;
}

.actions button{
    padding: 8px 16px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
}

.edit-btn{
    background: #38bdf8;
    color: black;
}

.delete-btn{
    background: #ef4444;
    color: white;
}
