/* Import font anime */
@import url('https://fonts.googleapis.com/css2?family=MPLUS+Rounded+1c:wght@400;700&display=swap');

/* Giao diện chung */
body {
  font-family: 'MPLUS Rounded 1c', sans-serif;
  background: linear-gradient(135deg, #ffb6c1, #87ceeb) url('https://4kwallpapers.com/images/walls/thumbs_3t/21360.jpg') no-repeat center/cover;
  background-color: #ffb6c1;
  color: #2d2d2d;
  margin: 10px auto;
  padding: 20px;
  max-width: 900px;
  box-shadow: 0 5px 20px rgba(0, 0, 0, 0.3);
  border-radius: 20px;
  transition: background-color 0.5s ease, color 0.5s ease, box-shadow 0.5s ease; /* Chỉ transition các thuộc tính cụ thể */
}
/* Theme tối - áp dụng toàn bộ */
[data-theme="dark"] {
  background: linear-gradient(135deg, #1a1a2e, #2a1b4a); /* Bỏ phần hình ảnh để thử */
  color: #e0e0e0;
  box-shadow: 0 5px 20px rgba(0, 0, 0, 0.7);
}
/* Tiêu đề */
h1 {
  color: #ff69b4;
  text-align: center;
  font-size: 32px;
  text-shadow: 0 0 10px rgba(255, 105, 180, 0.8);
  margin-bottom: 30px;
  animation: glowPulse 2s infinite alternate;
}

[data-theme="dark"] h1 {
  color: #00ced1;
  text-shadow: 0 0 12px rgba(0, 206, 209, 0.8);
}

/* Thanh tìm kiếm */
.search-container {
  position: relative;
  width: 60%;
  max-width: 400px;
  margin: 0 auto 30px auto;
  display: flex;
  align-items: center;
  background: transparent;
}

[data-theme="dark"] .search-container {
  background: transparent;
}

.search-icon {
  position: absolute;
  left: 15px;
  font-size: 20px;
  color: #ff69b4;
  z-index: 1;
  transition: all 0.3s ease;
}

[data-theme="dark"] .search-icon {
  color: #00ced1;
}

#searchInput {
  padding: 10px 20px 10px 45px;
  width: 100%;
  font-size: 16px;
  border: 2px solid #ff69b4;
  border-radius: 30px;
  background: rgba(255, 255, 255, 0.95);
  color: #333;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2), inset 0 0 5px rgba(255, 105, 180, 0.3);
  transition: all 0.3s ease;
}

[data-theme="dark"] #searchInput {
  background: #1a1a2e !important; /* Tối hơn, ghi đè chắc chắn */
  color: #e0e0e0 !important;
  border-color: #00ced1 !important;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3), inset 0 0 5px rgba(0, 206, 209, 0.3) !important;
}

#searchInput:focus {
  outline: none;
  border-color: #ffb6c1;
  box-shadow: 0 0 15px rgba(255, 105, 180, 0.8), inset 0 0 5px rgba(255, 105, 180, 0.5);
  width: 110%;
}

[data-theme="dark"] #searchInput:focus {
  border-color: #87ceeb !important;
  box-shadow: 0 0 15px rgba(0, 206, 209, 0.8), inset 0 0 5px rgba(0, 206, 209, 0.5) !important;
}

/* Container bảng */
.table-container {
  width: 100%;
  margin-bottom: 20px;
  background: transparent;
}

[data-theme="dark"] .table-container {
  background: transparent;
}

/* Bảng */
table {
  width: 100%;
  border-collapse: collapse;
  background: rgba(255, 255, 255, 0.9);
  border-radius: 15px;
  box-shadow: 0 5px 20px rgba(0, 0, 0, 0.2);
  table-layout: fixed;
}

[data-theme="dark"] table {
  background: #1a1a2e !important; /* Tối hơn, ghi đè chắc chắn */
  border: 1px solid rgba(0, 206, 209, 0.2) !important;
  box-shadow: 0 5px 20px rgba(0, 0, 0, 0.5) !important;
}

th, td {
  padding: 12px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  text-align: left;
  font-size: 14px;
  word-wrap: break-word;
}

th {
  background: linear-gradient(90deg, #ff69b4, #ffb6c1);
  color: #fff;
  font-weight: bold;
  text-transform: uppercase;
}

[data-theme="dark"] th {
  background: linear-gradient(90deg, #4b0082, #00ced1) !important;
  color: #e0e0e0 !important;
}

td {
  color: #2d2d2d;
}

[data-theme="dark"] td {
  color: #e0e0e0 !important;
  border-color: rgba(0, 206, 209, 0.2) !important;
}

tr:hover {
  background: rgba(255, 182, 193, 0.4);
}

[data-theme="dark"] tr:hover {
  background: rgba(0, 206, 209, 0.4) !important;
}

/* Cột STT */
.stt-column {
  width: 8%;
  text-align: center;
  font-weight: bold;
  color: #ff69b4;
}

[data-theme="dark"] .stt-column {
  color: #00ced1 !important;
}

/* Tỷ lệ cột */
#tableHeader th:nth-child(2) { width: 25%; }
#tableHeader th:nth-child(3) { width: 15%; }
#tableHeader th:nth-child(4) { width: 15%; }
#tableHeader th:nth-child(5) { width: 20%; }
#tableHeader th:nth-child(6) { width: 17%; }

/* Nút chuyển theme */
#themeToggle {
  text-align: right;
  margin-bottom: 20px;
}

#toggleThemeBtn {
  width: 40px;
  height: 40px;
  background: rgba(255, 255, 255, 0.9);
  border-radius: 50%;
  border: none;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s ease;
}

[data-theme="dark"] #themeToggle {
  text-align: right;
}

[data-theme="dark"] #toggleThemeBtn {
  background: #1a1a2e !important;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.4) !important;
}

#toggleThemeBtn:hover {
  transform: scale(1.2) rotate(360deg);
  box-shadow: 0 0 15px rgba(255, 105, 180, 0.7);
}

[data-theme="dark"] #toggleThemeBtn:hover {
  box-shadow: 0 0 15px rgba(0, 206, 209, 0.7) !important;
}

.sun-icon, .moon-icon {
  font-size: 24px;
  color: #ff69b4;
}

[data-theme="dark"] .sun-icon,
[data-theme="dark"] .moon-icon {
  color: #00ced1 !important;
}

.sun-icon { display: inline-block; }
.moon-icon { display: none; }
[data-theme="dark"] .sun-icon { display: none; }
[data-theme="dark"] .moon-icon { display: inline-block; }

/* Animation */
@keyframes glowPulse {
  0% { text-shadow: 0 0 10px rgba(255, 105, 180, 0.8); }
  100% { text-shadow: 0 0 20px rgba(255, 105, 180, 0.4); }
}

[data-theme="dark"] h1 {
  animation: glowPulseDark 2s infinite alternate;
}

@keyframes glowPulseDark {
  0% { text-shadow: 0 0 10px rgba(0, 206, 209, 0.8); }
  100% { text-shadow: 0 0 20px rgba(0, 206, 209, 0.4); }
}

/* Responsive */
@media (max-width: 768px) {
  body { padding: 10px; }
  h1 { font-size: 24px; }
  .search-container { width: 80%; }
  #searchInput { 
    font-size: 14px; 
    padding: 8px 16px 8px 40px;
  }
  #searchInput:focus { width: 100%; }
  .search-icon { left: 12px; font-size: 18px; }
  
  .table-container {
    width: 100%;
  }
  
  table {
    font-size: 12px;
    table-layout: fixed;
  }
  
  th, td {
    padding: 8px;
    font-size: 12px;
    word-wrap: break-word;
  }
  
  .stt-column {
    width: 10%;
  }
  
  #tableHeader th:nth-child(2) { width: 30%; }
  #tableHeader th:nth-child(3) { width: 15%; }
  #tableHeader th:nth-child(4) { width: 15%; }
  #tableHeader th:nth-child(5) { width: 20%; }
  #tableHeader th:nth-child(6) { width: 20%; }
  
  #toggleThemeBtn { width: 32px; height: 32px; }
}
