/* =========================
   BẢNG MÀU & THIẾT LẬP CHUNG (FRUTIGER AERO)
========================= */
:root {
  --bg-main: rgba(240, 248, 255, 0.75);
  --card-bg: rgba(255, 255, 255, 0.45);
  --primary-blue: #0055aa;
  --light-blue: #70b5ff;
  --accent-green: #76c442;
  --glass-border: rgba(255, 255, 255, 0.8);
  --glass-shadow: 0 8px 32px 0 rgba(0, 85, 170, 0.2);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: 'Varela Round', sans-serif;
  font-size: 16px;
  background: url('https://files.catbox.moe/gqtzgh.jpg') no-repeat center center fixed;
  background-size: cover;
  min-height: 100vh;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 20px;
  color: #003366;

}

/* =========================
   KHUNG DASHBOARD TỔNG THỂ (HIỆU ỨNG KÍNH BÓNG - GLASS)
========================= */
.dashboard-container {
  display: flex;
  width: 90%;
  max-width: 1350px;
  background-color: rgba(255, 255, 255, 0.35);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-radius: 20px;
  box-shadow: 0 15px 35px rgba(0, 40, 90, 0.3), inset 0 1px 0 rgba(255, 255, 255, 0.6);
  border: 2px solid rgba(255, 255, 255, 0.7);
  overflow: hidden;
  min-height: 650px;
}

/* =========================
   SIDEBAR TRÁI
========================= */
.sidebar {
  width: 260px;
  background: linear-gradient(to bottom, rgba(255, 255, 255, 0.5), rgba(210, 235, 255, 0.4));
  border-right: 1px solid rgba(255, 255, 255, 0.6);
  padding: 25px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.brand {
  margin-bottom: 20px;
}

.brand-logo {
  max-width: 140px;
  height: auto;
  display: block;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.15));
}

.user-profile {
  display: flex;
  align-items: center;
  gap: 12px;
  background: rgba(255, 255, 255, 0.5);
  padding: 10px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.8);
  box-shadow: inset 0 1px 2px rgba(255, 255, 255, 0.8);
  margin-bottom: 25px;
}

.avatar {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  object-fit: cover;
  background-color: var(--light-blue);
  border: 2px solid white;
}

.user-info {
  display: flex;
  flex-direction: column;
}

.user-name {
  font-weight: bold;
  font-size: 18px;
  color: #003366;
}

.user-role {
  font-size: 14px;
  color: #557799;
}

.side-menu {
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex: 1;
}

.side-menu a {
  text-decoration: none;
  color: #004488;
  padding: 8px 14px;
  border-radius: 10px;
  font-size: 16px;
  transition: all 0.2s ease;
}

.side-menu a:hover {
  background: rgba(255, 255, 255, 0.6);
  color: #002244;
  padding-left: 18px;
}

.side-menu a.active {
  background: linear-gradient(to bottom, #70b5ff, #0077ee);
  color: #ffffff;
  font-weight: bold;
  box-shadow: 0 4px 10px rgba(0, 119, 238, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.5);
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}

.sidebar-footer .logout-btn {
  text-decoration: none;
  color: #cc2222;
  font-weight: bold;
  font-size: 18px;
}

/* =========================
   NỘI DUNG CHÍNH (MAIN CONTENT)
========================= */
.main-content {
  flex: 1;
  padding: 25px;
  background: rgba(255, 255, 255, 0.2);
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.dash-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.dash-header h1 {
  font-size: 26px;
  letter-spacing: 1px;
  color: #003366;
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.8);
}

.header-right {
  display: flex;
  align-items: center;
  gap: 10px;
}

.search-box {
  padding: 6px 14px;
  border-radius: 16px;
  border: 1px solid rgba(255, 255, 255, 0.8);
  background: rgba(255, 255, 255, 0.6);
  font-family: 'VT323', monospace;
  font-size: 18px;
  outline: none;
  color: #003366;
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.05);
}

.icon-btn {
  background: rgba(255, 255, 255, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.8);
  padding: 5px 9px;
  border-radius: 50%;
  cursor: pointer;
  font-size: 16px;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
}

/* =========================
   LƯỚI WIDGET (BENTO GRID - HIỆU ỨNG KÍNH)
========================= */
.dashboard-grid {
  display: grid;
  grid-template-columns: 2fr 2fr 1.5fr;
  grid-template-rows: auto auto;
  gap: 15px;
  flex: 1;
}

.card {
  background: rgba(255, 255, 255, 0.4);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1px solid rgba(255, 255, 255, 0.7);
  border-radius: 16px;
  padding: 16px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  box-shadow: 0 6px 15px rgba(0, 60, 130, 0.1), inset 0 1px 0 rgba(255, 255, 255, 0.6);
}

.card h3 {
  font-size: 20px;
  margin-bottom: 8px;
  color: #004488;
}

.see-more {
  text-align: right;
  font-size: 16px;
  color: #0055aa;
  text-decoration: none;
  font-weight: bold;
  margin-top: 8px;
}

.see-more:hover {
  text-decoration: underline;
  color: #0077ee;
}

/* Các khối cụ thể */
.widget-teachers .item-row {
  font-size: 18px;
  margin: 4px 0;
  display: flex;
  align-items: center;
  gap: 8px;
}

.dot {
  width: 9px;
  height: 9px;
  background: radial-gradient(circle, #98ff55 0%, #44aa00 100%);
  box-shadow: 0 0 6px #55ff00;
  border-radius: 50%;
  display: inline-block;
}

.sub-text {
  font-size: 16px;
  color: #557799;
}

.widget-events .mini-box {
  background: rgba(255, 255, 255, 0.3);
  padding: 8px 10px;
  border-radius: 10px;
  border: 1px dashed rgba(0, 85, 170, 0.4);
  font-size: 18px;
}

.widget-stats {
  grid-row: span 2;
  background: rgba(255, 255, 255, 0.3);
}

.stat-item {
  background: rgba(255, 255, 255, 0.4);
  padding: 10px 12px;
  border-radius: 10px;
  margin-bottom: 8px;
  border: 1px solid rgba(255, 255, 255, 0.6);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.widget-schedule {
  grid-column: span 2;
}

.widget-schedule p {
  font-size: 18px;
  line-height: 1.4;
}

.widget-projects {
  grid-column: span 2;
}

.project-preview {
  display: flex;
  gap: 10px;
}

.proj-box {
  flex: 1;
  background: rgba(255, 255, 255, 0.4);
  padding: 12px;
  text-align: center;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.6);
  font-weight: bold;
  color: #004488;
  box-shadow: inset 0 1px 1px rgba(255, 255, 255, 0.8);
}

/* =========================
   GIAO DIỆN IPOD TRONG SUỐT (FRUTIGER AERO)
========================= */
.widget-ipod {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
}

.ipod-screen {
  width: 100%;
  background: rgba(230, 245, 255, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.8);
  border-radius: 8px;
  padding: 8px 12px;
  box-shadow: inset 0 2px 4px rgba(0, 50, 100, 0.1);
  margin-bottom: 10px;
  text-align: left;
}

.song-title {
  font-size: 16px;
  color: #003366;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-weight: bold;
}

.ipod-status {
  font-size: 12px;
  color: #557799;
  margin-top: 2px;
}

.ipod-wheel {
  width: 130px;
  height: 130px;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.8), rgba(210, 230, 255, 0.6));
  border-radius: 50%;
  position: relative;
  box-shadow: 0 4px 15px rgba(0, 60, 130, 0.15), inset 0 1px 3px rgba(255, 255, 255, 0.9);
  border: 1px solid rgba(255, 255, 255, 0.9);
  display: flex;
  justify-content: center;
  align-items: center;
}

.wheel-btn {
  position: absolute;
  font-weight: bold;
  color: #004488;
  cursor: pointer;
  font-size: 16px;
  user-select: none;
  transition: transform 0.1s ease;
}

.wheel-btn:active {
  transform: scale(0.9);
}

.wheel-btn.center {
  background: linear-gradient(to bottom, #ffffff, #d0e5ff);
  width: 50px;
  height: 50px;
  border-radius: 50%;
  display: flex;
  justify-content: center;
  align-items: center;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1), inset 0 1px 1px white;
  border: 1px solid rgba(255, 255, 255, 0.8);
  font-size: 14px;
}

.wheel-btn.top {
  top: 8px;
}

.wheel-btn.bottom {
  bottom: 8px;
}

.wheel-btn.left {
  left: 12px;
}

.wheel-btn.right {
  right: 12px;
}

/* Khung chứa nút 3 chấm và menu */
.menu-container {
  position: relative;
  display: inline-block;
}

/* Nút 3 chấm */
.icon-btn {
  background: rgba(255, 255, 255, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.8);
  width: 32px;
  height: 32px;
  border-radius: 50%;
  cursor: pointer;
  font-size: 16px;
  display: flex;
  justify-content: center;
  align-items: center;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
  transition: background 0.2s;
}

.icon-btn:hover {
  background: rgba(255, 255, 255, 0.9);
}

/* Hộp Menu xổ xuống */
.dropdown-menu {
  display: none;
  /* Mặc định ẩn */
  position: absolute;
  right: 0;
  top: 40px;
  background: rgba(240, 248, 255, 0.85);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.9);
  border-radius: 12px;
  box-shadow: 0 8px 20px rgba(0, 50, 100, 0.15);
  width: 160px;
  padding: 6px;
  z-index: 100;
  animation: fadeIn 0.15s ease-in-out;
}

/* Hiệu ứng hiện dần */
@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(-5px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Các lựa chọn bên trong menu */
.dropdown-item {
  width: 100%;
  background: transparent;
  border: none;
  padding: 8px 12px;
  text-align: left;
  font-family: 'Varela Round', sans-serif;
  font-size: 14px;
  color: #003366;
  cursor: pointer;
  border-radius: 8px;
  transition: background 0.2s, color 0.2s;
}

.dropdown-item:hover {
  background: rgba(0, 119, 238, 0.15);
  color: #002244;
}


.dropdown-menu.show {
  display: block;
}


/* --- CHẾ ĐỘ DARK MODE (CHỦ ĐẠO TỐI/TRẮNG, ĐIỂM NHẤN XANH LÁ) --- */

body.dark-mode {
  background: url('https://frutigeraeroarchive.org/images/wallpapers/perfect_hue/perfect_hue_105.jpg') no-repeat center center fixed !important;
  background-size: cover !important;
}

/* Khung kính mờ tối màu */
body.dark-mode .dashboard-container,
body.dark-mode .main-content,
body.dark-mode .card,
body.dark-mode .sidebar {
  background: rgba(15, 23, 42, 0.75) !important;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: #e2e8f0 !important;
  /* Chữ trắng sáng chủ đạo */
}

/* Tiêu đề & nội dung chuyển về màu trắng/sáng cho dễ đọc */
body.dark-mode h1,
body.dark-mode h3,
body.dark-mode .user-name,
body.dark-mode .description,
body.dark-mode .stat-item strong,
body.dark-mode .song-title {
  color: #ffffff !important;
}

body.dark-mode .sub-text,
body.dark-mode .stat-item span {
  color: #94a3b8 !important;
}

/* --- BIẾN TOÀN BỘ MÀU XANH DƯƠNG THÀNH XANH LÁ Ở ĐÂY --- */

/* Chữ các mục menu bên trái chuyển thành xanh lá nhạt khi chưa active */
body.dark-mode .side-menu a {
  color: #86efac;
}

body.dark-mode .side-menu a:hover {
  background: rgba(34, 197, 94, 0.15);
  color: #4ade80;
}

/* Nút "Home" đang chọn (active) chuyển từ xanh dương sang GRADIENT XANH LÁ */
body.dark-mode .side-menu a.active {
  background: linear-gradient(to bottom, #4ade80, #16a34a) !important;
  color: #ffffff !important;
  box-shadow: 0 4px 10px rgba(22, 163, 74, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.4) !important;
}

/* Các chữ text điểm nhấn khác đang là xanh dương -> đổi thành xanh lá */
body.dark-mode .widget-teachers h3,
body.dark-mode .widget-ipod h3,
body.dark-mode .see-more {
  color: #4ade80 !important;
}

/* Các ô nhỏ, ipod, viền */
body.dark-mode .proj-box,
body.dark-mode .ipod-screen,
body.dark-mode .ipod-wheel,
body.dark-mode .icon-btn {
  background: rgba(30, 41, 59, 0.8) !important;
  border-color: rgba(74, 222, 128, 0.3) !important;
  /* Viền phớt xanh lá nhẹ */
  color: #e2e8f0 !important;
}

/* --- QUÉT SẠCH MẤY CHỖ XANH DƯƠNG CÒN SÓT TRONG DARK MODE --- */

/* Đổi màu dấu +, -, và hai nút tua ⏮ ⏭ sang xanh lá */
body.dark-mode .wheel-btn {
  color: #4ade80 !important;
}

/* Đổi màu chữ trạng thái nhỏ bên trong màn hình ipod (ví dụ chữ Stop) sang xanh lá nhạt */
body.dark-mode .ipod-status {
  color: #86efac !important;
}

/* Riêng nút tròn ở giữa (Play/Pause) cho nó giữ màu sáng sạch sẽ hoặc viền xanh lá nhẹ cho nổi */
body.dark-mode .wheel-btn.center {
  background: #1e293b !important;
  color: #ffffff !important;
  border: 1px solid rgba(74, 222, 128, 0.4) !important;
}


/* Làm cho toàn bộ các khối widget trong Dark Mode có độ trong suốt và hiệu ứng kính mờ (transparent blur) */
body.dark-mode .card,
body.dark-mode .sidebar,
body.dark-mode .ipod-screen,
body.dark-mode .ipod-wheel,
body.dark-mode .proj-box,
body.dark-mode .dropdown-menu {
  background: rgba(15, 23, 42, 0.45) !important;
  /* Giảm độ đậm xuống 0.45 để trong suốt hơn */
  backdrop-filter: blur(12px) !important;
  /* Tạo độ nhòe kính mờ phía sau */
  -webkit-backdrop-filter: blur(12px) !important;
  border: 1px solid rgba(255, 255, 255, 0.15) !important;
  /* Viền sáng nhẹ giả lập kính */
}

/* Riêng cái khung container bọc ngoài cùng nếu muốn nó trong suốt luôn thì chỉnh chỗ này */
body.dark-mode .dashboard-container {
  background: transparent !important;
  /* Hoặc để mờ rất nhẹ như rgba(15, 23, 42, 0.2) */
  backdrop-filter: none;
}

/* --- SỬA LẠI DROPDOWN MENU TRONG DARK MODE --- */

body.dark-mode .dropdown-menu {
  background: rgba(15, 23, 42, 0.85) !important;
  /* Làm nền menu đậm hơn xíu cho dễ đọc chữ */
  backdrop-filter: blur(12px) !important;
  -webkit-backdrop-filter: blur(12px) !important;
  border: 1px solid rgba(74, 222, 128, 0.3) !important;
  /* Viền phớt xanh lá nhẹ */
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.5) !important;
}

/* Biến màu chữ trong menu thành trắng sáng / xanh lá nhạt */
body.dark-mode .dropdown-item {
  color: #e2e8f0 !important;
  /* Chữ trắng sáng chủ đạo */
  font-family: 'Varela Round', sans-serif;
}

/* Hiệu ứng khi rê chuột vào từng mục trong menu */
body.dark-mode .dropdown-item:hover {
  background: rgba(34, 197, 94, 0.2) !important;
  /* Nền xanh lá mờ khi hover */
  color: #4ade80 !important;
  /* Chữ chuyển xanh lá nổi bật */
}


/* Thêm transition cho mọi thành phần khi chuyển theme */
body,
.card,
.sidebar,
.dashboard-container,
.main-content,
.dropdown-menu,
.ipod-screen,
.ipod-wheel,
.proj-box,
.side-menu a,
.icon-btn {
  transition: background-color 0.4s ease, color 0.4s ease, border-color 0.4s ease, box-shadow 0.4s ease !important;
}



.widget-schedule {
  min-height: 220px;
  /* Ép nó cao và dài hơn mấy khối khác */
  line-height: 1.6;
}