/* ============================================================
   GGSMH - Responsive Styles
   ============================================================ */

/* --- Images & Media --- */
img { max-width: 100%; height: auto; }
iframe, video, embed { max-width: 100%; }

/* --- Tables --- */
.table-responsive-wrapper {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  width: 100%;
}
.table-responsive-wrapper table { min-width: 600px; }

/* --- Container --- */
@media (max-width: 767px) {
  .container { padding-left: 15px; padding-right: 15px; }
}

/* ============================================================
   HEADER & NAVIGATION
   ============================================================ */

/* Top bar */
@media (max-width: 991px) {
  .topbar-section .col-md-2,
  .topbar-section .col-md-7,
  .topbar-section .col-md-3 {
    width: 100%;
    text-align: center !important;
    margin-bottom: 5px;
  }
  .topbar-section .top-right { text-align: center !important; float: none !important; }
  .topbar-section p { font-size: 13px; }
}

/* Main navbar - collapse on mobile */
@media (max-width: 767px) {
  .navbar-header { display: block; }
  .navbar-toggle { display: block; }
  .navbar-nav-wrapper { display: none; }
  .navbar-nav-wrapper.in { display: block; }
  .navbar-nav {
    float: none !important;
    margin: 0;
  }
  .navbar-nav > li {
    float: none;
    display: block;
    text-align: center;
  }
  .navbar-nav > li > a {
    padding: 10px 15px;
    font-size: 14px;
  }
  .navbar-nav .dropdown-menu {
    position: static;
    float: none;
    width: 100%;
    background: #f5f5f5;
    box-shadow: none;
    border: none;
  }
  .navbar-nav .dropdown-menu > li > a { padding: 8px 25px; }
  .navbar-fixed-top .navbar-collapse {
    max-height: 350px;
    overflow-y: auto;
  }
  header#inner-navigation .col-lg-2,
  header#inner-navigation .col-md-2,
  header#inner-navigation .col-sm-2,
  header#inner-navigation .col-lg-10,
  header#inner-navigation .col-md-10,
  header#inner-navigation .col-sm-10 {
    width: auto;
    display: inline-block;
    vertical-align: middle;
    float: none;
  }
  header#inner-navigation .col-lg-12,
  header#inner-navigation .col-md-12,
  header#inner-navigation .col-sm-12 {
    text-align: center;
  }
  header#inner-navigation h1 {
    font-size: 16px !important;
    margin-top: 10px !important;
  }
  .navbar-default .navbar-nav > li > a { color: #fff !important; }
  .navbar-nav-wrapper {
    background: #221010 !important;
  }
  .navbar-nav .dropdown-menu > li > a { color: #333 !important; }
}

/* ============================================================
   BREADCRUMB
   ============================================================ */
@media (max-width: 767px) {
  .breadcrumb-main .breadcrumb {
    font-size: 13px;
    padding: 8px 10px;
  }
  .breadcrumb-main .breadcrumb li { white-space: nowrap; }
}

/* ============================================================
   HOMEPAGE - CAROUSEL / SLIDER
   ============================================================ */
@media (max-width: 991px) {
  #fw_al_009 .carousel-inner img { width: 100%; height: auto; }
}
@media (max-width: 767px) {
  #fw_al_009 { margin-bottom: 15px; }
  #fw_al_009 .carousel-control .fa {
    font-size: 20px;
    padding: 8px;
  }
}

/* ============================================================
   HOMEPAGE - DEPARTMENTS GRID
   ============================================================ */
@media (max-width: 991px) {
  #listofservices .col-md-3 { width: 33.333%; }
}
@media (max-width: 767px) {
  #listofservices .col-md-3 { width: 50%; }
  #listofservices .curved-border {
    padding: 8px 5px;
    margin-bottom: 8px;
  }
  #listofservices .curved-border h4 { font-size: 13px; }
}
@media (max-width: 480px) {
  #listofservices .col-md-3 { width: 100%; }
}

/* ============================================================
   HOMEPAGE - BOOKING SECTION
   ============================================================ */
@media (max-width: 767px) {
  .container > .col-md-12[style*="border:1px solid red"] > div {
    width: 100% !important;
    padding: 10px !important;
  }
  .container > .col-md-12[style*="border:1px solid red"] h2 { font-size: 20px; }
  .container > .col-md-12[style*="border:1px solid red"] h3 { font-size: 16px; }
  .container > .col-md-12[style*="border:1px solid red"] h4 { font-size: 14px; }
  #statuscontainer { margin-top: 10px; }
}

/* ============================================================
   HOMEPAGE - FACULTY CARDS
   ============================================================ */
@media (max-width: 991px) {
  .inner-heading + .col-md-2,
  .inner-heading + div > .col-md-2 {
    width: 33.333%;
  }
}
@media (max-width: 767px) {
  .inner-heading + .col-md-2,
  .inner-heading + div > .col-md-2 {
    width: 50%;
  }
  .card {
    width: 100% !important;
    max-width: 250px;
  }
  .card img {
    max-width: 100px !important;
    min-width: 80px !important;
    max-height: 120px !important;
    min-height: 100px !important;
  }
  .card-title { font-size: 14px; }
  .card-text { font-size: 12px; }
}
@media (max-width: 480px) {
  .inner-heading + .col-md-2,
  .inner-heading + div > .col-md-2 {
    width: 100%;
  }
}

/* ============================================================
   HOMEPAGE - ABOUT / SERVICES SECTION
   ============================================================ */
@media (max-width: 991px) {
  .about_services .col-md-3,
  .about_services .col-md-9 { width: 100%; }
  .about_services .col-md-9 { margin-top: 20px; }
  .smart-campus .col-md-4 { width: 33.333%; }
}
@media (max-width: 767px) {
  .smart-campus .col-md-4 { width: 50%; font-size: 13px; }
}
@media (max-width: 480px) {
  .smart-campus .col-md-4 { width: 100%; }
}

/* OPD Schedule Section */
@media (max-width: 767px) {
  .opd { width: 100% !important; margin-left: 0 !important; }
  .opd .col-md-6 { width: 100%; text-align: center; padding: 5px !important; }
  .opd h3 { font-size: 16px; }
}

/* ============================================================
   OUR SERVICES SECTION (SERVICE DESCRIPTIONS)
   ============================================================ */
@media (max-width: 991px) {
  section.pt-60 .col-md-4.page-title { width: 50%; }
}
@media (max-width: 767px) {
  section.pt-60 .col-md-4.page-title { width: 100%; margin-bottom: 20px; }
  section.pt-60 .theading,
  section.pt-60 h4 { font-size: 16px; }
  section.pt-60 figure { font-size: 14px; }
}

/* ============================================================
   INNER PAGES - ABOUT, CONTACT, ETC.
   ============================================================ */
@media (max-width: 767px) {
  .about_services .col-sm-6 { width: 100%; }
  .about_services .col-sm-6 img { width: 100%; margin-bottom: 20px; }
  .contact-inner .col-md-4 { width: 100%; margin-bottom: 15px; }
  .contact-inner .contact_txt_left ul {
    border-right: none;
    height: auto;
    padding-bottom: 10px;
    border-bottom: 1px dashed #d00e0e;
  }
  .contactheading { font-size: 30px !important; }
  #mt_contact .inner-heading { margin-bottom: 15px; }
}

/* ============================================================
   OUR FACULTIES PAGE
   ============================================================ */
@media (max-width: 991px) {
  .ourfaculties-page .col-md-3 { width: 33.333%; }
}
@media (max-width: 767px) {
  .ourfaculties-page .col-md-3 { width: 50%; }
}
@media (max-width: 480px) {
  .ourfaculties-page .col-md-3 { width: 100%; }
}

/* ============================================================
   FACULTY DETAILS / OPD TABLE
   ============================================================ */
@media (max-width: 767px) {
  .table { font-size: 13px; }
  .table thead { display: none; }
  .table tbody tr {
    display: block;
    margin-bottom: 15px;
    border: 1px solid #ddd;
    border-radius: 5px;
    padding: 10px;
  }
  .table tbody td {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 5px;
    border: none;
    border-bottom: 1px solid #eee;
    text-align: right;
  }
  .table tbody td:before {
    content: attr(data-label);
    font-weight: bold;
    text-align: left;
    padding-right: 10px;
  }
  .table tbody td:last-child { border-bottom: none; }
}

/* ============================================================
   PHOTO GALLERY
   ============================================================ */
@media (max-width: 991px) {
  .gallery-container .col-md-2 { width: 33.333%; }
  .gallery-container img {
    min-width: 100% !important;
    max-width: 100% !important;
    min-height: auto !important;
    max-height: 160px !important;
  }
}
@media (max-width: 767px) {
  .gallery-container .col-md-2 { width: 50%; }
  .gallery-container .col-sm-6 { width: 50%; }
}
@media (max-width: 480px) {
  .gallery-container .col-md-2,
  .gallery-container .col-sm-6 { width: 100%; }
}

/* ============================================================
   FOOTER
   ============================================================ */
@media (max-width: 767px) {
  #mt_footer .col-sm-6 { width: 100%; text-align: center; }
  #mt_footer .follow_us.pull-right {
    float: none !important;
    margin-top: 10px;
  }
  #mt_footer .social_icons {
    text-align: center;
    display: inline-block;
  }
  #mt_footer .copy_txt p { font-size: 13px; }
}

/* Alert / Advisory Notice */
@media (max-width: 767px) {
  .alert-warning {
    font-size: 13px;
    padding: 10px;
  }
  .alert-warning h4 { font-size: 15px; }
  .alert-warning ol { padding-left: 20px; }
}

/* ============================================================
   MODAL (POPUP)
   ============================================================ */
@media (max-width: 767px) {
  .modal-dialog { margin: 30px 10px; }
  .modal-body img { width: 100%; height: auto; }
}

/* ============================================================
   BACK TO TOP BUTTON
   ============================================================ */
@media (max-width: 767px) {
  .back-to-top {
    width: 36px;
    height: 36px;
    padding: 6px 0 !important;
    font-size: 14px !important;
    right: 15px !important;
    bottom: 15px !important;
  }
}

/* ============================================================
   WHATSAPP / CALL BUTTON
   ============================================================ */
@media (max-width: 767px) {
  .wp-call-button {
    right: 15px !important;
    bottom: 60px !important;
    width: 36px !important;
    height: 36px !important;
    background-size: 24px 24px !important;
  }
}

/* ============================================================
   NOTIFICATION / NEWS PAGE
   ============================================================ */
@media (max-width: 767px) {
  .notice_heading h1 { font-size: 14px; margin-left: 5px; }
}

/* ============================================================
   TERMS & CONDITIONS / TEXT PAGES
   ============================================================ */
@media (max-width: 767px) {
  .terms-content { padding: 15px; }
  .terms-content h2 { font-size: 20px; }
  .terms-content h3 { font-size: 16px; }
}

/* ============================================================
   MISCELLANEOUS FIXES
   ============================================================ */
@media (max-width: 767px) {
  .text-center-mobile { text-align: center !important; }
  .hidden-mobile { display: none !important; }
  .mt-2 { margin-top: 10px !important; }
  .mb-2 { margin-bottom: 10px !important; }
  .p-3 { padding: 10px !important; }
}
@media (min-width: 768px) {
  .visible-mobile { display: none !important; }
}

/* Fix for elements with inline min-width/max-width that overflow */
[style*="min-width:"]:not(img):not(table),
[style*="max-width:"]:not(img):not(table) {
  max-width: 100% !important;
}

/* Fix for any fixed-width containers */
@media (max-width: 767px) {
  .sec-title h2 { font-size: 22px; }
  .inner-heading h2 { font-size: 20px; }
  .inner-heading h3 { font-size: 16px; }
}

/* Ensure navbar does not overlap content */
@media (max-width: 767px) {
  body { padding-top: 0 !important; }
  .navbar-fixed-top { position: relative !important; }
  .navbar-sticky-function { top: 0 !important; }
}

/* Desktop navbar: ensure nav menu items are centered and dropdowns work */
@media (min-width: 768px) {
  .navbar-nav-wrapper .nav.navbar-nav {
    display: inline-block !important;
    float: none !important;
    vertical-align: top;
  }
  .navbar-nav-wrapper .nav.navbar-nav > li {
    float: none;
    display: inline-block;
  }
  .navbar-nav-wrapper {
    text-align: center !important;
  }
  /* Fix dropdown positioning for centered nav */
  .nav.navbar-nav > li > ul {
    text-align: left;
  }
}

/* Mobile nav collapse behavior */
@media (max-width: 767px) {
  #nav-desktop { display: none; }
  #nav-desktop.mobile-open { display: block; }
}
@media (min-width: 768px) {
  #nav-desktop { display: block !important; }
}

/* Fix for slicknav mobile menu container */
#slicknav-mobile { display: none; }
@media (max-width: 767px) {
  #slicknav-mobile { display: block; }
}

/* Force responsive behavior for elements with !important fixed widths */
@media (max-width: 767px) {
  .icon_part { width: 100% !important; margin-left: 0 !important; }
  .icon_part ul li { width: 33.333% !important; }
  .topper_in { width: 100% !important; }
}

/* ============================================================
   MOBILE NAV TOGGLE
   ============================================================ */
.mobile-nav-toggle {
  background: transparent;
  border: 1px solid #221010;
  border-radius: 4px;
  padding: 8px 10px;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.mobile-nav-toggle span {
  display: block;
  width: 22px;
  height: 2px;
  background: #221010;
  border-radius: 1px;
}
.mobile-nav-toggle:hover,
.mobile-nav-toggle:focus {
  background: rgba(0,0,0,0.05);
}

/* ============================================================
   OUR FACULTIES DETAILS PAGE
   ============================================================ */
@media (max-width: 767px) {
  .ourfaculties-details .col-md-3,
  .ourfaculties-details .col-sm-3 {
    width: 100%;
    margin-bottom: 15px;
  }
  .ourfaculties-details .col-md-9,
  .ourfaculties-details .col-sm-9 {
    width: 100%;
  }
  .ourfaculties-details .card-title h2 { font-size: 20px; }
}

/* ============================================================
   ADMIN LOGIN PAGE
   ============================================================ */
@media (max-width: 767px) {
  .admin-login-page .col-md-4.col-md-offset-4 {
    width: 90%;
    margin: 2em auto !important;
    float: none;
  }
}

/* ============================================================
   ADMIN PANEL RESPONSIVE
   ============================================================ */
@media (max-width: 991px) {
  .admin-container .content-panel,
  .content-panel {
    padding: 10px !important;
  }
  .admin-container .db-2 li,
  .db-2 li {
    width: 48%;
    margin: 1%;
    display: inline-block;
  }
}
@media (max-width: 767px) {
  .admin-container .db-2 li,
  .db-2 li {
    width: 100%;
    margin: 5px 0;
  }
  /* Force admin tables to scroll horizontally */
  .table-responsive {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  .table-responsive > table {
    min-width: 600px;
  }
  /* Fix misapplied table-responsive on <table> elements */
  table.table-responsive {
    display: block;
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  /* General admin table fix */
  .table-bordered {
    font-size: 12px;
  }
  .table-bordered th,
  .table-bordered td {
    padding: 5px 4px !important;
    white-space: nowrap;
  }
  .admin-container .btn,
  .content-panel .btn {
    font-size: 12px;
    padding: 4px 8px;
  }
  .admin-container h3,
  .content-panel h3 {
    font-size: 16px;
  }
  .admin-container h2,
  .content-panel h2 {
    font-size: 18px;
  }
  /* Admin sidebar */
  .admin-sidebar,
  aside {
    width: 100% !important;
    height: auto !important;
    position: relative !important;
  }
}

/* ============================================================
   PHOTO GALLERY FIX
   ============================================================ */
@media (max-width: 767px) {
  .gallery-img {
    min-width: 100% !important;
    max-width: 100% !important;
    min-height: 140px !important;
    max-height: 200px !important;
    object-fit: cover;
  }
}
