/* Tablet Responsive Fix - Optimized for 768px-1024px */

/* Tablet Portrait (768px-991px) */
@media (min-width: 768px) and (max-width: 991px) {
  /* Seamless connection fix */
  .modern-header {
    height: 104px !important;
  }

  .notices-marquee {
    top: 104px !important;
    height: 30px !important;
  }

  .hero-section {
    margin-top: 134px !important;
    padding: 0 !important;
    min-height: calc(100vh - 134px) !important;
    display: flex !important;
    align-items: center !important;
    text-align: center !important;
  }

  /* Container adjustments */
  .container {
    max-width: 750px !important;
    padding-left: 20px !important;
    padding-right: 20px !important;
  }

  .hero-section .container {
    padding: 0 20px !important;
  }

  .hero-section .row {
    flex-direction: column !important;
    align-items: center !important;
    justify-content: center !important;
  }

  .hero-section .col-lg-6 {
    width: 100% !important;
    flex: 0 0 100% !important;
    max-width: 100% !important;
    text-align: center !important;
    margin-bottom: 30px !important;
  }

  .modern-title {
    font-size: 2.5rem !important;
    line-height: 1.2 !important;
    margin-bottom: 1.5rem !important;
  }

  .hero-section .lead {
    font-size: 1.1rem !important;
    margin-bottom: 2rem !important;
  }

  .hero-buttons {
    justify-content: center !important;
    gap: 1.5rem !important;
    flex-wrap: wrap !important;
  }

  .hero-buttons .btn {
    min-width: 200px !important;
    padding: 16px 28px !important;
    font-size: 1rem !important;
  }

  /* Video container tablet */
  .video-container {
    width: 100% !important;
    max-width: 100% !important;
    margin: 0 !important;
    padding-bottom: 56.25% !important;
    height: 0 !important;
    position: relative !important;
  }

  .video-container video {
    position: absolute !important;
    top: 0 !important;
    left: 0 !important;
    width: 100% !important;
    height: 100% !important;
    object-fit: cover !important;
  }

  /* Typography tablet */
  h1,
  .h1 {
    font-size: 2.5rem !important;
  }

  h2,
  .h2 {
    font-size: 2rem !important;
  }

  .section-title {
    font-size: 2.2rem !important;
    margin-bottom: 3rem !important;
  }

  /* Magazine grid tablet */
  .magazine-grid {
    grid-template-columns: 1fr 1fr !important;
    grid-template-areas:
      "featured featured"
      "side stats"
      "updates updates" !important;
    gap: 25px !important;
  }

  .combined-stats-card {
    padding: 2rem !important;
  }

  .stats-grid-combined {
    grid-template-columns: 1fr 1fr !important;
    gap: 1rem !important;
  }

  .stat-divider {
    display: none !important;
  }

  /* Features grid tablet */
  .features-grid {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 2rem !important;
  }

  /* Academic grid tablet */
  .academic-grid {
    grid-template-columns: 1fr !important;
    gap: 2rem !important;
  }

  .about-content-grid {
    grid-template-columns: 1fr !important;
    gap: 2rem !important;
  }

  /* Cards tablet */
  .card-body {
    padding: 1.5rem !important;
  }

  /* Notice board tablet */
  .notice-content {
    max-height: 350px !important;
  }

  /* Stats grid tablet */
  .stats-grid {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 1.5rem !important;
  }
}

/* Tablet Landscape (992px-1024px) */
@media (min-width: 992px) and (max-width: 1024px) {
  /* Seamless connection fix */
  .modern-header {
    height: 104px !important;
  }

  .notices-marquee {
    top: 104px !important;
    height: 30px !important;
  }

  .hero-section {
    margin-top: 134px !important;
    padding: 0 !important;
    min-height: calc(100vh - 134px) !important;
    display: flex !important;
    align-items: center !important;
  }
  .container {
    max-width: 970px !important;
    padding-left: 25px !important;
    padding-right: 25px !important;
  }

  /* Video container landscape tablet */
  .video-container {
    width: 100% !important;
    padding-bottom: 56.25% !important;
    height: 0 !important;
    position: relative !important;
    border-radius: 12px !important;
    overflow: hidden !important;
  }

  .video-container video {
    position: absolute !important;
    top: 0 !important;
    left: 0 !important;
    width: 100% !important;
    height: 100% !important;
    object-fit: cover !important;
  }

  /* Hero section landscape tablet */
  .hero-section {
    padding: 140px 0 90px 0 !important;
    text-align: left !important;
  }

  .hero-section .row {
    flex-direction: row !important;
    align-items: center !important;
  }

  .hero-section .col-lg-6 {
    width: 50% !important;
    flex: 0 0 50% !important;
    max-width: 50% !important;
  }

  .hero-section .col-lg-6:first-child {
    text-align: left !important;
    padding-right: 2rem !important;
  }

  .hero-section .col-lg-6:last-child {
    padding-left: 2rem !important;
  }

  .hero-buttons {
    justify-content: flex-start !important;
  }

  .modern-title {
    font-size: 2.8rem !important;
  }

  /* Magazine grid landscape tablet */
  .magazine-grid {
    grid-template-columns: 2fr 1fr !important;
    grid-template-areas:
      "featured side"
      "stats updates" !important;
    gap: 2rem !important;
  }

  .stats-grid-combined {
    grid-template-columns: repeat(2, 1fr) !important;
  }

  /* Features grid landscape tablet */
  .features-grid {
    grid-template-columns: repeat(3, 1fr) !important;
    gap: 1.5rem !important;
  }

  /* Academic grid landscape tablet */
  .academic-grid {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 2rem !important;
  }

  .about-content-grid {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 2rem !important;
  }

  /* Stats grid landscape tablet */
  .stats-grid {
    grid-template-columns: repeat(4, 1fr) !important;
    gap: 1.5rem !important;
  }
}

/* Touch optimizations for all tablets */
@media (min-width: 768px) and (max-width: 1024px) {
  /* Touch-friendly buttons */
  .btn {
    min-height: 48px !important;
    padding: 14px 24px !important;
    font-size: 1rem !important;
  }

  /* Touch-friendly navigation */
  .nav-link {
    padding: 12px 16px !important;
    font-size: 1rem !important;
  }

  /* Touch-friendly form controls */
  .form-control {
    min-height: 48px !important;
    padding: 12px 16px !important;
    font-size: 16px !important;
  }

  /* Carousel controls tablet */
  .carousel-control-prev,
  .carousel-control-next {
    width: 50px !important;
    height: 50px !important;
  }

  /* Notice marquee tablet */
  .notices-marquee {
    position: fixed !important;
    top: 104px !important;
    left: 0 !important;
    right: 0 !important;
    width: 100vw !important;
    z-index: 999 !important;
    font-size: 13px !important;
    padding: 8px 0 !important;
    background: linear-gradient(90deg, #dc2626, #ef4444) !important;
    color: white !important;
    overflow: hidden !important;
    white-space: nowrap !important;
  }

  .notices-content {
    display: inline-block !important;
    animation: marqueeScroll 30s linear infinite !important;
    padding-left: 100% !important;
  }

  .notices-content span {
    margin-right: 40px !important;
  }

  /* Section spacing tablet */
  section {
    padding: 50px 0 !important;
  }

  /* Image sizing tablet */
  .story-image {
    height: 250px !important;
  }

  .carousel-item img {
    height: 280px !important;
  }

  /* Alumni and partner logos tablet */
  .alumni-card {
    width: 180px !important;
  }

  .partner-logo {
    width: 140px !important;
    height: 70px !important;
  }

  /* Accreditation logos tablet */
  .accreditations-grid {
    grid-template-columns: repeat(4, 1fr) !important;
    gap: 1rem !important;
  }

  .accreditation-logo {
    width: 50px !important;
    height: 35px !important;
  }
}

/* iPad specific optimizations */
@media (min-width: 768px) and (max-width: 1024px) and (orientation: portrait) {
  .hero-section {
    padding: 100px 0 70px 0 !important;
  }

  .modern-title {
    font-size: 2.2rem !important;
  }

  .magazine-grid {
    grid-template-columns: 1fr !important;
    grid-template-areas:
      "featured"
      "side"
      "stats"
      "updates" !important;
  }

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

@media (min-width: 768px) and (max-width: 1024px) and (orientation: landscape) {
  .hero-section {
    padding: 120px 0 80px 0 !important;
  }

  .modern-title {
    font-size: 2.5rem !important;
  }

  .magazine-grid {
    grid-template-columns: 2fr 1fr !important;
    grid-template-areas:
      "featured side"
      "stats updates" !important;
  }

  .features-grid {
    grid-template-columns: repeat(3, 1fr) !important;
  }
}

/* Tablet hover states */
@media (min-width: 768px) and (max-width: 1024px) {
  .feature-card:hover {
    transform: translateY(-5px) !important;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15) !important;
  }

  .card:hover {
    transform: translateY(-3px) !important;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.12) !important;
  }

  .btn:hover {
    transform: translateY(-2px) !important;
  }
}

/* Tablet scrolling optimizations */
@media (min-width: 768px) and (max-width: 1024px) {
  .notice-content {
    -webkit-overflow-scrolling: touch !important;
  }

  .side-stories {
    -webkit-overflow-scrolling: touch !important;
  }

  /* Smooth scrolling */
  html {
    scroll-behavior: smooth !important;
  }
}
