/* ===========================
   ✅ BASE
   =========================== */
*{
  box-sizing: border-box;
}

body{
  margin:0;
  font-family: Arial, sans-serif;
  background:#f4f6f8;
  padding: 0;
}

/* Layout */
.container{
  max-width:700px;
  margin:30px auto;
  padding:10px;
}

.card{
  background:#fff;
  padding:25px;
  border-radius:10px;
  box-shadow:0 2px 6px rgba(0,0,0,.1);
}

/* Headings */
h1,h2{
  text-align:center;
  margin-top: 0;
}

/* Inputs / Buttons */
input, select, button{
  width:100%;
  padding:12px;
  margin:10px 0;
  border-radius:6px;
  border:1px solid #ccc;
  font-size:16px;
}

button{
  background:#007bff;
  color:#fff;
  border:none;
  cursor:pointer;
  font-weight:bold;
}

button:hover{
  background:#0056b3;
}

/* ✅ TOPBAR: split into 2 sides */
.topbar{
  display: flex;
  width: 100%;               /* IMPORTANT */
  justify-content: space-between;
  align-items: center;
}

/* LEFT entity */
.user-mobile{
  flex: 1;                   /* takes remaining space */
  text-align: left;          /* always left */
}

/* RIGHT entity */
.logout-link{
  flex: 0 0 auto;            /* stays tight */
  text-align: right;
  margin-left: 10px;
  white-space: nowrap;
  text-decoration: underline;
  font-weight: 600;
}

/* Status / Result */
#fileStatus{
  margin-top:10px;
  font-weight:bold;
  color:green;
}

#result{
  text-align:center;
}

/* Quiz */
#quiz{
  display:none;
}

.question{
  font-size:18px;
  margin-bottom:15px;
  line-height:1.5;
}

/* Options */
.option{
  display:flex;
  align-items:flex-start;
  gap:10px;
  padding:10px;
  margin:8px 0;
  border:1px solid #ddd;
  border-radius:8px;
  cursor:pointer;
}

.option:hover{
  background:#f0f0f0;
}

.option input{
  width:auto;
  margin-top:2px;
}

.option.disabled{
  pointer-events:none;
  opacity:.9;
}

.correct{
  background:#d4edda;
  border-color:#28a745;
}

.wrong{
  background:#f8d7da;
  border-color:#dc3545;
}

/* Progress */
.progress-bar{
  width:100%;
  height:10px;
  background:#ddd;
  border-radius:10px;
  margin:10px 0;
  overflow:hidden;
}

#progressFill{
  height:100%;
  width:0%;
  background:#007bff;
}

/* Feedback */
#feedback{
  display:none;
  padding:12px;
  margin-top:12px;
  border-radius:8px;
  font-weight:600;
}

#feedback.correct{
  background:#d4edda;
  color:#155724;
}

#feedback.wrong{
  background:#f8d7da;
  color:#721c24;
}


/* ===========================
   ✅ MOBILE FRIENDLY (ALL PAGES)
   =========================== */
@media (max-width: 768px){

  body{
    padding:12px;
  }

  .container{
    max-width:100%;
    margin:10px auto;
    padding:0;
  }

  .card{
    width:100%;
    padding:16px;
    border-radius:14px;
  }

  h1,h2{
    font-size:20px;
    line-height:1.3;
  }

  .question{
    font-size:17px;
  }

  /* 1 option per row */
  #questionArea{
    display:block !important;
  }

  .option{
    padding:12px 10px;
    border-radius:14px;
    font-size:16px;
  }

  .option input[type="radio"]{
    transform:scale(1.25);
  }

  /* Sticky Submit/Next button */
  #nextBtn{
    position:fixed;
    left:10px;
    right:10px;
    bottom:10px;
    z-index:999;
    width:auto !important;
    border-radius:14px;
    padding:14px 12px;
    font-size:16px;
  }

  /* prevent last option hidden behind sticky button */
  #quiz{
    padding-bottom:90px !important;
  }

  #progressText{
    font-size:14px;
  }

  #feedback{
    font-size:15px;
    line-height:1.4;
  }

  .user-mobile,
  .logout-link{
    font-size:13px;
  }
}
/* CARD */
.card {
  position: relative;          /* REQUIRED for absolute positioning */
  text-align: center;          /* keep main content centered */
  padding-top: 50px;           /* space for topbar */
}

/* TOP BAR */
.topbar {
  position: absolute;
  top: 12px;
  left: 15px;
  right: 15px;

  display: flex;
  justify-content: space-between;
  align-items: center;

  font-size: 13px;
  color: #555;
}

/* USER MOBILE */
.user-mobile {
  text-align: left;
}

/* LOGOUT LINK */
.logout-link {
  text-decoration: none;
  color: #007bff;
  font-weight: bold;
}

.logout-link:hover {
  text-decoration: underline;
}