body {
    font-family: 'Poppins', 'Arial', '微軟正黑體', sans-serif;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    color: #343a40;
    position: relative;
}

body::before {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='100' height='100' viewBox='0 0 100 100'%3E%3Cg fill-rule='evenodd'%3E%3Cg fill='%23000000' fill-opacity='0.02'%3E%3Cpath opacity='.5' d='M96 95h4v1h-4v4h-1v-4h-9v4h-1v-4h-9v4h-1v-4h-9v4h-1v-4H0v-1h15v-9H0v-1h15v-9H0v-1h15v-9H0v-1h15V0h1v15h9V0h1v15h9V0h1v15h9V0h1v15h4v1h-4v9h4v1h-4v9h4v1h-4v9zm-1 0v-9h-9v9h9zm-10 0v-9h-9v9h9zm-10 0v-9h-9v9h9zm-10 0v-9h-9v9h9zm-10 0v-9h-9v9h9zm-10 0v-9h-9v9h9zm-9-10h9v-9h-9v9zm10 0h9v-9h-9v9zm10 0h9v-9h-9v9zm10 0h9v-9h-9v9zm10 0h9v-9h-9v9zm10 0h9v-9h-9v9z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E") repeat;
  z-index: -1;
}

:root {
  --primary-color: #0d6efd;
  --secondary-color: #6c757d;
  --success-color: #198754;
  --info-color: #0dcaf0;
  --warning-color: #ffc107;
  --danger-color: #dc3545;
  --light-color: #f8f9fa;
  --dark-color: #212529;
  --animation-timing: cubic-bezier(0.175, 0.885, 0.32, 1.275);
  --card-shadow: 0 8px 20px rgba(0, 0, 0, 0.12);
  --accent-gradient: linear-gradient(120deg, #0d6efd, #6610f2);
  --modern-shadow: 0 10px 30px -15px rgba(0, 0, 0, 0.2);
  --transition-smooth: all 0.4s cubic-bezier(0.165, 0.84, 0.44, 1);
}

.container {
    max-width: 1200px;
    padding: 0 15px;
}

.card {
  border-radius: 18px;
  box-shadow: var(--card-shadow);
  backdrop-filter: blur(5px);
  background-color: rgba(255, 255, 255, 0.95);
  border: 1px solid rgba(255, 255, 255, 0.18);
  overflow: hidden;
  transition: var(--transition-smooth);
}

.card:hover {
  transform: translateY(-10px);
  box-shadow: var(--modern-shadow);
}

.glass-card {
  background: rgba(255, 255, 255, 0.7);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.3);
  box-shadow: 0 8px 32px rgba(31, 38, 135, 0.1);
}

.card-header {
    border-bottom: none;
    padding: 18px 25px;
    font-weight: 600;
}

.card-body {
    padding: 25px;
}

.gradient-card-header {
  background: linear-gradient(120deg, #0d6efd, #6610f2);
  position: relative;
  overflow: hidden;
  padding: 20px 25px;
  color: white;
  font-weight: 700;
  text-shadow: 0 2px 3px rgba(0, 0, 0, 0.2);
}

.gradient-card-header::before {
  content: '';
  position: absolute;
  top: -50%;
  right: -50%;
  bottom: -50%;
  left: -50%;
  background: linear-gradient(to bottom, rgba(255, 255, 255, 0) 0%, rgba(255, 255, 255, 0.15) 100%);
  transform: rotateZ(60deg) translate(-5em, 7.5em);
  animation: shimmer 3s infinite;
  pointer-events: none;
}

.success-gradient-header {
  background: linear-gradient(120deg, #198754, #20c997);
  position: relative;
  overflow: hidden;
}

.success-gradient-header::before {
  content: '';
  position: absolute;
  top: -50%;
  right: -50%;
  bottom: -50%;
  left: -50%;
  background: linear-gradient(to bottom, rgba(255, 255, 255, 0) 0%, rgba(255, 255, 255, 0.15) 100%);
  transform: rotateZ(60deg) translate(-5em, 7.5em);
  animation: shimmer 3.5s infinite;
  pointer-events: none;
}

.info-gradient-header {
  background: linear-gradient(120deg, #0dcaf0, #6f42c1);
  position: relative;
  overflow: hidden;
}

.info-gradient-header::before {
  content: '';
  position: absolute;
  top: -50%;
  right: -50%;
  bottom: -50%;
  left: -50%;
  background: linear-gradient(to bottom, rgba(255, 255, 255, 0) 0%, rgba(255, 255, 255, 0.15) 100%);
  transform: rotateZ(60deg) translate(-5em, 7.5em);
  animation: shimmer 4s infinite;
  pointer-events: none;
}

.warning-gradient-header {
  background: linear-gradient(120deg, #fd7e14, #ffc107);
  position: relative;
  overflow: hidden;
  color: white;
  font-weight: 700;
  text-shadow: 0 2px 3px rgba(0, 0, 0, 0.2);
}

.warning-gradient-header::before {
  content: '';
  position: absolute;
  top: -50%;
  right: -50%;
  bottom: -50%;
  left: -50%;
  background: linear-gradient(to bottom, rgba(255, 255, 255, 0) 0%, rgba(255, 255, 255, 0.15) 100%);
  transform: rotateZ(60deg) translate(-5em, 7.5em);
  pointer-events: none;
}

@keyframes shimmer {
  0% {
    transform: rotateZ(60deg) translate(-5em, 7.5em);
  }
  100% {
    transform: rotateZ(60deg) translate(5em, -7.5em);
  }
}

@keyframes pulse-glow {
  0% {
    box-shadow: 0 0 0 0 rgba(13, 110, 253, 0.4);
  }
  70% {
    box-shadow: 0 0 0 10px rgba(13, 110, 253, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(13, 110, 253, 0);
  }
}

.pulse-effect {
  animation: pulse-glow 2s infinite;
}

.school-tag {
  margin: 4px;
  padding: 8px 14px;
  border-radius: 30px;
  font-weight: 500;
  letter-spacing: 0.3px;
  transition: var(--transition-smooth);
  background: linear-gradient(120deg, #f8f9fa, #e9ecef);
  border: 1px solid rgba(0, 0, 0, 0.05);
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
}

.school-tag:hover {
  background: linear-gradient(120deg, #6c757d, #495057);
  color: white;
  transform: translateY(-3px) scale(1.05);
  box-shadow: 0 5px 10px rgba(0, 0, 0, 0.1);
}

.school-tag.active {
  background: linear-gradient(120deg, #0d6efd, #6610f2);
  color: white;
  transform: translateY(-3px) scale(1.05);
  box-shadow: 0 5px 15px rgba(13, 110, 253, 0.3);
}

.score-badge {
  font-size: 0.8rem;
  padding: 4px 8px;
  border-radius: 30px;
  font-weight: 600;
  display: inline-block;
  margin-bottom: 2px;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
  transition: all 0.3s;
  white-space: nowrap;
  background-color: #f0f0f0;
  color: #333;
}

.score-badge:hover {
  transform: translateY(-2px);
  box-shadow: 0 5px 10px rgba(0, 0, 0, 0.15);
}

.score-A++, .score-A+, .score-A, .score-B++, .score-B+, .score-B, .score-C {
  background-color: #f0f0f0;
  color: #333;
}

.composition-badge {
  font-size: 0.8rem;
  padding: 4px 8px;
  border-radius: 30px;
  font-weight: 600;
  display: inline-block;
  margin-bottom: 2px;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
  transition: all 0.3s;
  white-space: nowrap;
  background-color: #f0f0f0;
  color: #333;
}

.composition-0, .composition-1, .composition-2, .composition-3, 
.composition-4, .composition-5, .composition-6 {
  background-color: #f0f0f0;
  color: #333;
}

.score-display {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.score-group {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-bottom: 2px;
}

.score-group.languages .score-badge,
.score-group.math .score-badge,
.score-group.sciences .score-badge {
  background-color: #f0f0f0;
  color: #333;
}

#stats-chart rect {
    transition: all 0.3s;
    border-radius: 4px 4px 0 0;
}

#stats-chart rect:hover {
    opacity: 0.8;
    filter: brightness(1.1);
}

#score-form label, #search-form label {
    font-weight: 600;
    margin-bottom: 6px;
    color: #495057;
}

.form-control, .form-select {
  border-radius: 12px;
  padding: 12px 18px;
  border: 1px solid rgba(0, 0, 0, 0.08);
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
  transition: var(--transition-smooth);
  background-color: rgba(255, 255, 255, 0.9);
}

.form-control:focus, .form-select:focus {
  box-shadow: 0 0 0 4px rgba(13, 110, 253, 0.2);
  border-color: var(--primary-color);
  transform: translateY(-2px);
}

.btn {
  overflow: hidden;
  position: relative;
  z-index: 1;
  transition: all 0.3s ease;
}

.btn::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, rgba(255,255,255,0) 0%, rgba(255,255,255,0.3) 50%, rgba(255,255,255,0) 100%);
  z-index: -1;
  transition: all 0.6s;
}

.btn:hover::before {
  left: 100%;
}

.card-3d {
  transition: transform 0.5s ease;
  transform-style: preserve-3d;
}

.card-3d:hover {
  transform: rotateY(5deg) rotateX(5deg) translateZ(10px);
}

.float-element {
  animation: float-animation 3s ease-in-out infinite;
}

@keyframes float-animation {
  0% {
    transform: translateY(0px);
  }
  50% {
    transform: translateY(-10px);
  }
  100% {
    transform: translateY(0px);
  }
}

.enhanced-badge {
  border-radius: 30px;
  padding: 8px 15px;
  font-weight: 600;
  letter-spacing: 0.5px;
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.1);
  transition: all 0.3s ease;
  background-image: var(--accent-gradient);
  color: white;
}

.enhanced-badge:hover {
  transform: translateY(-3px) scale(1.05);
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}

.glow-on-hover:hover {
  box-shadow: 0 0 15px rgba(13, 110, 253, 0.5);
}

.gradient-text {
  background: var(--accent-gradient);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  font-weight: 700;
}

.table {
  border-collapse: separate;
  border-spacing: 0;
}

.table thead th {
  background: linear-gradient(180deg, #f8f9fa, #e9ecef);
  color: #495057;
  font-weight: 600;
  padding: 18px 15px;
  position: relative;
  border-bottom: 2px solid rgba(0, 0, 0, 0.05);
}

.table tbody tr {
  transition: all 0.3s;
  position: relative;
}

.table tbody tr:hover {
  background-color: rgba(13, 110, 253, 0.05);
  transform: scale(1.01);
  z-index: 1;
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.05);
}

header {
  padding: 40px 0 30px;
  position: relative;
}

header h1 {
  font-weight: 800;
  color: #0d6efd;
  text-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
  position: relative;
  display: inline-block;
  margin-bottom: 15px;
}

header h1::after {
  content: '';
  position: absolute;
  bottom: -15px;
  left: 50%;
  transform: translateX(-50%);
  width: 120px;
  height: 5px;
  background: linear-gradient(90deg, #0d6efd, #6610f2);
  border-radius: 3px;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

header p {
  font-size: 1.2rem;
  color: #6c757d;
  max-width: 600px;
  margin: 20px auto 0;
}

footer {
  padding: 20px 0;
  border-top: 1px solid #dee2e6;
  margin-top: 30px;
}

.sidebar-menu {
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(10px);
  border-left: 1px solid rgba(255, 255, 255, 0.18);
  box-shadow: -5px 0 25px rgba(0, 0, 0, 0.15);
}

.sidebar-menu .menu-item {
  border-radius: 12px;
  margin: 10px 0;
  padding: 12px 20px;
  transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  font-weight: 500;
  letter-spacing: 0.3px;
}

.sidebar-menu .menu-item:hover,
.sidebar-menu .menu-item.active {
  background: linear-gradient(120deg, #f1f3f5, #e9ecef);
  color: var(--primary-color);
  transform: translateX(-5px) scale(1.02);
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.05);
}

.sidebar-menu .menu-item i {
  transition: all 0.3s;
}

.sidebar-menu .menu-item:hover i,
.sidebar-menu .menu-item.active i {
  transform: scale(1.2);
}

.api-alert {
  border-radius: 15px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
  backdrop-filter: blur(10px);
  background-color: rgba(255, 255, 255, 0.95);
  border: 1px solid rgba(255, 255, 255, 0.18);
  animation: slideIn 0.5s forwards, fadeOut 0.5s 2.5s forwards;
}

@keyframes slideIn {
  from {
    transform: translateX(100%);
    opacity: 0;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}

@keyframes fadeOut {
  from {
    opacity: 1;
  }
  to {
    opacity: 0;
  }
}

.api-alert.success {
  border-left: 5px solid var(--success-color);
}

.api-alert.error {
  border-left: 5px solid var(--danger-color);
}

#loading-overlay {
  backdrop-filter: blur(8px);
  background-color: rgba(255, 255, 255, 0.9);
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  transition: opacity 0.5s;
}

.loading-animation {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  transition: all 0.5s cubic-bezier(0.19, 1, 0.22, 1);
}

.loading-animation.completed {
  transform: scale(1.1);
}

.loading-circles {
  display: flex;
  margin-bottom: 15px;
}

.loading-circles .circle {
  width: 15px;
  height: 15px;
  margin: 0 5px;
  border-radius: 50%;
  background-color: var(--primary-color);
  animation: soft-bounce 1.5s infinite ease-in-out;
}

@keyframes soft-bounce {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-15px); }
}

.loading-text {
  font-size: 1.2rem;
  font-weight: 500;
  color: #495057;
  margin-bottom: 15px;
  letter-spacing: 1px;
}

.loading-progress {
  width: 200px;
  height: 4px;
  background-color: rgba(13, 110, 253, 0.2);
  border-radius: 10px;
  overflow: hidden;
  position: relative;
}

.progress-bar {
  height: 100%;
  width: 0;
  background: linear-gradient(90deg, #0d6efd, #6610f2);
  border-radius: 10px;
  transition: width 0.3s ease;
  position: absolute;
  top: 0;
  left: 0;
}

#helpModal .modal-content {
  border-radius: 20px;
  box-shadow: 0 15px 35px rgba(0, 0, 0, 0.2);
  border: none;
  overflow: hidden;
}

#helpModal .modal-header {
  background: linear-gradient(120deg, #0d6efd, #6610f2);
  color: white;
  padding: 20px 25px;
  border-bottom: none;
}

#helpModal .modal-title {
  font-weight: 700;
  display: flex;
  align-items: center;
}

#helpModal .modal-title i {
  margin-right: 10px;
  font-size: 1.2em;
}

#helpModal .modal-body {
  padding: 25px;
}

#helpModal .modal-footer {
  border-top: none;
  padding: 15px 25px 20px;
}

.guide-steps {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 20px;
}

.guide-step-btn {
  flex: 1;
  min-width: 80px;
  padding: 12px 15px;
  border-radius: 12px;
  border: 1px solid rgba(0, 0, 0, 0.08);
  background-color: #f8f9fa;
  font-weight: 500;
  text-align: center;
  cursor: pointer;
  transition: all 0.3s;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.guide-step-btn i {
  font-size: 1.5rem;
  margin-bottom: 8px;
  color: #6c757d;
  transition: all 0.3s;
}

.guide-step-btn:hover {
  background-color: #e9ecef;
  transform: translateY(-3px);
}

.guide-step-btn.active {
  background: linear-gradient(120deg, #0d6efd, #6610f2);
  color: white;
  border-color: transparent;
  transform: translateY(-3px);
  box-shadow: 0 5px 15px rgba(13, 110, 253, 0.3);
}

.guide-step-btn.active i {
  color: white;
  transform: scale(1.1);
}

.guide-step-content {
  display: none;
  opacity: 0;
  transition: opacity 0.3s;
}

.guide-step-content.active {
  display: block;
}

.guide-step-content h5 {
  font-weight: 600;
  margin-bottom: 15px;
  color: #0d6efd;
  display: flex;
  align-items: center;
}

.guide-step-content h5 i {
  margin-right: 10px;
}

.guide-tip {
  background-color: rgba(13, 110, 253, 0.1);
  border-left: 4px solid #0d6efd;
  padding: 15px;
  border-radius: 8px;
  margin: 15px 0;
}

.guide-tip.warning {
  background-color: rgba(255, 193, 7, 0.1);
  border-left-color: #ffc107;
}

.guide-image {
  border-radius: 12px;
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
  max-width: 100%;
  height: auto;
  margin: 15px 0;
}

.feature-card {
  background-color: #f8f9fa;
  padding: 15px;
  border-radius: 12px;
  margin-bottom: 15px;
  transition: all 0.3s;
  border: 1px solid rgba(0, 0, 0, 0.05);
}

.feature-card:hover {
  background-color: white;
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.08);
  transform: translateY(-3px);
}

.feature-icon {
  width: 50px;
  height: 50px;
  border-radius: 12px;
  background: linear-gradient(120deg, #0d6efd, #6610f2);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 15px;
  color: white;
  font-size: 1.5rem;
}

.user-guide-tooltip {
  position: absolute;
  background: rgba(255, 255, 255, 0.98);
  border-radius: 10px;
  padding: 15px;
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
  max-width: 250px;
  z-index: 1000;
  animation: tooltip-pulse 2s infinite;
  pointer-events: none;
}

.user-guide-tooltip::after {
  content: '';
  position: absolute;
  width: 15px;
  height: 15px;
  background: rgba(255, 255, 255, 0.98);
  transform: rotate(45deg);
}

.user-guide-tooltip.top::after {
  bottom: -7px;
  left: 50%;
  margin-left: -7px;
}

.user-guide-tooltip.bottom::after {
  top: -7px;
  left: 50%;
  margin-left: -7px;
}

.user-guide-tooltip.left::after {
  right: -7px;
  top: 50%;
  margin-top: -7px;
}

.user-guide-tooltip.right::after {
  left: -7px;
  top: 50%;
  margin-top: -7px;
}

@keyframes tooltip-pulse {
  0% {
    transform: scale(1);
    box-shadow: 0 0 0 0 rgba(13, 110, 253, 0.4);
  }
  70% {
    transform: scale(1);
    box-shadow: 0 0 0 10px rgba(13, 110, 253, 0);
  }
  100% {
    transform: scale(1);
    box-shadow: 0 0 0 0 rgba(13, 110, 253, 0);
  }
}

.animated-btn {
  overflow: hidden;
  position: relative;
  z-index: 1;
}

.animated-btn::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, rgba(255,255,255,0) 0%, rgba(255,255,255,0.2) 50%, rgba(255,255,255,0) 100%);
  z-index: -1;
  transition: all 0.6s;
}

.animated-btn:hover::before {
  left: 100%;
}

.navbar {
  background-color: #ffffff;
  box-shadow: 0 2px 10px rgba(0,0,0,0.1);
  padding: 15px 0;
  transition: all 0.3s ease;
}

.navbar-brand {
  font-weight: 700;
  color: #0d6efd;
  font-size: 1.4rem;
}

.navbar-brand i {
  margin-right: 10px;
}

.navbar-toggler {
  border: none;
  padding: 0;
  display: none;
}

.navbar-toggler:focus {
  box-shadow: none;
}

.nav-link {
  color: #495057;
  font-weight: 500;
  padding: 10px 15px;
  transition: all 0.3s;
  position: relative;
}

.nav-link:hover, .nav-link.active {
  color: #0d6efd;
}

.nav-link::after {
  content: '';
  position: absolute;
  width: 0;
  height: 2px;
  bottom: 0;
  left: 50%;
  background-color: #0d6efd;
  transition: all 0.3s;
}

.nav-link:hover::after, .nav-link.active::after {
  width: 80%;
  left: 10%;
}

.navbar-scroll {
  padding: 8px 0;
  box-shadow: 0 3px 15px rgba(0,0,0,0.15);
}

.menu-btn {
  border-radius: 20px;
  padding: 8px 20px;
  margin-left: 10px;
}

@media (max-width: 768px) {
  .menu-btn {
    margin-top: 10px;
    margin-left: 0;
  }
  
  .navbar-collapse {
    padding: 15px 0;
  }
  
  .nav-link::after {
    display: none;
  }
  
  .nav-link {
    padding: 10px 0;
    margin: 5px 0;
  }
}

.sidebar-menu {
  position: fixed;
  top: 0;
  right: -300px;
  width: 300px;
  height: 100%;
  background-color: #ffffff;
  box-shadow: -5px 0 15px rgba(0,0,0,0.1);
  transition: right 0.3s ease;
  z-index: 1050;
  overflow-y: auto;
  padding: 20px;
}

.sidebar-menu.active {
  right: 0;
}

.sidebar-menu .close-btn {
  position: absolute;
  top: 15px;
  right: 15px;
  background: none;
  border: none;
  font-size: 1.5rem;
  cursor: pointer;
  color: #6c757d;
}

.sidebar-menu .menu-item {
  display: block;
  padding: 12px 15px;
  margin: 8px 0;
  border-radius: 10px;
  color: #343a40;
  font-weight: 500;
  transition: all 0.3s;
  text-decoration: none;
}

.sidebar-menu .menu-item:hover, 
.sidebar-menu .menu-item.active {
  background-color: #f8f9fa;
  color: #0d6efd;
  transform: translateX(-5px);
}

.sidebar-menu .menu-item i {
  margin-right: 10px;
  width: 20px;
  text-align: center;
}

.sidebar-menu .menu-btn {
  display: block;
  width: 100%;
  margin-top: 15px;
}

.sidebar-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0,0,0,0.4);
  z-index: 1040;
  display: none;
}

.sidebar-overlay.active {
  display: block;
}

.menu-toggle-btn {
  background: none;
  border: none;
  font-size: 1.5rem;
  cursor: pointer;
  color: #0d6efd;
  transition: all 0.3s;
}

.menu-toggle-btn:hover {
  transform: scale(1.1);
}

@media (max-width: 768px) {
  .sidebar-menu {
    width: 260px;
  }
  
  .menu-item {
    padding: 10px;
  }
}

@media (max-width: 576px) {
  .guide-steps {
    flex-wrap: nowrap;
    overflow-x: auto;
    padding-bottom: 10px;
    -webkit-overflow-scrolling: touch;
  }
  
  .guide-step-btn {
    min-width: 120px;
    flex: 0 0 auto;
  }
  
  #helpModal .modal-dialog {
    margin: 0.5rem;
  }
  
  .score-badge, .composition-badge {
    font-size: 0.75rem;
    padding: 3px 6px;
  }
  
  .mobile-row .score-badge, .mobile-row .composition-badge {
    display: inline-flex;
    align-items: center;
  }
  
  .score-display {
    gap: 3px;
  }
}

.region-filter {
  display: flex;
  overflow-x: auto;
  padding-bottom: 10px;
  margin-bottom: 15px;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
  scrollbar-color: rgba(13, 110, 253, 0.2) transparent;
}

.region-filter::-webkit-scrollbar {
  height: 4px;
}

.region-filter::-webkit-scrollbar-track {
  background: rgba(0, 0, 0, 0.05);
  border-radius: 10px;
}

.region-filter::-webkit-scrollbar-thumb {
  background-color: rgba(13, 110, 253, 0.2);
  border-radius: 10px;
}

.region-btn {
  overflow: hidden;
  flex: 0 0 auto;
  margin-right: 8px;
  padding: 8px 14px;
  border-radius: 30px;
  border: 1px solid rgba(0, 0, 0, 0.1);
  background: #f8f9fa;
  color: #495057;
  font-size: 0.9rem;
  font-weight: 500;
  transition: all 0.3s;
  white-space: nowrap;
  cursor: pointer;
}

.region-btn.active {
  background: linear-gradient(120deg, #0d6efd, #6610f2);
  color: white;
  box-shadow: 0 2px 6px rgba(13, 110, 253, 0.3);
  transform: translateY(-2px);
}

.region-btn:hover:not(.active) {
  background: #e9ecef;
  transform: translateY(-2px);
}

@media (max-width: 576px) {
  .region-filter {
    padding-bottom: 15px;
  }
  
  .region-btn {
    padding: 6px 12px;
    font-size: 0.85rem;
  }
}

#department optgroup {
  color: #495057;
  font-weight: 600;
  background-color: #f8f9fa;
}

#department option {
  font-weight: normal;
  padding: 8px 5px;
}

#department {
  max-height: 300px;
}

.filter-container {
  margin-bottom: 20px;
}

.filter-title {
  font-weight: 600;
  margin-bottom: 10px;
  display: flex;
  align-items: center;
}

.filter-title i {
  margin-right: 8px;
}

.filter-group {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 15px;
}

.filter-chip {
  display: inline-flex;
  align-items: center;
  padding: 6px 12px;
  background: #f8f9fa;
  border: 1px solid rgba(0,0,0,0.1);
  border-radius: 30px;
  font-size: 0.9rem;
  cursor: pointer;
  transition: all 0.3s;
}

.filter-chip.active {
  background: linear-gradient(120deg, #0d6efd, #6610f2);
  color: white;
  border-color: transparent;
  box-shadow: 0 2px 6px rgba(13, 110, 253, 0.3);
}

.filter-chip i {
  margin-right: 6px;
}

.filter-chip:hover:not(.active) {
  background: #e9ecef;
  transform: translateY(-2px);
}

.score-filter {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 15px;
}

.score-filter-btn {
  border-radius: 30px;
  padding: 6px 12px;
  font-size: 0.85rem;
  border: 1px solid rgba(0,0,0,0.1);
  background: #f8f9fa;
  transition: all 0.3s;
  cursor: pointer;
}

.score-filter-btn.active {
  background: linear-gradient(120deg, #0d6efd, #6610f2);
  color: white;
  box-shadow: 0 2px 6px rgba(13, 110, 253, 0.3);
}

.clear-filters {
  font-size: 0.9rem;
  color: #6c757d;
  display: inline-flex;
  align-items: center;
  cursor: pointer;
  transition: all 0.3s;
  padding: 5px 10px;
  border-radius: 5px;
}

.clear-filters:hover {
  background: rgba(108, 117, 125, 0.1);
  color: #495057;
}

.clear-filters i {
  margin-right: 5px;
}

@media (max-width: 576px) {
  .filter-group {
    gap: 6px;
  }
  
  .filter-chip {
    padding: 4px 10px;
    font-size: 0.8rem;
  }
}

.h-captcha {
  display: flex;
  justify-content: center;
  margin: 10px 0;
  transition: all 0.3s;
}

.h-captcha:hover {
  transform: scale(1.02);
}

#captcha-error {
  opacity: 0;
  animation: fadeIn 0.3s forwards;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

#results-table tr, #results-table .mobile-row {
  border-bottom: 1px solid rgba(0, 0, 0, 0.05);
  transition: all 0.3s ease;
  background-color: #ffffff;
}

#results-table tr:not(:last-child), #results-table .mobile-row:not(:last-child) {
  margin-bottom: 8px;
}

#results-table tr:hover, #results-table .mobile-row:hover {
  background-color: #f8f8f8;
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.05);
  border-radius: 6px;
}

.mobile-row {
  padding: 15px;
  background: white;
  border-radius: 10px;
  margin-bottom: 12px;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
  transition: all 0.3s ease;
}

.mobile-cell {
  padding: 6px 0;
  border-bottom: 1px solid rgba(0, 0, 0, 0.04);
}

.mobile-cell:last-child {
  border-bottom: none;
}

.mobile-label {
  font-weight: 600;
  color: #6c757d;
  display: inline-block;
  min-width: 70px;
  margin-right: 10px;
}

.school-divider {
  margin-top: 15px;
  margin-bottom: 8px;
  font-size: 1rem;
  border-radius: 8px;
}

.pagination-container {
  margin-top: 15px;
  padding: 10px 15px;
  border-top: 1px solid rgba(0, 0, 0, 0.05);
}

.pagination .page-link {
  border-radius: 5px;
  margin: 0 2px;
  color: #495057;
  border: 1px solid rgba(0, 0, 0, 0.1);
  transition: all 0.2s;
}

.pagination .page-item.active .page-link {
  background: linear-gradient(120deg, #0d6efd, #6610f2);
  border-color: transparent;
  color: white;
  box-shadow: 0 2px 5px rgba(13, 110, 253, 0.3);
}

.pagination .page-link:hover:not(.active) {
  background-color: #e9ecef;
  transform: translateY(-2px);
}

.pagination .page-item.disabled .page-link {
  color: #adb5bd;
  pointer-events: none;
  background-color: #f8f9fa;
  border-color: rgba(0, 0, 0, 0.05);
}

@media (max-width: 576px) {
  .pagination-container {
    flex-direction: column;
    gap: 10px;
  }
  
  .pagination {
    order: !important;
  }
  
  .pagination .page-link {
    padding: 0.3rem 0.5rem;
    margin: 2px;
    font-size: 0.75rem;
  }
}

#results-container {
  margin-top: 15px;
}

.school-section {
  margin-bottom: 20px;
  border-radius: 10px;
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
  background-color: #fff;
}

.school-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 15px;
  background-color: #f8f9fa;
  border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}

.school-name {
  font-weight: 600;
  color: #343a40;
  font-size: 1.05rem;
}

.entry-count {
  font-weight: 500;
  font-size: 0.8rem;
}

.entries-container {
  padding: 10px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.entry-card {
  border-radius: 8px;
  border: 1px solid rgba(0, 0, 0, 0.08);
  overflow: hidden;
  transition: all 0.3s;
  background-color: #fff;
  width: 100%;
}

.entry-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.entry-header {
  padding: 10px 15px;
  border-bottom: 1px solid rgba(0, 0, 0, 0.05);
  background-color: #f8f9fa;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.department-name {
  font-weight: 600;
  color: #343a40;
  font-size: 0.95rem;
}

.entry-year {
  font-size: 0.8rem;
  color: #6c757d;
  background-color: #e9ecef;
  padding: 3px 8px;
  border-radius: 20px;
}

.entry-body {
  padding: 12px 15px;
}

.score-section {
  margin-bottom: 12px;
}

.total-score {
  display: flex;
  justify-content: space-between;
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid rgba(0, 0, 0, 0.05);
}

.total-item {
  text-align: center;
  width: 48%;
}

.total-item .label {
  font-size: 0.8rem;
  color: #6c757d;
  margin-bottom: 3px;
}

.total-item .value {
  font-weight: 600;
  color: #0d6efd;
}

.entry-footer {
  padding: 8px 15px;
  background-color: rgba(0, 0, 0, 0.02);
  border-top: 1px solid rgba(0, 0, 0, 0.05);
  font-size: 0.85rem;
  color: #495057;
}

.no-data-message {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 40px 20px;
  color: #6c757d;
  text-align: center;
  background-color: #f8f9fa;
  border-radius: 10px;
  margin: 20px 0;
}

.no-data-message i {
  font-size: 2rem;
  margin-bottom: 15px;
}

@media (max-width: 768px) {
  .entries-container {
    flex-direction: column;
    padding: 8px;
  }
  
  .school-header {
    padding: 10px 12px;
  }
  
  .school-name {
    font-size: 1rem;
  }
  
  .entry-card {
    margin-bottom: 8px;
  }
}

.table-responsive {
  display: block;
}

#results-table {
  display: none;
}

.score-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  background-color: #fff;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.05);
}

.score-table thead th {
  background-color: #f8f9fa;
  border-bottom: 2px solid #e9ecef;
  font-weight: 600;
  color: #495057;
  padding: 12px 8px;
  text-align: center;
  font-size: 0.9rem;
}

.score-table tbody tr {
  transition: all 0.2s ease;
  border-bottom: 1px solid #f1f1f1;
}

.score-table tbody tr:hover {
  background-color: rgba(0, 0, 0, 0.02);
  transform: translateY(-1px);
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
}

.score-table td {
  padding: 10px 8px;
  text-align: center;
  vertical-align: middle;
  border-top: none;
  font-size: 0.9rem;
}

.score-badge, .composition-badge {
  font-size: 0.75rem;
  padding: 3px 6px;
  border-radius: 12px;
  display: inline-block;
  white-space: nowrap;
}

@media (max-width: 768px) {
  .score-table {
    min-width: 800px;
  }
  
  .table-responsive {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  
  .score-badge, .composition-badge {
    font-size: 0.7rem;
    padding: 2px 4px;
  }
}

@media (max-width: 768px) {
  .score-table {
    min-width: 800px;
  }
  
  .table-responsive {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  
  .score-badge, .composition-badge {
    font-size: 0.7rem;
    padding: 2px 4px;
  }
}

/* Mobile-specific styles */
@media (max-width: 576px) {
  .card {
    border-radius: 12px;
    margin-bottom: 15px;
  }
  
  .card-header {
    padding: 15px 20px;
  }
  
  .card-body {
    padding: 20px;
  }
  
  .mobile-card-view {
    padding: 0;
    border-radius: 10px;
    overflow: hidden;
  }
  
  .mobile-card-view .score-table {
    display: none;
  }
  
  .mobile-entry-card {
    background: white;
    border-radius: 10px;
    margin-bottom: 15px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
    overflow: hidden;
  }
  
  .mobile-header {
    background: #f8f9fa;
    padding: 12px 15px;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
    display: flex;
    justify-content: space-between;
    align-items: center;
  }
  
  .mobile-header .school-year {
    font-size: 0.85rem;
    color: #6c757d;
    background: rgba(0, 0, 0, 0.05);
    padding: 3px 8px;
    border-radius: 20px;
  }
  
  .mobile-body {
    padding: 15px;
  }
  
  .mobile-score-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
    margin-bottom: 15px;
  }
  
  .mobile-score-item {
    text-align: center;
    border-radius: 8px;
    background: rgba(0, 0, 0, 0.02);
    padding: 8px 5px;
  }
  
  .mobile-score-label {
    font-size: 0.7rem;
    color: #6c757d;
    margin-bottom: 5px;
  }
  
  .mobile-total-box {
    background: rgba(13, 110, 253, 0.05);
    border-radius: 8px;
    padding: 10px;
    margin-top: 10px;
    display: flex;
    justify-content: space-between;
  }
  
  .mobile-total-item {
    text-align: center;
    flex: 1;
  }
  
  .mobile-total-label {
    font-size: 0.75rem;
    color: #6c757d;
  }
  
  .mobile-total-value {
    font-weight: 600;
    color: #0d6efd;
    font-size: 1.1rem;
  }
  
  .floating-btn {
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: white;
    color: #0d6efd;
    border: none;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    z-index: 1000;
    transform: scale(0);
    transition: all 0.3s;
  }
  
  .floating-btn.visible {
    transform: scale(1);
  }
  
  .floating-btn:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.2);
  }
  
  .navbar-brand {
    font-size: 1.2rem;
  }
  
  header h1 {
    font-size: 1.8rem;
  }
  
  header p {
    font-size: 1rem;
  }
  
  .filter-chip {
    padding: 4px 8px;
    font-size: 0.8rem;
  }
  
  .mobile-filter-toggle {
    position: fixed;
    bottom: 20px;
    left: 20px;
    z-index: 1000;
    background: white;
    border-radius: 50%;
    width: 50px;
    height: 50px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    color: #0d6efd;
    transition: all 0.3s;
  }
  
  .mobile-filter-toggle.active {
    background: #0d6efd;
    color: white;
  }
}

.glass-effect {
  background: rgba(255, 255, 255, 0.7);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.3);
  box-shadow: 0 8px 32px rgba(31, 38, 135, 0.1);
}

.smooth-transition {
  transition: var(--transition-smooth);
}

.hover-lift {
  transition: var(--transition-smooth);
}

.hover-lift:hover {
  transform: translateY(-5px);
  box-shadow: var(--modern-shadow);
}

.shimmer-effect {
  position: relative;
  overflow: hidden;
}

.shimmer-effect::after {
  content: '';
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  background: linear-gradient(
    90deg,
    rgba(255, 255, 255, 0) 0%,
    rgba(255, 255, 255, 0.6) 50%,
    rgba(255, 255, 255, 0) 100%
  );
  animation: shimmerAnimation 2s infinite;
}

@keyframes shimmerAnimation {
  0% {transform: translateX(-100%);}
  100% {transform: translateX(100%);}
}

/* Dark mode styles */
body.dark-mode {
  background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
  color: #e6e6e6;
}

body.dark-mode::before {
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='100' height='100' viewBox='0 0 100 100'%3E%3Cg fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.03'%3E%3Cpath opacity='.5' d='M96 95h4v1h-4v4h-1v-4h-9v4h-1v-4h-9v4h-1v-4h-9v4h-1v-4h-9v4h-1v-4H0v-1h15v-9H0v-1h15v-9H0v-1h15v-9H0v-1h15V0h1v15h9V0h1v15h9V0h1v15h9V0h1v15h4v1h-4v9h4v1h-4v9h4v1h-4v9zm-1 0v-9h-9v9h9zm-10 0v-9h-9v9h9zm-10 0v-9h-9v9h9zm-10 0v-9h-9v9h9zm-10 0v-9h-9v9h9zm-10 0v-9h-9v9h9zm-9-10h9v-9h-9v9zm10 0h9v-9h-9v9zm10 0h9v-9h-9v9zm10 0h9v-9h-9v9zm10 0h9v-9h-9v9zm10 0h9v-9h-9v9z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E") repeat;
}

body.dark-mode .card {
  background-color: rgba(30, 32, 44, 0.95);
  border-color: rgba(60, 60, 70, 0.18);
}

body.dark-mode .table thead th {
  background: linear-gradient(180deg, #2a2a40, #212130);
  color: #e6e6e6;
}

body.dark-mode .modal-content {
  background-color: #1e1e2d;
  color: #e6e6e6;
}

body.dark-mode .form-control, 
body.dark-mode .form-select {
  background-color: rgba(30, 32, 44, 0.8);
  border-color: rgba(60, 60, 70, 0.5);
  color: #e6e6e6;
}

body.dark-mode .navbar,
body.dark-mode .modal-content,
body.dark-mode .sidebar-menu {
  background-color: rgba(30, 32, 44, 0.95);
}

body.dark-mode .text-muted {
  color: #abb2bf !important;
}

body.dark-mode .nav-link,
body.dark-mode .sidebar-menu .menu-item {
  color: #e6e6e6;
}

body.dark-mode .filter-chip,
body.dark-mode .region-btn,
body.dark-mode .score-filter-btn {
  background: #2a2a40;
  color: #e6e6e6;
}

body.dark-mode .filter-chip:hover:not(.active),
body.dark-mode .region-btn:hover:not(.active) {
  background: #3a3a55;
}

body.dark-mode .score-badge, 
body.dark-mode .composition-badge {
  background-color: #2a2a40;
  color: #e6e6e6;
}

body.dark-mode .no-data-message {
  background-color: #1e1e2d;
}

body.dark-mode #sidebar-overlay {
  background-color: rgba(0, 0, 0, 0.6);
}

body.dark-mode .table {
  color: #e6e6e6;
}

body.dark-mode .table tbody tr {
  background-color: #1e1e2d;
}

body.dark-mode .table tbody tr:hover {
  background-color: #2a2a40;
}

body.dark-mode .school-section {
  background-color: #1e1e2d;
}

body.dark-mode .school-header {
  background-color: #2a2a40;
}

body.dark-mode .entry-card {
  background-color: #1e1e2d;
}

body.dark-mode .entry-header {
  background-color: #2a2a40;
}

/* Favorite button styles */
.favorite-btn {
  color: #6c757d;
  cursor: pointer;
  transition: all 0.3s;
}

.favorite-btn:hover {
  color: #ffc107;
  transform: scale(1.1);
}

.favorite-btn.active {
  color: #ffc107;
}

/* Score calculator button */
.calculator-btn {
  position: fixed;
  right: 20px;
  bottom: 80px;
  width: 50px;
  height: 50px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: white;
  color: #0d6efd;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  z-index: 1000;
  transform: scale(0);
  transition: transform 0.3s, background-color 0.3s;
}

.calculator-btn.visible {
  transform: scale(1);
}

.calculator-btn:hover {
  background-color: #f8f9fa;
  transform: scale(1.1);
}

body.dark-mode .calculator-btn {
  background: #2a2a40;
  color: #0dcaf0;
}

/* Utility buttons */
.utility-buttons {
  position: fixed;
  right: 20px;
  bottom: 20px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  z-index: 1000;
}

.utility-btn {
  width: 50px;
  height: 50px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: white;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  transition: transform 0.3s, background-color 0.3s;
  transform: scale(0);
}

.utility-btn.visible {
  transform: scale(1);
}

.utility-btn:hover {
  transform: scale(1.1);
}

body.dark-mode .utility-btn {
  background: #2a2a40;
  color: #e6e6e6;
}

.export-btn {
  color: #198754;
}

.favorite-list-btn {
  color: #0dcaf0;
}

.calculator-modal-btn {
  color: #ffc107;
}