/* ✅ Bottom nav */
.bottom-nav {
  position: fixed;
  bottom: 0;
  width: 100%;
  background: #ffffff;
  display: flex;
  justify-content: space-around;
  align-items: center;
  border-top: 1px solid #e0e0e0;
  padding: 8px 0;
  z-index: 999;
  box-shadow: 0 -2px 10px rgba(0,0,0,0.05);
  animation: slideUp 0.5s ease-out;
}

.nav-item {
  flex: 1;
  text-align: center;
  font-size: 12px;
  color: #000000;
  transition: all 0.3s ease;
  cursor: pointer;
  padding: 4px 0;
}

.nav-item:hover {
  color: #1e40af;
  transform: scale(1.05);
}

.nav-item img {
  width: 24px;
  margin-bottom: 4px;
  opacity: 0.7;
  transition: all 0.3s ease;
}

.nav-item.active {
  color: #1e3a8a;
  font-weight: bold;
}

.nav-item.active img {
  opacity: 1;
  transform: scale(1.1);
}

/* ✅ slide animation */
@keyframes slideUp {
  from {
    transform: translateY(100%);
    opacity: 0;
  }
  to {
    transform: translateY(0%);
    opacity: 1;
  }
}



/* แถบเมนูบาร์ */
body {
font-family: 'Poppins', sans-serif;
background: #f5f5f5;
background: url('gif/1022.gif') no-repeat center center fixed;
background-size: cover;  
}

/* 🌙 Dark Theme */
body.dark-theme {
  background: #000000;
  color: #e0e0e0;
}

body.dark-theme .sidebar {
  background: #000000;
}

body.dark-theme .menu-item,
body.dark-theme .close-btn {
  color: #e0e0e0;
}

body.dark-theme .submenu {
  background: #000000;
}

body.dark-theme .submenu a {
  color: #aef;
  border-top: 1px solid #ffffff;
}

body.dark-theme .submenu a:hover {
  background: #000000;
}

body.dark-theme .back-btn {
  background: #fff;
  color: #121212;
}
/* กล่องตั้งค่า */
body.dark-theme .setting-box {
  background-color: #1f1f1f;
}

/* รายการเมนู */
body.dark-theme .setting-item {
  background-color: #2c2c2c;
  color: #eee;
}

/* ข้อความลูกศร */
body.dark-theme .arrow {
  color: #aaa;
}

/* Bottom nav */
.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0;        /* ✅ เพิ่มให้ติดขอบซ้าย */
  right: 0;       /* ✅ เพิ่มให้ติดขอบขวา */
  width: 100vw;   /* ✅ ใช้ 100vw แทน 100% */
  background: white;
  display: flex;
  justify-content: space-around;
  border-top: 1px solid #ddd;
  padding: 6px 0;
  z-index: 999; /* ✅ กันโดนบัง */
}


.nav-item {
  text-align: center;
  font-size: 12px;
  color: #666;
}

.nav-item img {
  width: 24px;
  margin-bottom: 4px;
}

.nav-item.active {
  color: #4f46e5;
}

/* ปุ่มเปลี่ยนรหัสผ่าน หรือปุ่มทั่วไป */
body.dark-theme .btn {
  background-color: #333;
  color: #fff;
  border: 1px solid #555;
}

/* ข้อความแดงออกจากระบบ */
body.dark-theme .setting-item.logout .text {
  color: #f44336;
}
.popup-overlay {
  position: fixed;
  top: 0; left: 0;
  width: 100%; height: 100%;
  background: rgba(15, 32, 39, 0.95);
  z-index: 9999;
  display: flex;
  justify-content: center;
  align-items: center;
}
.popup-box.error-popup {
  background: #ffffff;
  padding: 30px 20px;
  border-radius: 16px;
  text-align: center;
  width: 90%;
  max-width: 360px;
  box-shadow: 0 0 30px rgba(0,0,0,0.2);
  animation: fadeIn 0.3s ease-out;
}

.popup-icon {
  width: 64px;
  margin-bottom: 16px;
  animation: bounceIn 1s ease;
}

.error-message {
  font-size: 16px;
  color: #d32f2f;
  margin-bottom: 20px;
  font-weight: bold;
}

.btn-error {
  padding: 12px 24px;
  background-color: #4caf50;
  color: white;
  font-weight: bold;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.3s;
}

.btn-error:hover {
  background-color: #388e3c;
}

/* Animation */
@keyframes fadeIn {
  from { opacity: 0; transform: scale(0.95); }
  to   { opacity: 1; transform: scale(1); }
}

@keyframes bounceIn {
  0%   { transform: scale(0.5); opacity: 0; }
  50%  { transform: scale(1.2); opacity: 1; }
  100% { transform: scale(1); }
}

.popup-box.loader-popup {
  text-align: center;
  position: relative;
  padding: 40px 20px;
  border-radius: 12px;
  width: 90%;
  max-width: 360px;
  background: transparent;
  color: #fff;
}

.loader {
  width: 60px;
  height: 60px;
  border: 8px solid rgba(255,255,255,0.1);
  border-top: 8px solid #00e5ff;
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin: 0 auto 20px;
}


.system-name {
  font-size: 16px;
  letter-spacing: 1px;
  color: #00e5ff;
  margin-bottom: 5px;
}

.loading-text {
  font-size: 15px;
  animation: pulse 1.5s infinite;
}

.percent {
  font-size: 20px;
  font-weight: bold;
  margin-top: 8px;
  color: #66ffcc;
}

.energy-lines .line {
  position: absolute;
  bottom: -100px;
  width: 2px;
  height: 100px;
  background: linear-gradient(to top, rgba(0,255,255,0.1), #00ffff, rgba(0,255,255,0));
  animation: energyUp 3s linear infinite;
  opacity: 0.6;
  box-shadow: 0 0 6px rgba(0,255,255,0.5);
}

.energy-lines {
  position: absolute;
  width: 100%;
  height: 100%;
  overflow: hidden;
  z-index: 0;
  top: 0; left: 0;
}

.energy-lines .line:nth-child(1) { left: 10%; animation-delay: 0s; }
.energy-lines .line:nth-child(2) { left: 30%; animation-delay: 0.5s; }
.energy-lines .line:nth-child(3) { left: 50%; animation-delay: 1s; }
.energy-lines .line:nth-child(4) { left: 70%; animation-delay: 0.3s; }
.energy-lines .line:nth-child(5) { left: 85%; animation-delay: 0.8s; }
.energy-lines .line:nth-child(6) { left: 95%; animation-delay: 1.2s; }

@keyframes energyUp {
  0% { transform: translateY(0); opacity: 0.1; }
  50% { opacity: 1; }
  100% { transform: translateY(-100vh); opacity: 0; }
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

.hidden {
  display: none !important;
}