﻿@media (max-width: 1000px) and (min-width: 501px) {
  /* Adjust container and row padding */
  footer .container,
  footer .row {
    padding-left: 0 !important;
    padding-right: 0 !important;
  }

  /* Make columns stack better and center content */
  footer .col-md-4,
  footer .col-md-2 {
    text-align: center !important;
    margin-bottom: 1.5rem;
    width: 100% !important;
    max-width: 100vw !important;
  }

  /* Responsive Google Map */
  footer iframe {
    width: 75vw !important;
    min-width: 300px !important;
    max-width: 96vw !important;
    height: 220px !important;
    display: block;
    margin: 16px auto 16px auto;
    border-radius: 8px;
  }

  /* Social and logo responsiveness */
  footer img {
    margin: 0 auto 12px auto;
    display: block;
  }

  /* Footer text sizing for readability */
  footer span,
  footer p,
  footer h6,
  footer h4 {
    font-size: 1rem !important;
  }

  /* Adjust mobile-responsive-row (contact row) */
  footer .mobile-responsive-row {
    flex-direction: column !important;
    align-items: center !important;
  }
  footer .mobile-responsive-row .col-4,
  footer .mobile-responsive-row .col-7 {
    width: 100% !important;
    max-width: 100vw;
    text-align: center !important;
    padding: 0;
    margin-bottom: 12px;
  }
  /* Remove border in contact row */
  footer .mobile-responsive-row .border-start {
    border-left: none !important;
  }
  footer .mobile-responsive-row p {
    font-size: 15px !important;
    text-align: center;
    margin-bottom: 0.4em;
  }

  /* Stack bottom links vertically on smaller tablets */
  footer .border-top .d-flex {
    flex-direction: column !important;
    gap: 8px !important;
  }
}

@media (max-width: 500px) {
  /* Shrink the navbar brand logo and adjust its margin */
  .navbar-brand img {
    width: 120px !important;
    height: auto;
  }

  /* Reduce navbar padding */
  .navbar {
    padding-top: 0.1rem !important;
    padding-bottom: 0.1rem !important;
  }

  /* Adjust navbar container padding */
  .navbar .container {
    padding-left: 8px;
    padding-right: 8px;
  }

  /* Collapse nav links to full width & increase tap area */
  .navbar-nav {
    text-align: left;
    padding-left: 0;
    padding-right: 0;
  }
  .navbar-nav .nav-link,
  .navbar-nav .dropdown-toggle {
    padding: 12px 10px;
    font-size: 15px;
    width: 100%;
    display: block;
  }

  /* Dropdown menu full width */
  .dropdown-menu {
    width: 100%;
    min-width: 0;
    font-size: 15px;
  }
  .dropdown-item {
    padding-left: 20px;
  }

  /* Hamburger icon larger for easier tap */
  .navbar-toggler {
    padding: 8px 10px;
    font-size: 1.3rem;
    border: none;
  }

  #principal img {
    width: 100% !important;
  }

  /* Hide text if the logo doesn't fit, optional */
  /* .navbar-brand span, .navbar-brand b { display:none; } */

  /* Optional: reduce shadow for less cramped look */
  .navbar.shadow {
    box-shadow: 0 1px 8px -3px rgba(0, 0, 0, 0.12);
  }

  .hero-section {
    padding-left: 0;
    height: 70vh; /* Reduce height for mobile */
    min-height: 350px;
    align-items: flex-end;
    justify-content: center;
  }

  .hero-box {
    margin-left: 0 !important;
    padding: 20px 10px;
    width: 100%;
    max-width: 95vw;
  }

  .hero-content h1 {
    font-size: 1.18rem;
    padding: 16px 10px;
    max-width: 92vw;
    line-height: 1.25;
    border-radius: 8px 8px 0 0;
    text-align: left;
  }

  .hero-content span {
    font-size: 0.94rem;
    padding: 14px 10px;
    max-width: 92vw;
    border-radius: 0 0 8px 8px;
    text-align: left;
    color: #aad4b6;
  }

  .hero-buttons {
    margin-top: 18px;
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
  }

  .gold-button {
    padding: 12px 0;
    width: 100%;
    font-size: 1rem;
    text-align: center;
  }
  .events-section .container {
    padding-left: 0;
    padding-right: 0;
  }
  #carouselExample {
    width: 98vw !important;
    min-width: 0 !important;
    margin: 0 auto;
  }
  /* Carousel images - remove any fixed height, fill container, reduce border radius if any */
  #carouselExample img {
    border-radius: 6px !important;
    max-height: 42vw;
    object-fit: cover;
    min-height: 180px;
  }
  /* Caption: smaller font, background for legibility, padding */
  .carousel-caption {
    bottom: 0.3rem;
    left: 0;
    right: 0;
    padding: 8px 8px 10px 8px;
    background: rgba(0, 0, 0, 0.38);
    border-radius: 0 0 6px 6px;
    font-size: 0.87rem;
    line-height: 1.2;
  }
  .carousel-caption h3 {
    font-size: 1.07rem;
    margin-bottom: 3px;
  }
  .carousel-caption p {
    font-size: 0.92rem;
    margin-bottom: 0;
  }
  /* Show caption always on mobile (remove d-none d-md-block) for accessibility */
  .carousel-caption.d-none.d-md-block {
    display: block !important;
  }
  /* Next/prev buttons larger tap area */
  .carousel-control-prev,
  .carousel-control-next {
    width: 16vw;
    min-width: 35px;
    height: 38px;
    top: unset;
    bottom: 15px;
    opacity: 0.75;
    position: absolute;
    top: 85px;
  }
  /* Icon bigger */
  .carousel-control-prev-icon,
  .carousel-control-next-icon {
    width: 1.7rem;
    height: 1.7rem;
  }
  /* Modal styles */
  .custom-modal {
    padding: 0;
    align-items: center;
  }
  .custom-modal .modal-content {
    width: 97vw;
    max-width: 97vw;
    padding: 0;
    border-radius: 9px;
  }
  .custom-modal img {
    width: 100%;
    max-height: 74vh;
    border-radius: 9px;
    object-fit: contain;
  }
  .close-btn {
    top: 4px;
    right: 14px;
    font-size: 2rem;
    color: #fff;
    text-shadow: 0 2px 6px #000;
    z-index: 3;
  }
  /* Stack columns vertically, center contents */
  .footer .row,
  .footer .container {
    padding-left: 0 !important;
    padding-right: 0 !important;
  }

  footer .col-md-4,
  footer .col-md-2 {
    text-align: center !important;
    margin-bottom: 1.5rem;
  }

  /* Responsive Google Map */
  footer iframe {
    width: 95vw !important;
    min-width: 180px !important;
    max-width: 100% !important;
    height: 160px !important;
    display: block;
    margin: 10px auto 10px auto;
    border-radius: 8px;
  }

  /* Smaller text for contact/info */
  footer span,
  footer p,
  footer h6,
  footer h4 {
    font-size: 0.96rem !important;
  }

  /* Social and logo responsive */
  footer img {
    width: 100%;
    height: auto;
    margin: 0 auto 15px auto;
    display: block;
  }

  /* Bottom links: stack and space out */
  footer .border-top .d-flex {
    flex-direction: column !important;
    gap: 10px !important;
  }

  footer .mobile-responsive-row {
    flex-direction: column !important;
    align-items: center !important;
  }

  footer .mobile-responsive-row .col-4,
  footer .mobile-responsive-row .col-7 {
    width: 100% !important;
    max-width: 100vw;
    text-align: center !important;
    padding: 0;
    margin-bottom: 12px;
  }
  /* Remove left border on mobile */
  footer .mobile-responsive-row .border-start {
    border-left: none !important;
  }
  /* Center icons/text, adjust font */
  footer .mobile-responsive-row p {
    font-size: 14px !important;
    text-align: center;
    margin-bottom: 0.4em;
  }

  .hero-text h1 {
    text-align: center;
    font-size: 44px;
  }

  .hero-text p {
    text-align: center;
    padding: 12px;
  }
}

@media (max-width: 1500px) and (min-width: 1001px) {
  .nirf-hero-section {
    height: 46vh;
    padding-left: 2%;
  }
}

/* Tablets to large phones */
@media (max-width: 1000px) and (min-width: 501px) {
  .nirf-hero-section {
    height: 38vh;
    padding-left: 1%;
  }
  .contact-hero-section {
    height: 38vh;
    padding-left: 1%;
  }
}

/* Small screens: phones */
@media (max-width: 500px) {
  .nirf-hero-section {
    padding-left: 10px;
    padding-right: 10px;
    align-items: flex-end;
    justify-content: center;
    text-align: center;
  }

  .contact-hero-section {
    padding-left: 10px;
    padding-right: 10px;
    align-items: flex-end;
    justify-content: center;
    text-align: center;
  }
}

@media (max-width: 500px) {
  #trainingPlacementCarousel {
    width: 92vw;
    max-width: 92vw;
    height: 46vw;
    min-height: 160px; /* Ensure it's not too small for a portrait phone */
    max-height: 52vw;
    border-radius: 8px;
  }

  #trainingPlacementCarousel .carousel-inner,
  #trainingPlacementCarousel .carousel-item,
  #trainingPlacementCarousel img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 8px;
    overflow: hidden;
  }
  .carousel-caption {
    font-size: 0.84rem;
    padding: 4px 7px;
    bottom: 4px;
    left: 0;
    right: 0;
    background: rgba(0, 0, 0, 0.22);
    border-radius: 0 0 8px 8px;
  }
  .carousel-control-prev,
  .carousel-control-next {
    width: 12vw;
    min-width: 30px;
    height: 38px;
    opacity: 0.7;
  }
  .carousel-control-prev-icon,
  .carousel-control-next-icon {
    width: 1.5rem;
    height: 1.5rem;
  }
}

@media (max-width: 500px) {
  .events-section {
    padding-left: 0;
    padding-right: 0;
  }
  .internal-complaint-carousel {
    width: 92vw !important;
    max-width: 92vw !important;
    height: 46vw !important;
    min-height: 160px !important;
    max-height: 52vw !important;
    border-radius: 8px !important;
  }
  .internal-complaint-carousel .carousel-inner,
  .internal-complaint-carousel .carousel-item,
  .internal-complaint-carousel img {
    border-radius: 8px !important;
    width: 100% !important;
    height: 100% !important;
    object-fit: cover !important;
  }
  .internal-complaint-carousel .carousel-caption {
    font-size: 0.84rem !important;
    padding: 4px 7px !important;
    bottom: 4px !important;
    left: 0 !important;
    right: 0 !important;
    background: rgba(0, 0, 0, 0.22) !important;
    border-radius: 0 0 8px 8px !important;
  }
  .internal-complaint-carousel .carousel-control-prev,
  .internal-complaint-carousel .carousel-control-next {
    width: 12vw !important;
    min-width: 30px !important;
    height: 38px !important;
    opacity: 0.7 !important;
  }
  .internal-complaint-carousel .carousel-control-prev-icon,
  .internal-complaint-carousel .carousel-control-next-icon {
    width: 1.5rem !important;
    height: 1.5rem !important;
  }
}

@media (max-width: 500px) {
  .stats-section .row {
    flex-direction: column !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
  }
  .stats-section .stat-item {
    width: 100% !important;
    max-width: 97vw;
    margin-left: auto;
    margin-right: auto;
    margin-bottom: 24px;
    padding-left: 0 !important;
    padding-right: 0 !important;
    box-sizing: border-box;
  }
  .stats-section .stat-item:last-child {
    margin-bottom: 0;
  }
}

.contact-info p {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1.2em;
  margin-bottom: 1rem;
  font-size: 1.06rem;
  flex-wrap: wrap;
}

.contact-info .contact-label {
  display: flex;
  align-items: center;
  font-weight: 700;
  min-width: 0;
  white-space: nowrap;
  color: #2a475e;
}

.contact-info .contact-label i {
  margin-right: 0.38em;
  font-size: 1em;
}

.contact-info .contact-label strong {
  font-size: 1em;
  margin-right: 0.17em;
  font-weight: 700;
}

.contact-info .contact-detail {
  display: block;
  text-align: right;
  min-width: 0;
  white-space: nowrap;
  flex-shrink: 1;
  flex-basis: 60%;
  font-weight: 400;
  color: #353535;
  overflow-wrap: break-word;
}

.contact-info a {
  color: #0d3c87;
  text-decoration: underline;
  word-break: break-all;
}

@media (max-width: 650px) {
  .contact-info p {
    font-size: 0.99rem !important;
    gap: 0.63em !important;
  }
  .contact-info .contact-label {
    font-size: 14px !important;
    flex-basis: 35% !important;
  }
  .contact-info .resposive-contact-detail {
    font-size: 14px !important;
    flex-basis: 60% !important;
  }
  .contact-info .below-12-size {
    font-size: 10px !important;
    flex-basis: 60% !important;
  }

  .contact-info .info-mail-responsive {
    font-size: 9px !important;
    flex-basis: 60% !important;
  }
}

@media (max-width: 500px) {
  .contact-info p {
    font-size: 0.97rem;
    gap: 0.5em;
    margin-bottom: 0.88rem;
    flex-wrap: wrap;
    text-wrap: wrap;
  }
  .contact-info .contact-label {
    font-size: 0.97em;
    flex-basis: 38%;
    min-width: 90px;
    text-wrap: wrap;
  }
  .contact-info .contact-detail {
    font-size: 0.97em;
    flex-basis: 58%;
    min-width: 0;
    text-align: right;
    text-wrap: wrap;
  }
}

@media (max-width: 500px) {
  .table-striped {
    overflow-x: scroll;
  }

  .about .col-md-9 {
    margin-top: 12px;
  }

  .iqac .col-md-9 {
    margin-top: 12px;
  }

  .iqac h2 {
    font-size: 26px;
  }

  .nirf .col-md-9 {
    margin-top: 12px;
  }

  .nirf h2 {
    font-size: 26px;
  }

  .dbt a {
    font-size: 16px;
  }

  #faculty .card-body {
    padding: 10px;
  }

  #principal .info-block {
    display: block;
    line-height: 1;
  }
  #principal .info-block strong {
    display: block;
    margin-bottom: 5px;
  }

  .nirf .nirf-hero-section .hero-text {
    padding-bottom: 70px;
  }

  .contact-hero-section {
    padding-bottom: 70px;
  }

  #gallery .nirf-hero-section .hero-text {
    padding-bottom: 100px;
  }

  #main .carousel-control-prev {
    position: absolute !important;
    top: 75px !important;
    right: 12px !important;
  }
  #main .carousel-control-next {
    position: absolute !important;
    top: 75px !important;
    right: 12px !important;
  }
}

.facilities p,
li {
  text-align: justify;
}

.facilities .carousel-image {
  width: 100%;
  height: 400px; /* Set desired carousel height */
  object-fit: cover; /* Ensures image covers area without stretching */
  object-position: center; /* Centers the image */
}
.facilities .carousel-item {
  min-height: 400px; /* Ensures consistent slide height */
}
@media (max-width: 768px) {
  .carousel-caption .carousel-image,
  .carousel-item {
    height: 220px;
  }
}

.instrument-card {
  width: 320px !important;
  height: 450px !important;
  margin-bottom: 24px !important;
  display: flex !important;
  flex-direction: column !important;
  align-items: center !important;
  justify-content: flex-start !important;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05) !important;
}
.instrument-image {
  width: 100%;
  height: 220px !important;
  object-fit: cover !important;
  border-top-left-radius: 0.5rem !important;
  border-top-right-radius: 0.5rem !important;
}
.instrument-body {
  flex-grow: 1 !important;
  display: flex !important;
  flex-direction: column !important;
  justify-content: flex-start !important;
  padding: 16px !important;
  width: 100%;
  background: #fff !important;
  border-bottom-left-radius: 0.5rem !important;
  border-bottom-right-radius: 0.5rem !important;
  font-weight: 700;
}
.instrument-desc {
  text-align: center !important;
  font-size: 1rem !important;
  color: #333 !important;
}
@media (max-width: 1024px) {
  .instrument-card {
    width: 100%;
    height: 240px !important;
  }
  .instrument-image {
    height: 150px !important;
  }

  .facilities .carousel-inner {
    height: 200px;
  }
}

#GBWC .numbering-text {
  text-align: start;
}

