/**
 * Header Fixes - Centralized Header & Mobile Menu Fixes
 * Purpose: Ensure consistent header design across all pages (home-v1 to home-v8, About, Tuition, Department, etc.)
 * Features:
 * - Side header width: 530px
 * - Vertically centered content with equal top/bottom spacing
 * - Fixed mobile menu dropdown overlap issues
 * - Consistent design structure for all pages
 */

/* ========================================
   SIDE HEADER - VERTICAL CENTERING & WIDTH
   ======================================== */

/* Main side header container */
.td_side_header {
  position: fixed;
  top: 0;
  right: 0;
  z-index: 2000;
  width: 100%;
  max-width: 100%;
  height: 100vh;
  opacity: 0;
  visibility: hidden;
  transition: all 0.4s ease;
  pointer-events: none;
}

.td_side_header.active {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}
@media (max-width: 767px) {
  a.td_mobile_logo {
    width: 100%;
}
}

/* Side header content wrapper - 530px width with vertical centering */
.td_side_header_in {
  width: 530px !important;
  max-width: 92vw !important;
  height: 100vh;
  flex: none;
  margin-left: auto;
  overflow: auto;
  padding: 80px 50px 80px 50px !important;
  position: relative;
  z-index: 2;
  right: -530px;
  transition: all 0.4s ease;
  box-shadow: none;
  background: #fff;

  /* Vertical centering for content */
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.td_side_header.active .td_side_header_in {
  right: 0;
}

/* Ensure content doesn't overflow and is properly spaced */
.td_side_header_in > * {
  position: relative;
  z-index: 1;
}

/* Adjust padding for smaller screens */
@media (max-width: 768px) {
  .td_side_header_in {
    padding: 60px 40px 60px 40px !important;
  }
}

@media (max-width: 576px) {
  .td_side_header_in {
    padding: 50px 30px 50px 30px !important;
  }
}

@media (max-width: 450px) {
  .td_side_header_in {
    padding: 40px 25px 40px 25px !important;
    width: 90vw !important;
  }
}

/* ========================================
   MOBILE MENU DROPDOWN - FIX OVERLAP
   ======================================== */

/* Mobile menu dropdown toggle button - NO OVERLAP */
@media screen and (max-width: 1199px) {
  .td_munu_dropdown_toggle {
    position: absolute !important;
    height: 100% !important;
    width: 50px !important;
    top: 0 !important;
    right: 0 !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    cursor: pointer !important;
    z-index: 10 !important;
    background: transparent !important;
    border: none !important;
    padding: 0 !important;
    left: auto !important;
  }

  .td_munu_dropdown_toggle span {
    display: block !important;
    position: relative !important;
    height: 14px !important;
    width: 14px !important;
  }

  .td_munu_dropdown_toggle span::before,
  .td_munu_dropdown_toggle span::after {
    content: '' !important;
    display: block !important;
    position: absolute !important;
    left: 50% !important;
    top: 50% !important;
    transform: translate(-50%, -50%) !important;
    height: 2px !important;
    width: 14px !important;
    background-color: currentColor !important;
    transition: all 0.3s ease !important;
  }

  .td_munu_dropdown_toggle span::before {
    transform: translate(-50%, -50%) rotate(90deg) !important;
  }

  .td_munu_dropdown_toggle.active span::before {
    transform: translate(-50%, -50%) rotate(0deg) !important;
  }

  /* Ensure menu item text doesn't overlap with toggle button */
  .menu-item-has-children {
    position: relative !important;
  }

  .menu-item-has-children > a {
    padding-right: 55px !important;
  }

  /* Nested dropdown toggles - slightly smaller */
  .menu-item-has-children .menu-item-has-children .td_munu_dropdown_toggle {
    width: 45px !important;
  }

  /* Mobile navigation list */
  .td_nav .td_nav_list {
    width: 100%;
    padding: 0;
    line-height: 1.6em;
  }

  .td_nav .td_nav_list ul {
    padding-left: 15px;
    display: none;
  }

  .td_nav .td_nav_list a {
    display: block;
    padding: 12px 15px;
    line-height: 16px;
    position: relative;
  }

  .td_nav .td_nav_list > li > a {
    font-size: 18px;
    line-height: 22px;
  }
}

/* ========================================
   SIDE HEADER - MOBILE NAVIGATION
   ======================================== */

/* Side header specific mobile navigation */
.td_side_nav.td_mobile_only {
  padding: 20px 0;
  margin-bottom: 20px;
  border-bottom: 1px solid #e5e5e5;
}

.td_side_nav_list {
  list-style: none !important;
  margin: 0 !important;
  padding: 0 !important;
}

.td_side_nav_list > li {
  position: relative !important;
  margin-bottom: 5px !important;
  list-style: none !important;
}

.td_side_nav_list > li > a {
  display: block !important;
  padding: 12px 15px !important;
  color: var(--heading-color) !important;
  text-decoration: none !important;
  font-weight: 500 !important;
  font-size: 16px !important;
  border-radius: 6px !important;
  transition: all 0.3s ease !important;
}

.td_side_nav_list > li > a:hover {
  background: #f5f5f5 !important;
  color: var(--accent-color) !important;
}

.td_side_nav_list > li.menu-item-has-children > a {
  padding-right: 55px !important;
}

/* Dropdown Toggle Button - Chevron Icon */
.td_side_nav_list .td_munu_dropdown_toggle {
  position: absolute !important;
  right: 8px !important;
  top: 14px !important;
  width: 36px !important;
  height: 36px !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  cursor: pointer !important;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%) !important;
  border-radius: 50% !important;
  z-index: 10 !important;
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1) !important;
  left: auto !important;
  box-shadow: 0 2px 8px rgba(102, 126, 234, 0.3) !important;
}

.td_side_nav_list .td_munu_dropdown_toggle:hover {
  background: linear-gradient(135deg, #764ba2 0%, #667eea 100%) !important;
  box-shadow: 0 4px 12px rgba(102, 126, 234, 0.5) !important;
  transform: scale(1.08) !important;
}

/* Chevron icon styling */
.td_side_nav_list .td_munu_dropdown_toggle i {
  color: #ffffff !important;
  font-size: 14px !important;
  transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1) !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
}

/* When active - rotate chevron 180deg (pointing up) */
.td_side_nav_list > li.active > .td_munu_dropdown_toggle {
  background: linear-gradient(135deg, #764ba2 0%, #667eea 100%) !important;
}

.td_side_nav_list > li.active > .td_munu_dropdown_toggle i {
  transform: rotate(180deg) !important;
}

/* Sub-menu styling */
.td_side_nav_list > li > ul {
  list-style: none !important;
  padding: 0 !important;
  margin: 0 !important;
  display: none;
  padding-left: 15px !important;
}

.td_side_nav_list > li.active > ul {
  display: block;
  padding-top: 10px !important;
  animation: slideDown 0.3s ease !important;
}

@keyframes slideDown {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.td_side_nav_list > li > ul > li {
  margin-bottom: 3px !important;
  list-style: none !important;
}

.td_side_nav_list > li > ul > li > a {
  display: block !important;
  padding: 10px 15px !important;
  font-size: 15px !important;
  color: var(--body-color) !important;
  text-decoration: none !important;
  border-radius: 5px !important;
  border-left: 2px solid #ddd !important;
  transition: all 0.3s ease !important;
}

.td_side_nav_list > li > ul > li > a:hover {
  background: #f5f5f5 !important;
  color: var(--accent-color) !important;
  border-left-color: var(--accent-color) !important;
}

/* Hide mobile nav on desktop */
@media (min-width: 1200px) {
  .td_side_nav.td_mobile_only {
    display: none !important;
  }
}

/* ========================================
   MAIN HEADER - CONSISTENT ACROSS ALL PAGES
   ======================================== */

/* Ensure consistent header styling for all theme variants */
.td_site_header {
  position: absolute;
  z-index: 101;
  width: 100%;
  left: 0;
  top: 50px;
  transition: all 0.4s ease;
}

.td_site_header.td_style_1 .td_main_header_in {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  justify-content: space-between;
  position: relative;
  height: 75px;
}

/* Responsive header height */
@media screen and (max-width: 1199px) {
  .td_site_header.td_style_1 .td_main_header_in {
    height: 80px;
  }

  .td_site_header.td_style_1 {
    top: 0;
  }
}

/* ========================================
   OVERLAY & CLOSE BUTTON
   ======================================== */

.td_side_header_overlay {
  position: fixed !important;
  top: 0 !important;
  left: 0 !important;
  width: 100% !important;
  height: 100vh !important;
  background-color: rgba(0, 0, 0, 0.5) !important;
  cursor: zoom-out;
  z-index: 999 !important;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
}

html.td_hamburger_active .td_side_header_overlay,
.td_side_header.active .td_side_header_overlay {
  opacity: 1;
  visibility: visible;
}

.td_side_header .td_close {
  position: fixed !important;
  top: 20px !important;
  right: 20px !important;
  z-index: 1001 !important;
  width: 44px !important;
  height: 44px !important;
  background: var(--accent-color) !important;
  border-radius: 50% !important;
  border: none !important;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s ease;
  opacity: 0;
  visibility: hidden;
}

.td_side_header.active .td_close {
  opacity: 1;
  visibility: visible;
}

.td_side_header .td_close:hover {
  transform: rotate(90deg) scale(1.1);
  background: var(--heading-color) !important;
}

/* ========================================
   UTILITY CLASSES
   ======================================== */

/* Prevent body scroll when side header is open */
html.td_hamburger_active,
body.td_hamburger_active {
  overflow: hidden;
}

/* Smooth scrolling for side header content */
.td_side_header_in {
  scroll-behavior: smooth;
  -webkit-overflow-scrolling: touch;
}

/* Custom scrollbar for side header */
.td_side_header_in::-webkit-scrollbar {
  width: 6px;
}

.td_side_header_in::-webkit-scrollbar-track {
  background: #f1f1f1;
}

.td_side_header_in::-webkit-scrollbar-thumb {
  background: #888;
  border-radius: 3px;
}

.td_side_header_in::-webkit-scrollbar-thumb:hover {
  background: #555;
}

/* ========================================
   MOBILE RESPONSIVE: HIDE SIDE-HEADER CONTENT
   Only show navigation menu in mobile hamburger
   ======================================== */
@media (max-width: 991px) {
  /* Hide side-header content boxes (heading, contact, subscribe) on mobile */
  .td_side_header_box {
    display: none !important;
  }

  /* Hide side-header heading on mobile */
  .td_side_header_heading {
    display: none !important;
  }

  /* Keep only mobile navigation visible */
  .td_mobile_only {
    display: block !important;
  }

  /* Hide background pattern on mobile for cleaner look */
  .td_side_header_bg_pattern {
    display: none !important;
  }

  /* Hide geometric patterns on mobile */
  .td_geometric_pattern,
  .td_floating_circle {
    display: none !important;
  }

  /* Reduce padding on mobile for more space */
  .td_side_header_in {
    padding-top: 20px !important;
    padding-bottom: 20px !important;
  }
}
