html, body {
    margin: 0;
    padding: 0;
    height: 100%;
    font-family: Arial, sans-serif;
    background: #f0f2f5;
    color: #222;
    overflow-x: hidden;
}

/*header {*/
/*    background: #34495e;*/
/*    color: white;*/
/*    padding: 15px 30px;*/
/*    font-weight: 700;*/
/*    display: flex;*/
/*    align-items: center;*/
/*    justify-content: space-between;*/
/*}*/

header {
  display: flex;
  flex-wrap: wrap;  /* supaya elemen header bisa turun baris di layar kecil */
  justify-content: space-between;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 1rem;
  background-color: #f8f9fa; /* atau sesuai tema */
  border-bottom: 1px solid #ddd;
}

/*header .exit-button {*/
/*    background: #e67e22;*/
/*    color: white;*/
/*    padding: 8px 16px;*/
/*    border-radius: 5px;*/
/*    text-decoration: none;*/
/*    font-weight: 700;*/
/*}*/

header > div {
  flex: 1 1 150px;   /* Fleksibel, minimal lebar 150px */
  min-width: 120px;
  white-space: nowrap;    /* agar teks panjang tidak pecah baris */
  overflow: hidden;
  text-overflow: ellipsis;
}

header .user-name {
  flex: 0 0 auto;      /* ukuran fix sesuai isi */
  font-weight: 700;
  white-space: nowrap;
}


#timer {
  font-size: 1.1rem;
  background: #e74c3c;
  padding: 6px 16px;
  border-radius: 20px;
  min-width: 120px;
  text-align: center;
  white-space: nowrap;
}

/* Card base style */
.card {
    background: white;
    border-radius: 10px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    padding: 20px;
    display: flex;
    flex-direction: column;
}

/* Soal card 60% viewport lebar */
.container {
    display: flex;
    padding: 20px 5%;
    gap: 3%;
    height: 90vh; /* container tingginya 90% viewport */
    box-sizing: border-box;
}

.soal-card {
    flex-basis: 60%; /* kembalikan ke 60% */
    min-height: 100%;
    min-width:75%; /* isi full tinggi container */
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    box-sizing: border-box;
}

.list-soal-card {
    flex-basis: 30%; /* 30% viewport */
    background: #ecf0f1;
    border-left: 4px solid #2980b9;
    padding: 20px;
    height: 100%; /* full tinggi container */
    box-sizing: border-box;
    overflow-y: visible; /* agar tidak scroll */
}

.list-soal {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 6px;
    padding: 10px;
    height: auto; /* biar tinggi grid sesuai isi */
    overflow: visible; /* pastikan tidak scroll */
}

/* Label navigasi di atas list soal */
.nav-label {
    text-align: center;
    font-weight: bold;
    background: #2980b9;
    color: white;
    padding: 10px;
    border-radius: 8px;
    margin-bottom: 15px;
    font-size: 14px;
}

/* Style box soal */
.question-box p {
    margin-top: 20px;
    font-size: 16px;
    font-weight: 700;
    margin-bottom: 15px;
}

.question-box .option {
    margin-top: 0px;
    font-size: 15px;
    padding: 2px;
    border-radius: 2px;
}

.question-box input[type="radio"] {
    margin-right: 10px;
    transform: scale(1.3);
    cursor: pointer;
}

.question-box img {
    max-width: 50%;
    display: block;
    margin: 20px auto;
    border-radius: 10px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.1);
}



/* Navigasi soal (prev, next, flag) */
.navigation {
    margin-top: 20px;
    display: flex;
    justify-content: center;
    gap: 10px;
    flex-wrap: wrap;
}

.navigation button,
.selesai-button {
    padding: 12px 20px;
    font-size: 1.1rem;
    border-radius: 8px;
    border: none;
    cursor: pointer;
    font-weight: 700;
    transition: background-color 0.3s ease;
}



button[name="prev"] {
    background-color: #7f8c8d;
    color: white;
}
button[name="next"] {
    background-color: #2980b9;
    color: white;
}
button#flagButton {
    background-color: orange;
    color: white;
}
button#flagButton:hover {
    background-color: darkorange;
}

/* Tombol selesai full width di bawah list nomor */
.selesai-button {
    background-color: #c0392b;
    color: white;
    width: 100%;
    margin-top: 15px;
}

/* List nomor soal dalam grid 5 kolom */


.list-soal a {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 34px;
    height: 34px;
    font-size: 14px;
    font-weight: bold;
    color: white;
    background-color: #bdc3c7;
    border-radius: 6px;
    text-decoration: none;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.list-soal a.answered {
    background-color: #2ecc71;
}
.list-soal a.current {
    background-color: #2980b9;
    border: 2px solid #1f618d;
}
.list-soal a.flagged {
    border: 2px solid red;
    position: relative;
}
.list-soal a.flagged::after {
    content: "🚩";
    position: absolute;
    top: -6px;
    right: -6px;
    font-size: 12px;
}

/* Responsif untuk layar kecil */
@media (max-width: 768px) {
     header {
    flex-wrap: nowrap;
    justify-content: space-between;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.9rem;
  }

  header > div {
    flex: 1 1 auto;
    text-align: center;
    white-space: nowrap;
  }

  header .user-name {
    order: 2;
    text-align: right;
  }


  header #timer {
    order: 4;
    width: 100%;
    text-align: center;
    margin-top: 0.3rem;
  }


  header .jenis-soal {
    display: none;
  }
  header .user-name {
    display: none;
  }
  
    .container {
        flex-direction: column;
        padding: 15px;
        height: auto;
    }

    .soal-card, .list-soal-card {
        flex-basis: 100%;
        margin-bottom: 20px;
        padding: 15px;
    }
    
    .soal-card {
        min-height: 70vh; /* 🟢 Minimal tinggi 70% viewport saat mobile */
        display: flex;
        flex-direction: column;
        justify-content: space-between;
    }

    .list-soal {
        grid-template-columns: repeat(7, 1fr);
        max-height: none;
    }
    
      #timer {
        order: 3; /* Pindah timer ke bawah */
        width: 100%;
        margin-top: 0.5rem;
      }
    
      header .user-name {
        order: 2;
      }


    .list-soal a {
        width: 30px;
        height: 30px;
        font-size: 14px;
    }

    .selesai-button {
        margin-top: 10px;
    }    
    .navigation {
        flex-wrap: nowrap;
        gap: 5px;
        justify-content: space-between;
    }

    .navigation button {
        flex: 1;
        padding: 8px 10px;
        font-size: 0.8rem;
        white-space: nowrap;
    }

    button[name="prev"],
    button[name="next"],
    button#flagButton {
        padding: 8px 10px;
        font-size: 0.8rem;
    }
}
