html{
  margin: 0;
  padding: 0;
  height:100%;
}

body {
  font-family: Poppins, sans-serif;
  text-align: center;
  background: #f0f0f0;
  margin: 0;
  padding: 0;
  height:100%;
    display: flex;
  flex-direction: column;
}

main{
    flex: 1;
}

.logo {
  width:auto;
  height: 50px;
  margin-right: 10px;
  margin-bottom: 10px;
}

.logo-2 {
  width: auto;
  height: 50px;
  display: block;
  margin: 0 auto;
  margin-bottom: 5px; /* atur sesuai keinginan, misal 5px atau 0 */
}

.login-container {
  max-width: 400px;
  margin: 60px auto;
  padding: 25px;
  background: white;
  border-radius: 8px;
  box-shadow: 0 0 10px rgba(0,0,0,0.1);
  text-align: center;
}

.login-container h2 {
  margin-bottom: 20px;
  font-weight: bold;
  color: #2c3e50;
}

.login-container, .scanner-container, .container {
  background: white;
  padding: 20px;
  margin: 20px auto;
  border-radius: 10px;
  box-shadow: 0 0 10px #aaa;
  max-width: 400px;
  width: 90%;
  box-sizing: border-box;
}


.container {
  background: white;
  padding: 10px;
  margin: 20px auto;
  border-radius: 10px;
  box-shadow: 0 0 10px #aaa;
  max-width: 400px;
  width: 90%;
  box-sizing: border-box;
}

header {
  background-color: #2e7d32;
  color: white;
  display: flex;
  align-items: center;
  padding: 15px 20px;
}

header h1{
	font-size : 20px;
  font-weight: bold;
}

label {
  display: block;
  margin-top: 10px;
  font-weight: bold;
}

        
table {
  max-width: 100%;
  border-collapse: collapse;
  margin-top: 20px;
}

table th, table td {
  border: 1px solid #ddd;
  padding: 5px;
  text-align: center;
}

table th {
  background-color: #6f93ff;
}

.alt-link {
  margin-top: 20px;
  display: block;
  font-size: 14px;
}

.alt-link a {
color: #3498db;
text-decoration: none;
}

.alt-link a:hover {
  text-decoration: underline;
}

input, select, button {
  margin: 10px 0;
  padding: 10px;
  width: 100%;
  font-size: 14px;
  border-radius: 5px;
  border: 1px solid #ccc;
  box-sizing: border-box;
}
    #form-orangtua {
        width: 100%; /* Pastikan form memenuhi container */
        max-width: 600px; /* Atur lebar maksimum jika perlu */
    }

    .form-row {
        display: flex;
        align-items: center;
        justify-content: space-between; /* Rata kiri-kanan */
        margin-bottom: 15px; /* Jarak antar baris */
    }
    
    .form-row label {
        margin-bottom: 0; /* Menghilangkan margin bawah default */
        margin-right: 10px; /* Jarak antara label dan input */
        white-space: nowrap; /* Mencegah label wrapping */
    }

    .form-row select, 
    .form-row input {
        width: 60%; /* Atur lebar input/dropdown */
        max-width: 300px; /* Batas maksimal lebar */
    }

    .form-row button {
        margin-left: auto; /* Button di kanan */
    }
        button {
            background-color: #3498db;
            color: white;
            border: none;
            cursor: pointer;
        }

        button:hover {
            background-color: #2980b9;
        }


.error {
  color: red;
  font-size: 0.9em;
}


    #qr-container {
      display: flex;
      flex-direction: column;
      align-items: center;
      gap: 10px; 
      width: 90%;
      max-width: 400px; /* Batas lebar maksimum agar tidak terlalu besar di PC */
      margin: 20px auto; /* Memberi jarak atas/bawah dan pusatkan horizontal */
      padding: 10px;
      box-sizing: border-box;
      background-color: #333; /* Warna latar lebih gelap agar kontras */
      border-radius: 12px;
      box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    }

    #qr-reader {
      width: 100%;
      aspect-ratio: 1 / 1; 
      border: 3px solid rgba(255, 255, 255, 0.7);
      border-radius: 8px;
      overflow: hidden; /* Sembunyikan bagian video yang keluar dari frame */
      position: relative;
      background: #000; /* Latar belakang hitam saat kamera loading */
    }


    #qr-reader video,
    #qr-reader__camera {
      width: 100%;
      height: 100%;
      object-fit: cover; 
    }


.logout-btn {
  margin-top: 20px;
  background-color: #e74c3c;
  color: white;
  font-weight: bold;
}

form, .scanner-box, .result-box {
  margin-top: 20px;
}

#kirim-absen {
  background-color: #ccc; /* warna default saat nonaktif */
  color: white;
  border: none;
  border-radius: 5px;
  cursor: not-allowed;
  opacity: 0.7;
  width: 200px;
  padding: 12px;
}

#kirim-absen.active {
  background-color: #27ae60; /* hijau saat aktif */
  cursor: pointer;
  opacity: 1;
}
/* Tambahan: responsif untuk layar lebih kecil */
  @media (orientation: landscape) {
    /* Untuk PC/Landscape */
    #qr-reader__camera {
      width: 100%;
      height: auto;
    }
  }

@media screen and (max-width: 500px) {
  .login-container, .scanner-container, .container {
    padding: 10px;
    border-radius: 0;
	padding-bottom: 40px;
  }

  header h1{
	font-size : 18px;
  font-weight: bold;
  }

/*  #qr-reader {
    width: 100%;
    border-radius: 8px;
    min-height: 100%; 
  }
/*        #qr-reader__camera {
      width: 100%;
      height: auto;
    }*/
  #kirim-absen {
      width: 90%;
  }
  
  table th, table td {
    font-size: 11px;
    padding: 2px;
  }

  .logo {
    width: auto;
    height:50px;
  }

  .logo-2{
  width: auto;
  height: 50px;
  display: block;
  margin: 0 auto;
  margin-bottom: 5px; /* atur sesuai keinginan, misal 5px atau 0 */
  }
  
  #result {
  font-size: 1rem;
  margin-top: 10px;
  word-break: break-word;
  }
}

/*Dari sini Bahas POP UP*/
#kirim-absen {
  display: block;
  margin: 10px auto;
}

.form-grid {
  display: grid;
  grid-template-columns: 120px 1fr;
  gap: 12px 15px;
  align-items: center;
  margin-bottom: 15px;
}

.form-grid label {
  font-weight: 600;
  color: #2c3e50;
  font-size: 12px;
  text-align: left;
  margin: 0;
}

.form-grid .form-input {
  width: 100%;
}

.form-grid select,
.form-grid input[type="date"],
.form-grid input[type="time"],
.form-grid input[type="text"] {
  width: 100%;
  padding: 10px 12px;
  border: 2px solid #e1e8ed;
  border-radius: 6px;
  font-size: 12px;
  box-sizing: border-box;
  transition: all 0.3s ease;
}

/* Untuk elemen yang butuh full width */
.form-grid-full {
  grid-column: 1 / -1;
}

.form-grid-full label {
  text-align: left;
  margin-bottom: 8px;
}

@media (max-width: 768px) {
  .form-grid {
    grid-template-columns: 1fr;
    gap: 8px;
  }
  
  .form-grid label {
    text-align: left;
    margin-bottom: 0;
  }
}



.popup {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(5px);
  z-index: 1000;
  justify-content: center;
  align-items: center;
  padding: 10px;
  box-sizing: border-box;
}


.popup-content {
  background: white;
  border-radius: 12px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
  width: 90%;
  max-width: 500px;
  max-height: 90vh;
  overflow-y: auto;
  padding: 10px;
  position: relative;
  animation: popupFadeIn 0.3s ease-out;
}

@keyframes popupFadeIn {
  from {
    opacity: 0;
    transform: scale(0.9) translateY(-20px);
  }
  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

/* HEADER */
.popup-content h3 {
  margin: 10 0 20px 0;
  color: #2c3e50;
  font-size: 1rem;
  text-align: center;
  font-weight: 600;
  border-bottom: 2px solid #3498db;
  padding-bottom: 10px;
}

/* FORM LABELS */
.popup-content label {
  display: block;
  margin-bottom: 6px;
  font-weight: 600;
  color: #2c3e50;
  font-size: 12px;
}

/* FORM INPUTS & SELECTS */
.popup-content select,
.popup-content input[type="date"],
.popup-content input[type="time"],
.popup-content input[type="text"],
.popup-content input[type="email"],
.popup-content input[type="password"] {
  width: 100%;
  padding: 10px;
  border: 2px solid #e1e8ed;
  border-radius: 8px;
  font-size: 12px;
  margin-bottom: 10px;
  box-sizing: border-box;
  transition: all 0.3s ease;
  background: white;
}

.popup-content select:focus,
.popup-content input:focus {
  outline: none;
  border-color: #3498db;
  box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.1);
}

/* CHECKBOX CONTAINER */
.siswa-checkbox-container {
  max-height: 200px;
  overflow-y: auto;
  border: 2px solid #e1e8ed;
  border-radius: 8px;
  padding: 10px;
  background: #f8f9fa;
  margin-bottom: 10px;
  transition: border-color 0.3s ease;
}

.siswa-checkbox-container:focus-within {
  border-color: #3498db;
}

/* CHECKBOX ITEMS */
.siswa-item {
  display: flex;
  align-items: center;
  padding: 10px 8px;
  border-bottom: 1px solid #e9ecef;
  transition: background-color 0.2s ease;
  cursor: pointer;
  border-radius: 6px;
  margin-bottom: 4px;
}

.siswa-item:hover {
  background-color: #e3f2fd;
}

.siswa-item:last-child {
  border-bottom: none;
  margin-bottom: 0;
}

.siswa-checkbox {
  width: 20px;
  height: 20px;
  margin-right: 10px;
  accent-color: #3498db;
  cursor: pointer;
  flex-shrink: 0;
}

.siswa-label {
  flex: 1;
  margin: 0;
  cursor: pointer;
  font-size: 12px;
  color: #2c3e50;
  user-select: none;
}

/* SELECTED COUNT */
.selected-count {
  margin: 10px 0;
  font-weight: 600;
  color: #3498db;
  font-size: 12px;
  text-align: center;
  padding: 8px;
  background: #e3f2fd;
  border-radius: 8px;
  border: 1px solid #bbdefb;
}

/* BUTTON GROUP */
.popup-button-group {
  display: flex;
  gap: 10px;
  margin: 10px 0;
}

.popup-button-group button {
  flex: 1;
  padding: 10px;
  border: none;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
}

.popup-button-group button:first-child {
  background: #27ae60;
  color: white;
}

.popup-button-group button:first-child:hover {
  background: #219a52;
}

.popup-button-group button:last-child {
  background: #95a5a6;
  color: white;
}

.popup-button-group button:last-child:hover {
  background: #7f8c8d;
}

/* ACTION BUTTONS */
.popup-actions {
  display: flex;
  gap: 10px;
  margin-top: 20px;
}

.popup-actions button {
  flex: 1;
  padding: 12px;
  border: none;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
}

#btn-simpan {
  background: linear-gradient(135deg, #27ae60, #2ecc71);
  color: white;
}

#btn-simpan:hover:not(:disabled) {
  background: linear-gradient(135deg, #219a52, #27ae60);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(39, 174, 96, 0.3);
}

#btn-simpan:disabled {
  background: #bdc3c7;
  cursor: not-allowed;
  transform: none;
}

.popup-actions button:last-child {
  background: #e74c3c;
  color: white;
}

.popup-actions button:last-child:hover {
  background: #c0392b;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(231, 76, 60, 0.3);
}

/* SCROLLBAR STYLING */
.siswa-checkbox-container::-webkit-scrollbar {
  width: 6px;
}

.siswa-checkbox-container::-webkit-scrollbar-track {
  background: #f1f2f6;
  border-radius: 3px;
}

.siswa-checkbox-container::-webkit-scrollbar-thumb {
  background: #bdc3c7;
  border-radius: 3px;
}

.siswa-checkbox-container::-webkit-scrollbar-thumb:hover {
  background: #95a5a6;
}

/* PLACEHOLDER TEXT */
.siswa-checkbox-container p {
  margin: 0;
  padding: 15px 0;
  color: #7f8c8d;
  text-align: center;
  font-style: italic;
}

/* MOBILE - Tetap horizontal tapi dengan penyesuaian */
@media (max-width: 768px) {
  .form-grid {
    grid-template-columns: 80px 1fr; /* Lebar label lebih kecil */
    gap: 10px 8px;
  }
  
  .form-grid label {
    text-align: left;
    font-size: 12px; /* Font lebih kecil */
    width: 80px;
  }
  
  .form-grid select,
  .form-grid input {
    padding: 8px 10px;
    font-size: 14px;
  }
}
/* RESPONSIVE DESIGN */
@media (max-width: 768px) {
  .popup {
    padding: 10px;
  }
  
  .popup-content {
    padding: 15px;
    max-height: 95vh;
  }
  
  .popup-content h3 {
    font-size: 1.2rem;
  }
  
  .siswa-checkbox-container {
    max-height: 150px;
  }

  
  .popup-actions button {
    padding: 14px;
  }
}

@media (max-width: 480px) {
  .popup-content {
    border-radius: 8px;
    padding: 12px;
  }
  
  .popup-content h3 {
    font-size: 1rem;
    margin-bottom: 10px;
  }
  
  .popup-content select,
  .popup-content input {
    padding: 12px;
    font-size: 12px; /* Prevent zoom on iOS */
  }
  
  .siswa-item {
    padding: 12px 8px;
  }
  
  .siswa-label {
    font-size: 12px;
  }
}

/* FOCUS VISIBILITY */
.popup-content button:focus,
.popup-content select:focus,
.popup-content input:focus {
  outline: 2px solid #3498db;
  outline-offset: 2px;
}

/* DISABLED STATE */
.popup-content select:disabled,
.popup-content input:disabled {
  background: #f8f9fa;
  color: #6c757d;
  cursor: not-allowed;
}

/* LOADING STATE */
.loading {
  position: relative;
  color: transparent !important;
}

.loading::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 16px;
  height: 16px;
  margin: -8px 0 0 -8px;
  border: 2px solid #ffffff;
  border-radius: 50%;
  border-right-color: transparent;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

  .rekap-btn {
    display: block;
    margin: 10px auto;
    padding: 8px 16px;
    background-color: #009688;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
  }
  .rekap-btn:hover {
    background-color: #00796b;
  }

  .siswa-checkbox-container {
  max-height: 150px;
  overflow-y: auto;
  border: 1px solid #ddd;
  border-radius: 8px;
  padding: 10px;
  background: #fafafa;
  margin-bottom: 10px;
}

.siswa-item {
  display: flex;
  align-items: center;
  padding: 3px 2px;
  border-bottom: 1px solid #eee;
  transition: background-color 0.2s;
}

.siswa-item:hover {
  background-color: #f0f8ff;
}

.siswa-item:last-child {
  border-bottom: none;
}

.siswa-checkbox {
  width: 12px;
  height: 12px;
  margin-right: 10px;
  accent-color: #007bff;
  cursor: pointer;
}

.siswa-label {
  flex: 1;
  margin: 0;
  cursor: pointer;
  font-size: 10px;
  padding: 2px 0;
}

.selected-count {
  margin: 8px 0;
  font-weight: bold;
  color: #007bff;
  font-size: 10px;
  text-align: center;
  padding: 5px;
  background: #e7f3ff;
  border-radius: 4px;
  border: 1px solid #b3d9ff;
}
/*samai sini*/

footer {
  background-color: #e8e8e8;
  color: white;
  text-align: center;
  padding: 5px;
  margin-top: 5px;
  font-size: 12px;
  color: #aaa;
}