/**
 * Güven Sigorta - Navbar Stilleri
 * Profesyonel sigorta sitesi navbar tasarımı
 * @package Korenel Theme
 */

/* ==========================================================================
   NAVBAR BASE
   ========================================================================== */
.site-header {
  position: relative;
  background: #fff;
  z-index: 1000;
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  transform: translateY(0);
}

/* Not scrolled - smooth return animation */
.site-header:not(.scrolled) {
  animation: slideUp 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.navbar {
  padding: 10px 0;
  background: #fff;
  box-shadow: 0 2px 20px rgba(0, 0, 0, 0.1);
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Scrolled state */
.site-header.scrolled {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  width: 100%;
  transform: translateY(0);
  animation: slideDown 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
}

@keyframes slideDown {
  from {
    transform: translateY(-100%);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

@keyframes slideUp {
  from {
    transform: translateY(0);
    opacity: 1;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

.site-header.scrolled .navbar {
  background: #fff;
  box-shadow: 0 2px 20px rgba(0, 0, 0, 0.1);
  padding: 10px 0;
}

/* ==========================================================================
   LOGO
   ========================================================================== */
.site-branding {
  flex-shrink: 0;
}

.site-branding .custom-logo {
  max-height: 50px;
  width: auto;
  transition: all 0.3s ease;
}

.site-header.scrolled .custom-logo {
  max-height: 45px;
}

.site-branding .site-title {
  font-size: 1.5rem;
  font-weight: 700;
  color: #0066b3;
  text-decoration: none;
  transition: all 0.3s ease;
}

.site-header.scrolled .site-title {
  color: #0066b3;
}

/* ==========================================================================
   NAV LINKS
   ========================================================================== */
.navbar-nav {
  margin-left: auto;
  gap: 5px;
}

.navbar-nav .nav-link {
  color: #2c3e50;
  font-weight: 500;
  padding: 10px 18px !important;
  border-radius: 8px;
  transition: all 0.3s ease;
  position: relative;
  text-decoration: none;
}

.navbar-nav .nav-link:hover,
.navbar-nav .nav-link.active {
  color: #0066b3;
  background: rgba(0, 102, 179, 0.1);
}

/* Scrolled state */
.site-header.scrolled .navbar-nav .nav-link {
  color: #2c3e50;
}

/* Scrolled state active/hover */
.site-header.scrolled .navbar-nav .nav-link:hover,
.site-header.scrolled .navbar-nav .nav-link.active {
  color: #0066b3;
  background: transparent;
}

/* Main Nav Hover Effect - Underline */
.navbar-nav .nav-link::before {
  content: "";
  position: absolute;
  bottom: 5px;
  left: 50%;
  transform: translateX(-50%);
  width: 0;
  height: 2px;
  background: #0066b3;
  transition: width 0.3s ease;
}

.navbar-nav .nav-link:hover::before,
.navbar-nav .nav-link.active::before {
  width: 80%;
}

.navbar-nav .nav-link:hover,
.navbar-nav .nav-link.active {
  background: transparent;
  color: #0066b3;
}

/* Unified Dropdown Parent Hover */
/* Unified Dropdown Parent Hover */
@media (min-width: 992px) {
  .navbar-nav .dropdown:hover > .nav-link {
    background: transparent;
    color: #0066b3;
    box-shadow: none;
    position: relative;
    z-index: 1001;
  }
}

/* Dropdown */
/* Dropdown */
.navbar-nav .dropdown-menu {
  border: none;
  border-radius: 0 0 12px 12px;
  box-shadow: none;
  padding: 30px 15px 15px; /* Increased top padding for "deeper" look */
  margin-top: 0;
  min-width: 240px;
  transition: all 0.3s ease;
  background: #fff;
  display: block;
  opacity: 0;
  visibility: hidden;
  transform: translateY(10px);
  border-top: none;
}

.navbar-nav .dropdown-item {
  padding: 12px 15px;
  border-radius: 4px;
  font-weight: 500;
  color: #2c3e50;
  transition: all 0.2s ease;
  font-size: 0.95rem;
  border-left: 3px solid transparent;
  margin-bottom: 2px;
}

.navbar-nav .dropdown-item:hover,
.navbar-nav .dropdown-item.active {
  background: #f8f9fa;
  color: #0066b3;
  transform: translateX(5px);
  border-left-color: #0066b3;
}

.dropdown-toggle::after {
  content: "\f107";
  font-family: "Font Awesome 5 Free";
  font-weight: 900;
  border: none;
  font-size: 12px;
  margin-left: 6px;
  transition: transform 0.3s ease;
}

/* Desktop Hover Interaction */
@media (min-width: 992px) {
  .navbar-nav .dropdown:hover .dropdown-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
  }

  .navbar-nav .dropdown:hover .nav-link {
    color: #0066b3;
  }

  .navbar-nav .dropdown:hover .dropdown-toggle::after {
    transform: rotate(180deg);
  }

  /* Make parent link not clickable visually */
  .navbar-nav .dropdown-toggle {
    cursor: default;
  }
}

/* Mobile Dropdown adjustment */
@media (max-width: 991px) {
  .navbar-nav .dropdown-menu {
    display: none;
    opacity: 1;
    visibility: visible;
    transform: none;
    box-shadow: none;
    padding: 0 0 0 15px;
    margin-top: 5px;
  }

  .navbar-nav .dropdown-menu.show {
    display: block;
  }

  .navbar-nav .dropdown-item {
    padding: 8px 0;
  }

  .navbar-nav .dropdown-item:hover {
    background: transparent;
    transform: none;
  }
}

/* ==========================================================================
   SOCIAL LINKS (HEADER)
   ========================================================================== */
.header-social {
  display: flex;
  align-items: center;
  gap: 8px;
}

.header-social a {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: rgba(0, 102, 179, 0.1);
  color: #0066b3;
  font-size: 14px;
  transition: all 0.3s ease;
}

.header-social a:hover {
  background: #0066b3;
  color: #fff;
  transform: translateY(-3px);
}

.site-header.scrolled .header-social a {
  background: rgba(0, 102, 179, 0.1);
  color: #0066b3;
}

.site-header.scrolled .header-social a:hover {
  background: #0066b3;
  color: #fff;
}

/* ==========================================================================
   MOBILE TOGGLE (HAMBURGER)
   ========================================================================== */
.mobile-menu-toggle {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  width: 44px;
  height: 44px;
  padding: 12px 10px;
  background: rgba(0, 102, 179, 0.05);
  border: none;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.3s ease;
  z-index: 1050;
  touch-action: manipulation;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}

.mobile-menu-toggle:hover {
  background: rgba(0, 102, 179, 0.1);
}

.hamburger-line {
  display: block;
  width: 100%;
  height: 2px;
  background-color: #0066b3;
  border-radius: 2px;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  transform-origin: center;
}

/* Scrolled state */
.site-header.scrolled .mobile-menu-toggle {
  background: rgba(0, 102, 179, 0.05);
}

/* Hamburger to X Animation when panel is active */
.mobile-menu-toggle.is-active .hamburger-line:nth-child(1) {
  transform: translateY(9px) rotate(45deg);
}
.mobile-menu-toggle.is-active .hamburger-line:nth-child(2) {
  opacity: 0;
}
.mobile-menu-toggle.is-active .hamburger-line:nth-child(3) {
  transform: translateY(-9px) rotate(-45deg);
}

/* ==========================================================================
   MOBILE MENU PANEL (OFFCANVAS)
   ========================================================================== */
/* Hide default bootstrap toggler if exists */
.navbar-toggler { display: none !important; }

/* Overlay */
.mobile-menu-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(15, 23, 42, 0.6);
  backdrop-filter: blur(4px);
  z-index: 1040;
  opacity: 0;
  visibility: hidden;
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.mobile-menu-overlay.is-active {
  opacity: 1;
  visibility: visible;
}

/* Panel */
.mobile-menu-panel {
  position: fixed;
  top: 0;
  right: 0;
  transform: translateX(100%);
  width: 85vw;
  max-width: 380px;
  height: 100vh;
  height: 100dvh;
  background: #ffffff;
  z-index: 1050;
  display: flex;
  flex-direction: column;
  transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: -10px 0 30px rgba(0, 0, 0, 0.1);
  overflow-y: auto;
}

.mobile-menu-panel.is-active {
  transform: translateX(0);
}

/* Header */
.mobile-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 24px;
  border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}

.mobile-panel-logo {
  max-height: 40px;
  width: auto;
}

.mobile-panel-site-name {
  font-size: 1.25rem;
  font-weight: 700;
  color: #0066b3;
  text-decoration: none;
}

.mobile-panel-close {
  background: #f1f5f9;
  border: none;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #64748b;
  cursor: pointer;
  transition: all 0.2s;
}

.mobile-panel-close:hover {
  background: #e2e8f0;
  color: #0f172a;
  transform: rotate(90deg);
}

/* Body / Navigation */
.mobile-panel-body {
  flex: 1;
  padding: 24px;
  overflow-y: auto;
}

.mobile-nav {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.mobile-nav-item {
  border-bottom: 1px solid rgba(0, 0, 0, 0.03);
}

.mobile-nav-item:last-child {
  border-bottom: none;
}

.mobile-nav-link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 12px 0;
  font-size: 1.1rem;
  font-weight: 600;
  color: #1e293b;
  text-decoration: none;
  background: none;
  border: none;
  text-align: left;
  transition: color 0.2s;
}

.mobile-nav-link:hover,
.mobile-nav-link.active {
  color: #0066b3;
}

.mobile-subnav-toggle {
  cursor: pointer;
}

.subnav-arrow {
  color: #94a3b8;
  transition: transform 0.3s ease;
}

.mobile-subnav-toggle[aria-expanded="true"] .subnav-arrow {
  transform: rotate(180deg);
  color: #0066b3;
}

/* Sub-navigation */
.mobile-subnav {
  list-style: none;
  padding: 0 0 0 16px;
  margin: 0;
  display: block;
  max-height: 0;
  overflow: hidden;
  border-left: 2px solid #f1f5f9;
  margin-left: 8px;
  transition: max-height 0.4s ease, padding 0.4s ease;
}

.mobile-subnav.is-open {
  max-height: 800px; /* Safe large value for smooth CSS accordion */
  padding-bottom: 12px;
}

.mobile-subnav li {
  margin-top: 8px;
}

.mobile-subnav-link {
  display: block;
  padding: 8px 12px;
  font-size: 0.95rem;
  font-weight: 500;
  color: #64748b;
  text-decoration: none;
  border-radius: 6px;
  transition: all 0.2s;
}

.mobile-subnav-link:hover,
.mobile-subnav-link.active {
  color: #0066b3;
  background: rgba(0, 102, 179, 0.05);
}

/* Footer */
.mobile-panel-footer {
  padding: 24px;
  background: #f8fafc;
  border-top: 1px solid rgba(0, 0, 0, 0.05);
}

.mobile-panel-secondary-logo {
  margin-bottom: 24px;
}

.mobile-panel-secondary-logo img {
  height: 36px;
  width: auto;
}

.mobile-social-label {
  font-size: 0.875rem;
  font-weight: 600;
  color: #64748b;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 12px;
}

.mobile-social-icons {
  display: flex;
  gap: 12px;
}

.mobile-social-icons a {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: #ffffff;
  color: #0066b3;
  font-size: 1.1rem;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
  transition: all 0.3s ease;
}

.mobile-social-icons a:hover {
  background: #0066b3;
  color: #ffffff;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 102, 179, 0.2);
}

/* ==========================================================================
   CTA BUTTON (Optional - for navbar)
   ========================================================================== */
.navbar-cta {
  margin-left: 15px;
}

.navbar-cta .btn {
  padding: 10px 25px;
  font-weight: 600;
  border-radius: 50px;
  background: #0066b3;
  color: #fff;
  border: none;
  transition: all 0.3s ease;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.navbar-cta .btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.15);
}

.site-header.scrolled .navbar-cta .btn {
  background: #0066b3;
  color: #fff;
}

/* ==========================================================================
   RESPONSIVE
   ========================================================================== */
@media (max-width: 991px) {
  .header-social {
    display: none;
  }
  
  /* Hide the desktop collapse menu completely on mobile */
  .navbar-collapse {
    display: none !important;
  }
}

@media (max-width: 576px) {
  .site-branding .custom-logo {
    max-height: 40px;
  }

  .navbar {
    padding: 12px 0;
  }
}

