/* Additional responsive enhancements */

/* Base improvements */
html {
  scroll-behavior: smooth;
}

body {
  overflow-x: hidden;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

main {
  flex: 1;
}

img {
  max-width: 100%;
  height: auto;
}

/* Form enhancements */
input,
select,
textarea {
  font-size: 16px; /* Prevents zoom on iOS */
  max-width: 100%;
}

.error {
  border-color: #dc3545 !important;
}

.error-message {
  color: #dc3545;
  font-size: 0.875rem;
  margin-top: 0.25rem;
}

/* Accessibility improvements */
:focus {
  outline: 2px solid #667eea;
  outline-offset: 2px;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border-width: 0;
}

/* Enhanced mobile navigation */
@media (max-width: 768px) {
  .nav-links a {
    padding: 0.75rem 1rem;
    display: block;
    width: 100%;
  }

  .nav-links li {
    width: 100%;
  }

  /* Improved touch targets */
  button,
  .cta-button,
  .nav-links a,
  .footer-section a {
    min-height: 44px;
    min-width: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
  }

  /* Better spacing for mobile */
  .section-title {
    margin-bottom: 2rem;
  }

  section {
    padding: 60px 0;
  }

  /* Adjust card layouts */
  .faculty-card,
  .program-card,
  .news-card,
  .feature-card {
    margin-bottom: 1.5rem;
  }

  /* Improve table responsiveness */
  .tuition-table,
  .table-responsive {
    overflow-x: auto;
    display: block;
    width: 100%;
    -webkit-overflow-scrolling: touch;
  }

  /* Better CTA buttons on mobile */
  .cta-buttons {
    flex-direction: column;
    align-items: center;
    gap: 1rem;
  }

  .cta-button {
    width: 100%;
    text-align: center;
  }

  /* Adjust modal for mobile */
  .modal-content {
    width: 95%;
    margin: 1rem;
    max-height: 80vh;
  }

  .modal-body {
    max-height: 50vh;
  }
}

/* Tablet specific adjustments */
@media (min-width: 769px) and (max-width: 1024px) {
  .container {
    padding: 0 30px;
  }

  .features-grid,
  .faculty-grid,
  .programs-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .about-content {
    gap: 2rem;
  }
}

/* Notification animation */
.notification {
  animation: slideInRight 0.3s ease forwards;
}

.notification.closing {
  animation: slideOutRight 0.3s ease forwards;
}

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

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

/* Dark mode support */
@media (prefers-color-scheme: dark) {
  .back-to-top {
    background-color: rgba(102, 126, 234, 0.8);
  }

  .back-to-top:hover {
    background-color: rgba(102, 126, 234, 1);
  }
}

/* High contrast mode support */
@media (forced-colors: active) {
  .cta-button,
  .submit-btn,
  .nav-links a[aria-current="page"],
  .back-to-top {
    border: 2px solid currentColor;
  }
}
