* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 25%, #f093fb 50%, #4facfe 75%, #00f2fe 100%);
  background-size: 400% 400%;
  animation: gradientShift 15s ease infinite;
  min-height: 100vh;
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  overflow-x: hidden;
}

@keyframes gradientShift {
  0% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

.navbar {
  background: rgba(255, 255, 255, 0.1) !important;
  backdrop-filter: blur(10px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.2);
  box-shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.37);
}

.navbar-brand {
  font-size: 1.8rem;
  font-weight: 800;
  color: white !important;
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
  letter-spacing: 1px;
}

.card {
  border: none;
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.25);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.3);
  box-shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.37);
  transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  color: #ffffff;
  margin: 0;
}

.card:hover {
  transform: translateY(-10px) scale(1.02);
  box-shadow: 0 15px 40px rgba(0, 0, 0, 0.4);
  background: rgba(255, 255, 255, 0.25);
}

.card-title {
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: 1.5rem;
  color: #ffffff;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.display-6 {
  font-weight: 900;
  font-size: 3.5rem;
  background: linear-gradient(135deg, #ffd700, #ffed4e, #ffffff);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
  animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.8; }
}

.btn-primary {
  background: linear-gradient(135deg, #ffffff, #f0f0f0);
  border: none;
  font-weight: 700;
  padding: 0.75rem 2rem;
  border-radius: 50px;
  transition: all 0.3s ease;
  box-shadow: 0 4px 15px rgba(255, 255, 255, 0.4);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: #333;
}

.btn-primary:hover {
  background: linear-gradient(135deg, #f0f0f0, #ffffff);
  transform: translateY(-3px);
  box-shadow: 0 8px 25px rgba(255, 255, 255, 0.6);
  color: #333;
}

.btn-outline-primary {
  color: white;
  border: 2px solid rgba(255, 255, 255, 0.5);
  border-radius: 50px;
  font-weight: 600;
  transition: all 0.3s ease;
}

.btn-outline-primary:hover {
  background: rgba(255, 255, 255, 0.2);
  color: white;
  border-color: white;
  transform: scale(1.05);
}

.form-control {
  background: rgba(255, 255, 255, 0.1);
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-radius: 15px;
  color: white;
  padding: 0.75rem 1.5rem;
  font-weight: 500;
  transition: all 0.3s ease;
}

.form-control:focus {
  background: rgba(255, 255, 255, 0.2);
  border-color: rgba(255, 255, 255, 0.8);
  box-shadow: 0 0 20px rgba(255, 255, 255, 0.3);
  color: white;
}

.form-control::placeholder {
  color: rgba(255, 255, 255, 0.6);
}

.form-label {
  color: #ffffff;
  font-weight: 600;
  margin-bottom: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  font-size: 0.9rem;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}

.alert {
  border-radius: 15px;
  border: none;
  background: rgba(220, 53, 69, 0.3);
  color: white;
  backdrop-filter: blur(10px);
  border: 1px solid rgba(220, 53, 69, 0.5);
  animation: slideIn 0.5s ease;
}

@keyframes slideIn {
  from {
    opacity: 0;
    transform: translateX(-30px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

.list-group {
  background: transparent;
}

.list-group-item {
  background: rgba(255, 255, 255, 0.2);
  border: 1px solid rgba(255, 255, 255, 0.3);
  color: #ffffff;
  padding: 1rem 1.5rem;
  border-radius: 10px;
  margin-bottom: 0.5rem;
  transition: all 0.3s ease;
  font-weight: 500;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}

.list-group-item:hover {
  background: rgba(255, 255, 255, 0.2);
  transform: translateX(10px);
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

h2 {
  color: white;
  font-weight: 900;
  font-size: 2.5rem;
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
  letter-spacing: 1px;
  animation: fadeInDown 0.8s ease;
}

@keyframes fadeInDown {
  from {
    opacity: 0;
    transform: translateY(-30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.text-muted {
  color: rgba(255, 255, 255, 0.9) !important;
  font-weight: 500;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}

.container {
  padding: 2rem 1rem;
}

.notice-item {
  background: rgba(255, 255, 255, 0.2);
  border-left: 4px solid rgba(255, 215, 0, 1);
  padding: 1.2rem;
  margin-bottom: 0.75rem;
  border-radius: 8px;
  transition: all 0.3s ease;
  cursor: pointer;
}

.notice-item:hover {
  background: rgba(255, 255, 255, 0.15);
  transform: translateX(5px);
  box-shadow: 0 4px 15px rgba(255, 215, 0, 0.2);
}

.notice-title {
  font-weight: 700;
  font-size: 1rem;
  color: #ffeb3b;
  margin-bottom: 0.5rem;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.4);
}

.notice-date {
  font-size: 0.85rem;
  color: rgba(255, 255, 255, 0.85);
  margin-bottom: 0.5rem;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}

.notice-message {
  color: #ffffff;
  font-size: 0.95rem;
  line-height: 1.5;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}

.teacher-card {
  background: rgba(255, 255, 255, 0.2);
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: 15px;
  padding: 1.5rem;
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
}

.teacher-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, #ffffff, #f0f0f0);
}

.teacher-card:hover {
  transform: translateY(-8px);
  box-shadow: 0 10px 30px rgba(255, 255, 255, 0.3);
  background: rgba(255, 255, 255, 0.15);
}

.teacher-name {
  font-weight: 700;
  font-size: 1.1rem;
  color: #ffffff;
  margin-bottom: 0.5rem;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}

.teacher-subject {
  color: #ffeb3b;
  font-weight: 600;
  margin-bottom: 0.75rem;
  font-size: 0.95rem;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.4);
}

.teacher-info {
  color: rgba(255, 255, 255, 0.95);
  font-size: 0.9rem;
  margin-bottom: 0.4rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}

.admit-card-container {
  background: rgba(255, 255, 255, 0.25);
  border: 2px solid rgba(255, 215, 0, 0.8);
  border-radius: 15px;
  padding: 2rem;
  position: relative;
}

.admit-card-header {
  text-align: center;
  border-bottom: 2px dashed rgba(255, 255, 255, 0.3);
  padding-bottom: 1.5rem;
  margin-bottom: 1.5rem;
}

.admit-card-title {
  font-size: 1.5rem;
  font-weight: 800;
  color: #ffeb3b;
  text-transform: uppercase;
  letter-spacing: 2px;
  margin-bottom: 0.5rem;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.4);
}

.admit-card-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2rem;
  margin-bottom: 1.5rem;
}

.admit-card-field {
  padding: 1rem;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 10px;
  border-left: 3px solid rgba(255, 255, 255, 0.6);
}

.admit-card-label {
  font-size: 0.85rem;
  color: rgba(255, 255, 255, 0.85);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 0.4rem;
  font-weight: 600;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}

.admit-card-value {
  font-size: 1.05rem;
  color: #ffffff;
  font-weight: 700;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}

.admit-card-instructions {
  background: rgba(255, 215, 0, 0.15);
  border-left: 4px solid #ffd700;
  padding: 1rem;
  border-radius: 8px;
  color: #ffffff;
  font-size: 0.95rem;
  margin-top: 1rem;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}

@media (max-width: 768px) {
  .admit-card-row {
    grid-template-columns: 1fr;
    gap: 1rem;
  }
}

/* Light Mode Styles */
body.light-mode {
  background: linear-gradient(135deg, #e0f7fa 0%, #f3e5f5 25%, #fff9c4 50%, #e1f5fe 75%, #f1f8e9 100%);
  background-size: 400% 400%;
  animation: gradientShift 15s ease infinite;
}

body.light-mode .navbar {
  background: rgba(255, 255, 255, 0.9) !important;
  border-bottom: 1px solid rgba(0, 0, 0, 0.1);
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

body.light-mode .navbar-brand {
  color: #ffffff !important;
  text-shadow: 0 2px 10px rgba(255, 255, 255, 0.3);
}

body.light-mode .card {
  background: rgba(255, 255, 255, 0.8);
  border: 1px solid rgba(0, 0, 0, 0.1);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
  color: #333;
  margin: 0;
}

body.light-mode .card:hover {
  background: rgba(255, 255, 255, 0.95);
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.15);
}

body.light-mode .card-title {
  background: linear-gradient(135deg, #ffffff, #f0f0f0);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

body.light-mode .display-6 {
  background: linear-gradient(135deg, #ffffff, #f0f0f0, #e0e0e0);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

body.light-mode h2 {
  color: #333;
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

body.light-mode .text-muted {
  color: rgba(0, 0, 0, 0.6) !important;
}

body.light-mode .form-control {
  background: rgba(255, 255, 255, 0.9);
  border: 2px solid rgba(0, 0, 0, 0.2);
  color: #333;
}

body.light-mode .form-control:focus {
  background: white;
  border-color: #ffffff;
  box-shadow: 0 0 20px rgba(255, 255, 255, 0.2);
  color: #333;
}

body.light-mode .form-control::placeholder {
  color: rgba(0, 0, 0, 0.4);
}

body.light-mode .form-label {
  color: #333;
}

body.light-mode .list-group-item {
  background: rgba(255, 255, 255, 0.8);
  border: 1px solid rgba(0, 0, 0, 0.1);
  color: #333;
}

body.light-mode .list-group-item:hover {
  background: rgba(255, 255, 255, 0.95);
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

body.light-mode .notice-item {
  background: rgba(255, 255, 255, 0.8);
  border-left: 4px solid #ffa000;
}

body.light-mode .notice-item:hover {
  background: rgba(255, 255, 255, 0.95);
  box-shadow: 0 4px 15px rgba(255, 160, 0, 0.2);
}

body.light-mode .notice-title {
  color: #f57c00;
}

body.light-mode .notice-date {
  color: rgba(0, 0, 0, 0.5);
}

body.light-mode .notice-message {
  color: #333;
}

body.light-mode .teacher-card {
  background: rgba(255, 255, 255, 0.8);
  border: 1px solid rgba(0, 0, 0, 0.1);
}

body.light-mode .teacher-card:hover {
  background: rgba(255, 255, 255, 0.95);
  box-shadow: 0 10px 30px rgba(102, 126, 234, 0.2);
}

body.light-mode .teacher-name {
  color: #333;
}

body.light-mode .teacher-subject {
  color: #f57c00;
}

body.light-mode .teacher-info {
  color: #666;
}

body.light-mode .admit-card-container {
  background: rgba(255, 255, 255, 0.85);
  border: 2px solid rgba(255, 255, 255, 0.3);
}

body.light-mode .admit-card-title {
  color: #ffffff;
}

body.light-mode .admit-card-field {
  background: rgba(255, 255, 255, 0.05);
  border-left: 3px solid #ffffff;
}

body.light-mode .admit-card-label {
  color: #666;
}

body.light-mode .admit-card-value {
  color: #333;
}

body.light-mode .admit-card-instructions {
  background: rgba(255, 193, 7, 0.1);
  border-left: 4px solid #ffc107;
  color: #333;
}

.nav-card {
  text-decoration: none !important;
  color: inherit;
  transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.nav-card:hover {
  transform: translateY(-15px) scale(1.03);
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5);
  background: rgba(255, 255, 255, 0.25) !important;
}

.nav-card .card-title {
  background: linear-gradient(135deg, #ffd700, #ffed4e);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  font-size: 1.5rem;
  transition: all 0.3s ease;
}

.nav-card:hover .card-title {
  transform: scale(1.1);
}

/* ============================================
   RESPONSIVE DESIGN - MOBILE FIRST
   ============================================ */

/* Small devices (phones, less than 576px) */
@media (max-width: 575.98px) {
  /* Typography adjustments */
  .navbar-brand {
    font-size: 1.3rem;
    letter-spacing: 0.5px;
  }

  h2 {
    font-size: 1.8rem;
  }

  .card-title {
    font-size: 1.2rem;
  }

  .display-6 {
    font-size: 2.5rem;
  }

  /* Container padding */
  .container {
    padding: 1rem 0.5rem;
  }

  /* Welcome banner adjustments */
  .row.slide-in-up > .col-12 > div {
    padding: 1.5rem 1rem !important;
  }

  .row.slide-in-up h2 {
    font-size: 1.5rem !important;
  }

  .row.slide-in-up p {
    font-size: 0.95rem !important;
  }

  /* Stats boxes on mobile */
  .row.slide-in-up > .col-12 > div > div:last-child {
    gap: 1rem !important;
  }

  .pulse-effect {
    padding: 0.75rem !important;
    min-width: calc(33.33% - 0.75rem);
  }

  .pulse-effect > div:first-child {
    font-size: 1.5rem !important;
  }

  .pulse-effect > div:last-child {
    font-size: 0.75rem !important;
  }

  /* Card spacing */
  .row.g-2 {
    gap: 0.75rem !important;
  }

  .card {
    margin-bottom: 0.75rem;
  }

  .card-body {
    padding: 1.25rem !important;
  }

  /* Navigation cards */
  .nav-card .card-body {
    padding: 1.5rem 1rem !important;
    text-align: center;
  }

  .nav-card .icon-bounce {
    font-size: 2rem !important;
  }

  .nav-card .card-title {
    font-size: 1.1rem !important;
  }

  /* Form elements */
  .form-control {
    padding: 0.625rem 1rem;
    font-size: 0.95rem;
  }

  .btn-primary,
  .btn-outline-primary {
    padding: 0.625rem 1.5rem;
    font-size: 0.9rem;
  }

  /* List items */
  .list-group-item {
    padding: 0.875rem 1rem;
    font-size: 0.95rem;
  }

  /* Notice items */
  .notice-item {
    padding: 1rem;
  }

  .notice-title {
    font-size: 0.95rem;
  }

  .notice-date {
    font-size: 0.8rem;
  }

  .notice-message {
    font-size: 0.9rem;
  }

  /* Teacher cards */
  .teacher-card {
    padding: 1.25rem;
  }

  .teacher-name {
    font-size: 1rem;
  }

  .teacher-subject {
    font-size: 0.9rem;
  }

  .teacher-info {
    font-size: 0.85rem;
  }

  /* Admit card */
  .admit-card-container {
    padding: 1.25rem;
  }

  .admit-card-title {
    font-size: 1.2rem;
  }

  .admit-card-value {
    font-size: 0.95rem;
  }

  /* Reduce animations on mobile for performance */
  .card:hover {
    transform: translateY(-5px) scale(1.01);
  }

  .nav-card:hover {
    transform: translateY(-8px) scale(1.02);
  }

  /* Hide decorative background emoji on mobile */
  .float-animation[style*="font-size: 10rem"] {
    display: none;
  }
}

/* Medium devices (tablets, 576px to 767px) */
@media (min-width: 576px) and (max-width: 767.98px) {
  .navbar-brand {
    font-size: 1.5rem;
  }

  h2 {
    font-size: 2rem;
  }

  .container {
    padding: 1.5rem 1rem;
  }

  /* Welcome banner */
  .row.slide-in-up > .col-12 > div {
    padding: 2rem 1.5rem !important;
  }

  .row.slide-in-up h2 {
    font-size: 2rem !important;
  }

  .pulse-effect {
    padding: 0.875rem !important;
  }

  .pulse-effect > div:first-child {
    font-size: 1.75rem !important;
  }

  /* Card adjustments */
  .card-body {
    padding: 1.5rem !important;
  }

  .nav-card .icon-bounce {
    font-size: 2.25rem !important;
  }

  .card:hover {
    transform: translateY(-8px) scale(1.015);
  }
}

/* Large devices (desktops, 768px to 991px) */
@media (min-width: 768px) and (max-width: 991.98px) {
  .navbar-brand {
    font-size: 1.6rem;
  }

  .container {
    padding: 1.75rem 1rem;
  }

  /* Welcome banner */
  .row.slide-in-up > .col-12 > div {
    padding: 2.25rem !important;
  }

  .pulse-effect {
    padding: 0.95rem !important;
  }

  /* Cards in 2 columns look better */
  .col-md-6 {
    width: 50%;
  }
}

/* Extra large devices (large desktops, 992px and up) */
@media (min-width: 992px) {
  .container {
    max-width: 1200px;
  }

  /* 3 column layout on large screens */
  .col-lg-4 {
    width: 33.333333%;
  }
}

/* Ultra-wide screens (1400px and up) */
@media (min-width: 1400px) {
  .container {
    max-width: 1400px;
  }

  /* Larger typography for big screens */
  .navbar-brand {
    font-size: 2rem;
  }

  h2 {
    font-size: 2.75rem;
  }

  .card-title {
    font-size: 1.6rem;
  }
}

/* Landscape orientation on phones */
@media (max-width: 767.98px) and (orientation: landscape) {
  .row.slide-in-up > .col-12 > div {
    padding: 1rem !important;
  }

  .row.slide-in-up h2 {
    font-size: 1.3rem !important;
  }

  .pulse-effect {
    padding: 0.5rem !important;
  }

  .pulse-effect > div:first-child {
    font-size: 1.3rem !important;
  }

  .pulse-effect > div:last-child {
    font-size: 0.7rem !important;
  }
}

/* Touch device optimizations */
@media (hover: none) and (pointer: coarse) {
  /* Increase tap targets */
  .btn-primary,
  .btn-outline-primary {
    padding: 0.75rem 2rem;
    min-height: 44px;
  }

  .list-group-item {
    min-height: 48px;
  }

  .nav-card {
    min-height: 120px;
  }

  /* Disable hover effects on touch devices */
  .card:hover {
    transform: none;
    box-shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.37);
  }

  .nav-card:hover {
    transform: none;
  }

  .list-group-item:hover {
    transform: none;
  }

  /* Active states for touch feedback */
  .card:active {
    transform: scale(0.98);
  }

  .btn-primary:active,
  .btn-outline-primary:active {
    transform: scale(0.95);
  }
}

/* Reduce motion for accessibility */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* High contrast mode support */
@media (prefers-contrast: high) {
  .card {
    border: 2px solid rgba(255, 255, 255, 0.5);
  }

  .btn-primary {
    border: 2px solid #ffffff;
  }

  .form-control {
    border: 2px solid rgba(255, 255, 255, 0.5);
  }
}

/* Dark mode preference support */
@media (prefers-color-scheme: dark) {
  /* Already dark by default, but ensure it stays dark */
  body:not(.light-mode) {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 25%, #f093fb 50%, #4facfe 75%, #00f2fe 100%);
  }
}

