/* =========================================================
   GLOBAL VARIABLES & RESET - UPDATED WITH BRAND COLORS
   ========================================================= */
:root {
  --primary-color: #8A1C6E;      /* Deep magenta/plum */
  --primary-dark: #6F1A59;        /* Darker plum */
  --secondary-color: #5f4b5b;     /* Muted purple-gray */
  --accent-color: #C43A92;         /* Bright magenta */
  --light-color: #F7EFF4;          /* Soft lavender-tinted white */
  --dark-color: #2A1A24;           /* Deep purple-black */
  --success-color: #2E8B57;        /* Keeping green for success */
  --danger-color: #C0392B;         /* Keeping red for alerts */
}

* {
  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 - BRAND GRADIENT
   ========================================================= */
.top-bar {
  background: linear-gradient(90deg, #8A1C6E, #C43A92);  /* Deep plum to bright magenta */
  color: white;
  font-size: 14.3px;
  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;
}

/* Online Admissions Button - Brand Compliant */
.top-bar a[href*="joining.indraganesan.org"] {
  padding: 3px 12px;
  border-radius: 12px;
  font-size: 13.2px;
  font-weight: 700;
  color: #8A1C6E !important;  /* Deep plum text */
  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(138, 28, 110, 0.2);  /* Plum shadow */
    transform: scale(1);
  }
  50% {
    box-shadow: 0 0 10px rgba(196, 58, 146, 0.8);  /* Magenta glow */
    transform: scale(1.03);
  }
}

.top-bar a[href*="joining.indraganesan.org"]:hover {
  background: #ffffff;
  color: #6F1A59 !important;  /* Darker plum on hover */
  box-shadow: 0 0 14px rgba(196, 58, 146, 0.9);  /* Magenta glow */
}

/* Social Icons */
.social-icons {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-left: 10px;
}

.social-icons a {
  font-size: 13.2px;
  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;
  transition: all 0.3s ease;
}

.social-icons a:hover {
  background: #C43A92;  /* Brand magenta on hover */
  color: #ffffff !important;
  transform: translateY(-2px);
}

/* =========================================================
   NAVIGATION BAR - BRAND COLORS
   ========================================================= */
.navbar {
  background: #fff !important;
  box-shadow: 0 2px 8px rgba(138, 28, 110, 0.15);  /* Plum tinted shadow */
  padding: 8px 0;
}

.navbar > .container {
  padding: 0 15px;
}

/* Logo and Brand Area */
.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;
  font-weight: 700;
  color: var(--primary-color);  /* Deep plum */
  margin: 0;
  line-height: 1.2;
  text-align: center;
}

.english-text {
  font-size: 28.6px;
  font-weight: 600;
  color: var(--primary-color);  /* Deep plum */
  margin: 2px 0;
  line-height: 1.1;
  text-align: center;
  word-wrap: break-word;
}

.autonomous-text {
  font-size: 15.4px;
  font-weight: 700;
  color: var(--success-color);  /* Keeping green for emphasis */
  margin: 2px 0;
  line-height: 1.1;
  text-align: center;
}

.address-text {
  font-size: 13.2px;
  color: var(--secondary-color);  /* Muted purple-gray */
  margin: 2px 0;
  line-height: 1.1;
  text-align: center;
}

.accreditation-text {
  font-size: 13.2px;
  font-weight: 700;
  color: var(--danger-color);  /* Keeping red for emphasis */
  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;
  font-weight: 700;
  color: var(--primary-color);  /* Deep plum */
  line-height: 1.1;
}

.mobile-college-fullname {
  font-size: 12.1px;
  font-weight: 600;
  color: var(--dark-color);
  line-height: 1.1;
  margin-top: 2px;
}

.mobile-accreditation {
  font-size: 12.1px;
  color: var(--danger-color);
  font-weight: 600;
  line-height: 1.1;
  margin-top: 2px;
}

/* Hamburger Button - Brand Colors */
.navbar-toggler {
  border: 1px solid rgba(138, 28, 110, 0.2);  /* Plum border */
  padding: 4px 8px;
  font-size: 16px;
  background-color: transparent;
  border-radius: 4px;
  color: var(--primary-color);
}

.navbar-toggler:focus {
  box-shadow: 0 0 0 3px rgba(196, 58, 146, 0.25);  /* Magenta focus ring */
}

.navbar-toggler-icon {
  background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 30 30'%3e%3cpath stroke='rgba%28138, 28, 110, 0.8%29' stroke-linecap='round' stroke-miterlimit='10' stroke-width='2' d='M4 7h22M4 15h22M4 23h22'/%3e%3c/svg%3e");
}

/* Mobile Header Info */
.mobile-header-info {
  display: none;
  padding: 8px;
  background: var(--light-color);  /* Soft lavender-tinted white */
  border-radius: 4px;
  margin: 5px 0;
  text-align: center;
  color: var(--dark-color);
}

/* 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;
  border-radius: 3px;
  color: var(--dark-color);
  font-weight: 500;
  text-decoration: none;
  display: block;
  white-space: nowrap;
  line-height: 1.2;
  transition: all 0.3s ease;
}

.navbar-nav .nav-link:hover,
.navbar-nav .nav-link.active {
  color: var(--primary-color);  /* Deep plum */
  background: rgba(138, 28, 110, 0.08);  /* Plum tinted background */
}

/* Dropdowns - Brand Colors */
.dropdown-menu {
  min-width: 180px;
  padding: 4px 0;
  border-radius: 4px;
  border: 1px solid rgba(138, 28, 110, 0.12);  /* Plum border */
  box-shadow: 0 4px 12px rgba(138, 28, 110, 0.15);  /* Plum shadow */
  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;
  font-weight: 500;
  color: #444;
  text-decoration: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  line-height: 1.2;
  white-space: nowrap;
  transition: all 0.2s ease;
}

.dropdown-item:hover {
  background: rgba(138, 28, 110, 0.08);  /* Plum tinted background */
  color: var(--primary-color);  /* Deep plum */
}

.dropdown-item.dropdown-toggle::after {
  content: "›";
  border: none;
  font-size: 15.4px;
  margin-left: 5px;
  color: var(--accent-color);  /* Bright magenta arrow */
}

/* Submenus */
.dropdown-submenu {
  position: relative;
}

.dropdown-submenu > .dropdown-menu {
  top: 0;
  left: 100%;
  margin-left: 2px;
  min-width: 180px;
  z-index: 1001;
}

/* =========================================================
   RESPONSIVE BREAKPOINTS - WITH BRAND COLORS
   ========================================================= */

/* Mobile Phones (< 768px) */
@media (max-width: 767.98px) {
  /* Top Bar Mobile */
  .top-bar {
    height: auto;
    padding: 5px 0;
    font-size: 12.1px;
  }

  .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 a[href*="joining.indraganesan.org"] {
    font-size: 12.1px;
    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;
  }

  /* 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;
    color: var(--primary-color);  /* Deep plum */
  }

  .mobile-college-fullname {
    font-size: 11px;
  }

  .mobile-accreditation {
    font-size: 11px;
  }

  /* 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(138, 28, 110, 0.15);  /* Plum shadow */
    border-top: 1px solid rgba(138, 28, 110, 0.08);  /* Plum border */
    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(138, 28, 110, 0.08);  /* Plum border */
  }

  .navbar-nav .nav-link {
    padding: 10px 15px;
    width: 100%;
    text-align: left;
    font-size: 14.3px;
  }

  .navbar-nav .nav-link:hover,
  .navbar-nav .nav-link.active {
    background: rgba(138, 28, 110, 0.05);  /* Light plum background */
  }

  .dropdown-menu {
    position: static;
    width: 100%;
    border: none;
    box-shadow: none;
    background: rgba(138, 28, 110, 0.02);  /* Very light plum */
    border-left: 2px solid var(--primary-color);  /* Deep plum border */
  }

  .dropdown-item {
    padding: 8px 20px;
    font-size: 13.2px;
  }

  .dropdown-item:hover {
    background: rgba(138, 28, 110, 0.05);
  }

  .dropdown-submenu .dropdown-item {
    padding-left: 30px;
  }

  .mobile-header-info {
    display: block;
    padding: 6px;
    font-size: 12.1px;
    background: var(--light-color);
    color: var(--dark-color);
  }
}

/* Tablets (768px - 991px) */
@media (min-width: 768px) and (max-width: 991.98px) {
  .top-bar {
    height: 36px;
    font-size: 13.2px;
  }

  .navbar {
    padding: 6px 0;
  }

  .navbar-center-logo {
    height: 70px;
  }

  .tamil-text {
    font-size: 15.4px;
    color: var(--primary-color);
  }

  .english-text {
    font-size: 22px;
    color: var(--primary-color);
  }

  .autonomous-text {
    font-size: 13.2px;
  }

  .address-text,
  .accreditation-text {
    font-size: 12.1px;
  }

  .navbar-nav .nav-link {
    font-size: 14.3px;
    padding: 4px 8px;
  }

  .navbar-nav .nav-link:hover {
    color: var(--primary-color);
  }

  .mobile-college-info {
    display: none;
  }
}

/* Desktop (992px and up) */
@media (min-width: 992px) {
  /* Top Bar Desktop */
  .top-bar {
    height: 38px;
    background: linear-gradient(90deg, #8A1C6E, #C43A92);
  }

  .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;
    color: var(--primary-color);
  }

  .english-text {
    font-size: 28.6px;
    color: var(--primary-color);
  }

  .autonomous-text {
    font-size: 15.4px;
  }

  .address-text,
  .accreditation-text {
    font-size: 13.2px;
  }

  .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 - Brand Colors */
  .nav-item.dropdown:hover > .dropdown-menu {
    display: block;
    border-color: rgba(138, 28, 110, 0.2);
  }

  .dropdown-submenu:hover > .dropdown-menu {
    display: block;
    left: 100%;
    top: 0;
  }
}

/* Large Desktop (1200px and up) */
@media (min-width: 1200px) {
  .navbar-center-logo {
    height: 100px;
  }

  .english-text {
    font-size: 30.8px;
    color: var(--primary-color);
  }

  .navbar-nav .nav-link {
    font-size: 15.4px;
    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;
    color: var(--primary-color);
  }

  .mobile-college-fullname {
    font-size: 9.9px;
  }

  .mobile-accreditation {
    font-size: 9.9px;
  }

  .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;
  }
}

/* =========================================================
   FINAL NAVBAR & DROPDOWN OVERRIDES - BRAND COLORS
   ========================================================= */

/* Mobile & Tablet Overrides */
@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;
    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(138, 28, 110, 0.02);  /* Very light plum */
  }

  .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);  /* Deep plum border */
    background: rgba(138, 28, 110, 0.03);  /* Slightly darker plum */
  }

  .dropdown-submenu > .dropdown-menu.show {
    display: block;
  }

  /* Touch-friendly spacing */
  .dropdown-item,
  .nav-link {
    min-height: 44px;
    display: flex;
    align-items: center;
  }
}

/* Desktop Overrides */
@media (min-width: 992px) {
  .navbar-collapse {
    position: static;
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
  }

  /* Desktop dropdowns */
  .dropdown-menu {
    display: none;
    position: absolute;
    background: #ffffff;
    box-shadow: 0 4px 12px rgba(138, 28, 110, 0.15);  /* Plum shadow */
    border: 1px solid rgba(138, 28, 110, 0.12);  /* Plum border */
  }

  .nav-item.dropdown:hover > .dropdown-menu {
    display: block;
  }

  .dropdown-submenu:hover > .dropdown-menu {
    display: block;
    left: 100%;
    top: 0;
  }
}

/* Mobile Auto-show 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);  /* Deep plum border */
    background: rgba(138, 28, 110, 0.03);  /* Light plum background */
  }

  /* Ensure top-level dropdown is visible */
  .nav-item.dropdown > .dropdown-menu.show {
    display: block;
  }
}

/* =========================================================
   ADDITIONAL BRAND ACCENTS
   ========================================================= */

/* Selection color - Brand compliant */
::selection {
  background: var(--primary-color);
  color: white;
}

::-moz-selection {
  background: var(--primary-color);
  color: white;
}

/* Focus indicators - Brand compliant */
:focus-visible {
  outline: 2px solid var(--accent-color);
  outline-offset: 2px;
}

/* Scrollbar styling (optional - webkit browsers) */
::-webkit-scrollbar-thumb {
  background: var(--primary-color);
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--accent-color);
}

::-webkit-scrollbar-track {
  background: var(--light-color);
}
