/* ===== Reset dasar ===== */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: "Segoe UI", Arial, sans-serif;
  background: #eef2f7;
  color: #2d3748;
  line-height: 1.6;
  padding: 1rem;
}

/* ===== Container ===== */
.container {
  width: 100%;
  max-width: 960px;
  margin: auto;
  padding: 1rem;
}

.card section {
  background: #1e1e2f; /* Background hitam untuk section di card */
  color: #fff; /* Font putih untuk section */
  padding: 1rem;
  border-radius: 12px;
  margin-bottom: 1rem;
  box-shadow: 0 2px 6px rgba(0,0,0,0.2);
}

.card section .exception-text {
  color: #2d3748 !important; /* Pengecualian font hitam di dalam section */
}

.card form {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.card .userForm button[type="submit"] {
  margin-top: 0.5rem;
}

.back-btn {
  padding: 0.75rem 1.2rem;
  font-size: 1rem;
  border: none;
  border-radius: 8px;
  background-color: #718096;
  color: white;
  cursor: pointer;
  transition: background-color 0.2s ease;
}

.back-btn:hover {
  background-color: #4a5568;
}

.card .back-btn {
  margin-top: 1rem;
  width: 100%;
  padding: 0.75rem;
  font-size: 1rem;
  border: none;
  border-radius: 8px;
  background-color: #718096;
  color: white;
  cursor: pointer;
  transition: background-color 0.2s ease;
}

.card .back-btn:hover {
  background-color: #4a5568;
}

.card .button-group {
  display: flex;
  gap: 1rem;
  margin-top: 1rem;
  flex-wrap: wrap;
}

.card .button-group button {
  flex: 1 1 auto;
  min-width: 0;
}

/* Kelompok input dan tombol Cari */
.input-group {
  display: flex;
  gap: 1rem;
  margin-bottom: 1rem;
  flex-wrap: wrap;
}

.input-group input {
  flex: 1 1 40%;
  padding: 0.75rem;
  border: 1px solid #cbd5e0;
  border-radius: 8px;
  font-size: 1rem;
}

.input-group .primary-btn {
  flex: 0 0 auto;
  padding: 0.75rem 1.2rem;
}

.primary-btn {
  padding: 0.75rem 1.2rem;
  font-size: 1rem;
  border: none;
  border-radius: 8px;
  background: linear-gradient(90deg, #3182ce, #63b3ed);
  color: white;
  cursor: pointer;
  transition: background 0.2s ease, transform 0.1s ease;
}

.primary-btn:hover {
  background: linear-gradient(90deg, #2b6cb0, #4299e1);
  transform: translateY(-2px);
}

.primary-btn:active {
  transform: translateY(0);
}

/* Teks instruksi */
.instruction-text {
  color: #4a5568;
  font-size: 0.95rem;
  margin-bottom: 1rem;
  padding: 0.5rem;
  background-color: #f7fafc;
  border-radius: 8px;
  text-align: center;
}

.debugPanel {
  max-height: 200px;
  overflow-y: auto;
  background: #2b2b3d;
}


/* ===== Show/Hide State ===== */
.hidden {
  opacity: 0;
  visibility: hidden;
  max-height: 0;
  overflow: hidden;
  pointer-events: none;
  transition: all 0.3s ease;
}

.show {
  opacity: 1 !important;
  visibility: visible !important;
  max-height: 1000px !important;
}

/* ===== Header ===== */
header {
  text-align: center;
  margin-bottom: 1.5rem;
}

header h1 {
  font-size: 2rem;
  font-weight: bold;
  color: #1a202c;
}

#userInfo span {
  margin: 0 0.4rem;
  font-size: 0.95rem;
  color: #4a5568;
}

/* ===== Button Umum ===== */
button {
  transition: all 0.2s ease;
}
#toggleSession {
  transition: all 0.2s ease;
}

#toggleSession.bg-red-500 {
  background-color: rgb(239, 68, 68);
}
#toggleSession.bg-green-500 {
  background-color: rgb(34, 197, 94);
}

/* ===== Status ===== */
#sessionDuration {
  font-family: monospace;
  font-weight: bold;
  font-size: 1rem;
}

.status {
  padding: 0.3rem 0.6rem;
  border-radius: 8px;
  font-weight: bold;
  color: white;
}

.status-online {
  background-color: #38a169;
  box-shadow: 0 0 8px rgba(56,161,105,0.6);
}

.status-offline {
  background-color: #e53e3e;
  box-shadow: 0 0 8px rgba(229,62,62,0.6);
}

.status-indicator {
  display: inline-block;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  margin-right: 6px;
}

.status-green {
  background-color: #38a169;
  box-shadow: 0 0 6px rgba(56,161,105,0.8);
}

.status-red {
  background-color: #e53e3e;
  box-shadow: 0 0 6px rgba(229,62,62,0.8);
}

/* ===== Form ===== */
.userForm input,
.userForm select,
.userForm button {
  width: 100%;
  padding: 0.75rem;
  margin: 0.5rem 0;
  border: 1px solid #cbd5e0;
  border-radius: 8px;
  font-size: 1rem;
}

.userForm button {
  background: linear-gradient(135deg, #3182ce, #2b6cb0);
  color: white;
  font-weight: bold;
  border: none;
  cursor: pointer;
  box-shadow: 0 2px 6px rgba(0,0,0,0.1);
}

.userForm button:hover {
  background: linear-gradient(135deg, #2b6cb0, #2c5282);
}


/* ===== Prompt ===== */
#fingerPrompt {
  background-color: #fed7d7;
  color: #742a2a;
  padding: 0.9rem;
  border-radius: 8px;
  margin-bottom: 1rem;
  text-align: center;
  font-weight: bold;
}

/* ===== Continue User Section ===== */
#continueUserSection button {
  width: 100%;
  padding: 0.7rem;
  margin-top: 0.6rem;
  background: linear-gradient(135deg, #38a169, #2f855a);
  color: white;
  border: none;
  border-radius: 8px;
  cursor: pointer;
}

#continueUserSection button:hover {
  background: linear-gradient(135deg, #2f855a, #276749);
}


/* ===== Toggle Log Button ===== */
#toggle-log-btn {
  position: fixed;
  bottom: 1rem;
  right: 1rem;
  background: #2d3748;
  color: white;
  border: none;
  padding: 0.8rem 1.2rem;
  border-radius: 10px;
  cursor: pointer;
  z-index: 999;
  box-shadow: 0 2px 8px rgba(0,0,0,0.2);
}

#toggle-log-btn:hover {
  background: #1a202c;
}

/* ===== Extra Forms ===== */
#userExistsMsg {
  color: #e53e3e;
  font-size: 0.9rem;
  margin-top: 0.5rem;
  opacity: 0;
  transition: all 0.4s ease;
  max-height: 0;
  overflow: hidden;
}

#userExistsMsg.visible {
  opacity: 1;
  max-height: 100px;
}

#startBtn {
  background: linear-gradient(135deg, #3182ce, #2b6cb0);
  color: white;
  border: none;
  border-radius: 10px;
  padding: 0.7rem 1.2rem;
  font-weight: bold;
  cursor: pointer;
  width: 100%;
  margin-top: 1rem;
}

#startBtn:hover {
  background: linear-gradient(135deg, #2b6cb0, #2c5282);
}

.secondary-btn {
  background-color: #718096;
  color: white;
  border: none;
  padding: 0.6rem 1rem;
  border-radius: 8px;
  cursor: pointer;
  font-weight: bold;
}

.secondary-btn:hover {
  background-color: #4a5568;
}

#replitStatus {
  font-weight: bold;
}

#createUserSection {
  margin-top: 1rem;
}

.highlight-text {
  background: #fff3cd; /* Kuning lembut */
  color: #744210; /* Coklat gelap untuk kontras */
  padding: 0.5rem 1rem;
  border-radius: 8px;
  border: 1px solid #ffeeba;
  display: inline-block;
  font-weight: bold;
  transition: all 0.2s ease;
}

.highlight-text:hover {
  background: #ffe69c; /* Kuning lebih terang saat hover */
  transform: translateY(-2px);
  box-shadow: 0 2px 6px rgba(0,0,0,0.1);
}

/* Opsional: Tambah ikon (kalau pake Font Awesome) */
.highlight-text::before {
  content: "📊 "; /* Ikon teks, ganti dengan ikon Font Awesome kalau ada */
  margin-right: 0.5rem;
}

/* ===== Desktop Adjustment ===== */
@media (min-width: 768px) {
  header h1 {
    font-size: 2.2rem;
  }
  
  .liveData div {
    flex: 1 1 45%;
  }
  
  .charts canvas {
    max-height: 280px;
  }
  
  .session-btn {
    max-width: 260px;
    margin: 0 auto;
  }
}