/* =========================================================
   GLOBAL VARIABLES & RESET
   ========================================================= */
:root {
  --primary-color: #0d6efd;
  --primary-dark: #0b5ed7;
  --secondary-color: #6c757d;
  --accent-color: #0dcaf0;
  --light-color: #f8f9fa;
  --dark-color: #212529;
  --success-color: #198754;
  --danger-color: #dc3545;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html,
body {
  max-width: 100%;
  overflow-x: hidden;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
    "Helvetica Neue", Arial, sans-serif;
}

.container {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 15px;
}

/* =========================================================
   TOP BAR - COMPACT & CENTERED
   ========================================================= */
.top-bar {
  background: linear-gradient(90deg, #2f80ed, #56ccf2);
  color: white;
  font-size: 14.3px; /* +10% */
  height: 38px;
  display: flex;
  align-items: center;
}

.top-bar .container {
  height: 100%;
  padding: 0;
}

.top-bar .row {
  height: 100%;
  align-items: center;
  margin: 0;
}

.top-bar .col-md-4 {
  padding: 0 10px;
  display: flex;
  align-items: center;
  height: 100%;
}

.top-bar small {
  display: flex;
  align-items: center;
  gap: 5px;
  line-height: 1;
}

.top-bar i {
  font-size: 13.2px; /* +10% */
}

/* Counseling Code */
.top-bar .fw-bold {
  display: flex;
  align-items: center;
  gap: 5px;
  justify-content: center;
}

.top-bar .badge {
  background: linear-gradient(135deg, #d4af37, #ffdf6c, #b8962e);
  color: #f6f5ef;
  font-size: 14.3px; /* +10% */
  padding: 3px 10px;
  font-weight: 700;
  border-radius: 4px;
  border: 1px solid #ffd700;
  box-shadow: 0 0 6px rgba(255, 215, 0, 0.5);
  line-height: 1;
}

/* Online Admissions Button */
.top-bar a[href*="joining.indraganesan.org"] {
  padding: 3px 12px;
  border-radius: 12px;
  font-size: 13.2px; /* +10% */
  font-weight: 700;
  color: #0d6efd !important;
  background: #ffffff;
  border: 1px solid #ffffff;
  text-decoration: none;
  line-height: 1.2;
  animation: admissionBlinkSolid 1.6s infinite ease-in-out;
}

@keyframes admissionBlinkSolid {
  0%,
  100% {
    box-shadow: 0 0 0 rgba(255, 255, 255, 0);
    transform: scale(1);
  }
  50% {
    box-shadow: 0 0 10px rgba(255, 255, 255, 0.9);
    transform: scale(1.03);
  }
}

.top-bar a[href*="joining.indraganesan.org"]:hover {
  background: #ffffff;
  color: #084298 !important;
  box-shadow: 0 0 14px rgba(255, 255, 255, 1);
}

/* Social Icons */
.social-icons {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-left: 10px;
}

.social-icons a {
  font-size: 13.2px; /* +10% */
  width: 24px;
  height: 24px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.15);
  color: white;
  text-decoration: none;
}

.social-icons a:hover {
  background: #ffd700;
  color: #1a1a1a !important;
}

/* =========================================================
   NAVIGATION BAR - COMPACT & CENTERED
   ========================================================= */
.navbar {
  background: #fff !important;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
  padding: 8px 0;
}

.navbar > .container {
  padding: 0 15px;
}

/* Logo and Brand Area - PERFECTLY CENTERED */
.navbar-brand-center {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 100%;
  text-align: center;
  padding: 0;
}

.navbar-center-logo {
  height: 90px;
  width: auto;
  margin-bottom: 5px;
}

.navbar-brand-center-content {
  text-align: center;
  line-height: 1.1;
  width: 100%;
}

.tamil-text {
  font-size: 17.6px; /* +10% */
  font-weight: 700;
  color: var(--primary-color);
  margin: 0;
  line-height: 1.2;
  text-align: center;
}

.english-text {
  font-size: 28.6px; /* +10% */
  font-weight: 600;
  color: var(--primary-color);
  margin: 2px 0;
  line-height: 1.1;
  text-align: center;
  word-wrap: break-word;
}

.autonomous-text {
  font-size: 15.4px; /* +10% */
  font-weight: 700;
  color: var(--success-color);
  margin: 2px 0;
  line-height: 1.1;
  text-align: center;
}

.address-text {
  font-size: 13.2px; /* +10% */
  color: var(--secondary-color);
  margin: 2px 0;
  line-height: 1.1;
  text-align: center;
}

.accreditation-text {
  font-size: 13.2px; /* +10% */
  font-weight: 700;
  color: var(--danger-color);
  margin: 2px 0;
  line-height: 1.1;
  text-align: center;
}

/* Mobile-only compact version */
.mobile-college-info {
  display: none;
  flex-direction: column;
  align-items: flex-start;
  margin-left: 8px;
}

.mobile-college-name {
  font-size: 15.4px; /* +10% */
  font-weight: 700;
  color: var(--primary-color);
  line-height: 1.1;
}

.mobile-college-fullname {
  font-size: 12.1px; /* +10% */
  font-weight: 600;
  color: var(--dark-color);
  line-height: 1.1;
  margin-top: 2px;
}

.mobile-accreditation {
  font-size: 12.1px; /* +10% */
  color: var(--danger-color);
  font-weight: 600;
  line-height: 1.1;
  margin-top: 2px;
}

/* Hamburger Button */
.navbar-toggler {
  border: 1px solid rgba(0, 0, 0, 0.1);
  padding: 4px 8px;
  font-size: 16px;
  background-color: transparent;
  border-radius: 4px;
}

/* Mobile Header Info */
.mobile-header-info {
  display: none;
  padding: 8px;
  background: var(--light-color);
  border-radius: 4px;
  margin: 5px 0;
  text-align: center;
}

/* Two Row Navigation System */
.navbar-collapse {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
  margin-top: 8px;
}

.nav-first-row,
.nav-second-row {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  width: 100%;
  list-style: none;
  padding: 0;
  margin: 0;
}

.navbar-nav {
  width: 100%;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
}

.navbar-nav .nav-item {
  margin: 2px 4px;
  position: relative;
}

.navbar-nav .nav-link {
  padding: 5px 10px;
  font-size: 15.4px; /* +10% */
  border-radius: 3px;
  color: var(--dark-color);
  font-weight: 500;
  text-decoration: none;
  display: block;
  white-space: nowrap;
  line-height: 1.2;
}

.navbar-nav .nav-link:hover,
.navbar-nav .nav-link.active {
  color: var(--primary-color);
  background: rgba(13, 110, 253, 0.06);
}

/* Dropdowns */
.dropdown-menu {
  min-width: 180px;
  padding: 4px 0;
  border-radius: 4px;
  border: 1px solid rgba(0, 0, 0, 0.12);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  background: #fff;
  position: absolute;
  top: 100%;
  left: 0;
  z-index: 1000;
  display: none;
}

.dropdown-menu.show {
  display: block;
}

.dropdown-item {
  padding: 6px 12px;
  font-size: 14.3px; /* +10% */
  font-weight: 500;
  color: #444;
  text-decoration: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  line-height: 1.2;
  white-space: nowrap;
}

.dropdown-item:hover {
  background: rgba(13, 110, 253, 0.08);
  color: var(--primary-color);
}

.dropdown-item.dropdown-toggle::after {
  content: "›";
  border: none;
  font-size: 15.4px; /* +10% */
  margin-left: 5px;
}

/* Submenus */
.dropdown-submenu {
  position: relative;
}

.dropdown-submenu > .dropdown-menu {
  top: 0;
  left: 100%;
  margin-left: 2px;
  min-width: 180px;
  z-index: 1001;
}

/* =========================================================
   RESPONSIVE BREAKPOINTS
   ========================================================= */

/* Mobile Phones (< 768px) */
@media (max-width: 767.98px) {
  /* Top Bar Mobile */
  .top-bar {
    height: auto;
    padding: 5px 0;
    font-size: 12.1px; /* +10% */
  }

  .top-bar .row {
    flex-direction: column;
    gap: 4px;
    padding: 0;
  }

  .top-bar .col-md-4 {
    padding: 2px 5px;
    width: 100%;
    justify-content: center;
    text-align: center;
    height: auto;
  }

  .top-bar small {
    justify-content: center;
    gap: 3px;
  }

  .top-bar .badge {
    font-size: 12.1px; /* +10% */
    padding: 2px 6px;
  }

  .top-bar a[href*="joining.indraganesan.org"] {
    font-size: 12.1px; /* +10% */
    padding: 2px 8px;
  }

  .social-icons {
    margin: 3px 0 0;
    gap: 6px;
    justify-content: center;
  }

  .social-icons a {
    width: 22px;
    height: 22px;
    font-size: 12.1px; /* +10% */
  }

  /* Navigation Mobile */
  .navbar {
    padding: 5px 0;
  }

  .navbar > .container {
    padding: 0 10px;
  }

  .navbar > .container > .d-flex {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0;
  }

  /* Logo on Mobile */
  .navbar-brand-center {
    flex-direction: row;
    align-items: center;
    justify-content: flex-start;
    width: auto;
  }

  .navbar-center-logo {
    height: 40px;
    margin: 0;
    margin-right: 8px;
  }

  .navbar-brand-center-content {
    display: none;
  }

  /* Mobile College Info */
  .mobile-college-info {
    display: flex;
    flex: 1;
    margin-left: 8px;
  }

  .mobile-college-name {
    font-size: 14.3px; /* +10% */
  }

  .mobile-college-fullname {
    font-size: 11px; /* +10% */
  }

  .mobile-accreditation {
    font-size: 11px; /* +10% */
  }

  /* Hamburger */
  .navbar-toggler {
    margin-left: auto;
    padding: 3px 6px;
    font-size: 14px;
  }

  /* Mobile Menu */
  .navbar-collapse {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: white;
    box-shadow: 0 6px 15px rgba(0, 0, 0, 0.1);
    border-top: 1px solid rgba(0, 0, 0, 0.08);
    max-height: 65vh;
    overflow-y: auto;
    margin-top: 5px;
  }

  .nav-first-row,
  .nav-second-row {
    flex-direction: column;
  }

  .navbar-nav .nav-item {
    width: 100%;
    margin: 0;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
  }

  .navbar-nav .nav-link {
    padding: 10px 15px;
    width: 100%;
    text-align: left;
    font-size: 14.3px; /* +10% */
  }

  .dropdown-menu {
    position: static;
    width: 100%;
    border: none;
    box-shadow: none;
    background: rgba(0, 0, 0, 0.02);
    border-left: 2px solid var(--primary-color);
  }

  .dropdown-item {
    padding: 8px 20px;
    font-size: 13.2px; /* +10% */
  }

  .dropdown-submenu .dropdown-item {
    padding-left: 30px;
  }

  .mobile-header-info {
    display: block;
    padding: 6px;
    font-size: 12.1px; /* +10% */
  }
}

/* Tablets (768px - 991px) */
@media (min-width: 768px) and (max-width: 991.98px) {
  .top-bar {
    height: 36px;
    font-size: 13.2px; /* +10% */
  }

  .navbar {
    padding: 6px 0;
  }

  .navbar-center-logo {
    height: 70px;
  }

  .tamil-text {
    font-size: 15.4px; /* +10% */
  }

  .english-text {
    font-size: 22px; /* +10% */
  }

  .autonomous-text {
    font-size: 13.2px; /* +10% */
  }

  .address-text,
  .accreditation-text {
    font-size: 12.1px; /* +10% */
  }

  .navbar-nav .nav-link {
    font-size: 14.3px; /* +10% */
    padding: 4px 8px;
  }

  .mobile-college-info {
    display: none;
  }
}

/* Desktop (992px and up) */
@media (min-width: 992px) {
  /* Top Bar Desktop */
  .top-bar {
    height: 38px;
  }

  .top-bar .row {
    display: flex;
    justify-content: space-between;
    flex-wrap: nowrap;
  }

  .top-bar .col-md-4:nth-child(1) {
    justify-content: flex-start;
  }

  .top-bar .col-md-4:nth-child(2) {
    justify-content: center;
  }

  .top-bar .col-md-4:nth-child(3) {
    justify-content: flex-end;
  }

  /* Navigation Desktop */
  .navbar > .container {
    display: flex;
    flex-direction: column;
    align-items: center;
  }

  .navbar-brand-center {
    width: 100%;
  }

  .navbar-center-logo {
    height: 90px;
  }

  .tamil-text {
    font-size: 17.6px; /* +10% */
  }

  .english-text {
    font-size: 28.6px; /* +10% */
  }

  .autonomous-text {
    font-size: 15.4px; /* +10% */
  }

  .address-text,
  .accreditation-text {
    font-size: 13.2px; /* +10% */
  }

  .mobile-college-info,
  .mobile-header-info {
    display: none !important;
  }

  /* Desktop Navigation */
  .nav-first-row,
  .nav-second-row {
    justify-content: center;
  }

  .navbar-nav .nav-item {
    margin: 2px 4px;
  }

  /* Desktop Hover Effects */
  .nav-item.dropdown:hover > .dropdown-menu {
    display: block;
  }

  .dropdown-submenu:hover > .dropdown-menu {
    display: block;
  }
}

/* Large Desktop (1200px and up) */
@media (min-width: 1200px) {
  .navbar-center-logo {
    height: 100px;
  }

  .english-text {
    font-size: 30.8px; /* +10% */
  }

  .navbar-nav .nav-link {
    font-size: 15.4px; /* +10% */
    padding: 6px 12px;
  }
}

/* =========================================================
   TOUCH FRIENDLY FOR MOBILE
   ========================================================= */
@media (max-width: 767.98px) {
  .nav-link,
  .dropdown-item {
    min-height: 40px;
    display: flex;
    align-items: center;
  }

  .navbar-toggler {
    min-width: 40px;
    min-height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
  }
}

/* =========================================================
   VERY SMALL PHONES (< 380px)
   ========================================================= */
@media (max-width: 380px) {
  .mobile-college-name {
    font-size: 13.2px; /* +10% */
  }

  .mobile-college-fullname {
    font-size: 9.9px; /* +10% */
  }

  .mobile-accreditation {
    font-size: 9.9px; /* +10% */
  }

  .navbar-center-logo {
    height: 35px;
    margin-right: 6px;
  }

  .navbar-toggler {
    padding: 2px 4px;
    font-size: 13px;
  }

  .navbar-nav .nav-link {
    padding: 8px 12px;
    font-size: 13.2px; /* +10% */
  }
}

/* =========================================================
   FINAL NAVBAR & DROPDOWN OVERRIDES (AUTHORITATIVE)
   Paste at VERY END of header.css
   ========================================================= */

/* =========================================================
   MOBILE & TABLET (Bootstrap-controlled visibility)
   ========================================================= */
@media (max-width: 991.98px) {
  /* Main mobile menu */
  .navbar-collapse {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: #ffffff;
    z-index: 9999;
    display: none; /* Bootstrap + JS control */
    width: 100%;
  }

  .navbar-collapse.show {
    display: block;
  }

  /* First-level dropdowns */
  .dropdown-menu {
    display: none;
    position: static;
    float: none;
    width: 100%;
    margin: 0;
    padding: 0;
    border: none;
    box-shadow: none;
    background: rgba(0, 0, 0, 0.02);
  }

  .dropdown-menu.show {
    display: block;
  }

  /* Nested dropdowns */
  .dropdown-submenu > .dropdown-menu {
    display: none;
    padding-left: 0;
    margin-left: 0;
    border-left: 3px solid var(--primary-color);
    background: rgba(0, 0, 0, 0.03);
  }

  .dropdown-submenu > .dropdown-menu.show {
    display: block;
  }

  /* Touch-friendly spacing */
  .dropdown-item,
  .nav-link {
    min-height: 44px;
    display: flex;
    align-items: center;
  }
}

/* =========================================================
   DESKTOP (Your custom layout preserved)
   ========================================================= */
@media (min-width: 992px) {
  .navbar-collapse {
    position: static;
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
  }

  /* Desktop dropdowns behave normally */
  .dropdown-menu {
    display: none;
    position: absolute;
    background: #ffffff;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    border: 1px solid rgba(0, 0, 0, 0.12);
  }

  .nav-item.dropdown:hover > .dropdown-menu {
    display: block;
  }

  .dropdown-submenu:hover > .dropdown-menu {
    display: block;
    left: 100%;
    top: 0;
  }
}

/* =========================================================
   MOBILE: AUTO-SHOW ALL NESTED DROPDOWNS
   ========================================================= */
@media (max-width: 991.98px) {
  /* When a parent dropdown is open, show all its children */
  .nav-item.dropdown > .dropdown-menu.show .dropdown-menu {
    display: block !important;
    position: static;
    margin-left: 0;
    border-left: 3px solid var(--primary-color);
    background: rgba(0, 0, 0, 0.03);
  }

  /* Ensure top-level dropdown is visible */
  .nav-item.dropdown > .dropdown-menu.show {
    display: block;
  }
}

