/* =========================================================
   HEADER_ADMIN.CSS - Responsive Mobile Optimized (95% Scale)
========================================================= */

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  padding: 0;
  padding-top: 80px;
}

.admin-header-wrapper {
  background: linear-gradient(145deg, #f3f7fb, #ffffff);
  padding: 14px 30px;
  border-radius: 16px;
  backdrop-filter: blur(8px);
  box-shadow: 0px 6px 10px rgba(0, 40, 120, 0.08);
  font-family: "Inter", sans-serif;
  position: fixed;
  top: 10px;
  left: 50%;
  transform: translateX(-50%) scale(0.95);
  display: flex;
  align-items: center;
  justify-content: space-between;
  z-index: 1000;
  width: calc(100% - 40px);
  max-width: 1400px;
  transition: all 0.3s ease;
}

.admin-header-wrapper.scrolled {
  box-shadow: 0px 8px 16px rgba(0, 40, 120, 0.15);
  top: 5px;
}

.header-left {
  display: flex;
  align-items: center;
  z-index: 101;
}

.header-left .logo {
  height: 20px;
  width: auto;
  padding-top: 4px;
  cursor: pointer;
  transition: transform 0.3s ease;
}

.header-left .logo:hover {
  transform: scale(1.05);
}

/* =========================================================
   NAVIGATION - Base Styles
========================================================= */
.admin-nav {
  background: linear-gradient(135deg, #005dbb, #004a94);
  border-radius: 40px;
  display: flex;
  justify-content: center;
  align-items: center;
  box-shadow: 0 6px 20px rgba(0, 77, 157, 0.25);
  border: 1.5px solid rgba(255, 255, 255, 0.25);
  backdrop-filter: blur(6px);
}

.admin-nav ul {
  display: flex;
  list-style: none;
  margin: 0;
  padding: 0;
  align-items: center;
  height: 100%;
}

/* Desktop Navigation */
.desktop-nav {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  z-index: 50;
  padding: 12px 70px;
  min-height: 54px;
}

.desktop-nav ul {
  gap: 65px;
}

/* Mobile Navigation - Hidden by default */
.mobile-nav {
  display: none;
  position: fixed;
  left: 50%;
  bottom: 10px;
  transform: translateX(-50%);
  z-index: 999;
}

/* =========================================================
   NAVIGATION ITEMS
========================================================= */
.nav-item-container {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.08);
  display: flex;
  justify-content: center;
  align-items: center;
  transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
  position: relative;
  cursor: pointer;
}

.nav-item-container:hover {
  transform: translateY(-2px);
  background: rgba(255, 255, 255, 0.18);
}

.nav-item-container a {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
}

/* Icon Wrapper */
.icon-wrapper {
  position: relative;
  width: 22px;
  height: 22px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.icon-wrapper svg {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  transition: opacity 0.3s ease,
    transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.icon-default {
  width: 22px;
  height: 22px;
  opacity: 1;
  stroke: #ffffff;
  color: #ffffff;
}

.icon-active {
  width: 22px;
  height: 22px;
  opacity: 0;
  stroke: #005dbb;
  fill: #005dbb;
  color: #005dbb;
}

/* =========================================================
   ACTIVE STATES
========================================================= */
/* Desktop: Active goes DOWN */
.desktop-nav .nav-item-container.active {
  width: 42px;
  height: 42px;
  background: #ffffff;
  box-shadow: 0 8px 20px rgba(0, 50, 150, 0.4);
  transform: translateY(20px);
}

.desktop-nav .nav-item-container.active .icon-wrapper {
  width: 32px;
  height: 32px;
}

.desktop-nav .nav-item-container.active .icon-default {
  opacity: 0;
  transform: translate(-50%, -50%) scale(0.8);
}

.desktop-nav .nav-item-container.active .icon-active {
  opacity: 1;
  width: 28px;
  height: 28px;
  transform: translate(-50%, -50%) scale(1);
}

/* Mobile: Active goes UP */
.mobile-nav .nav-item-container.active {
  width: 50px;
  height: 50px;
  background: #ffffff;
  box-shadow: 0 8px 20px rgba(0, 50, 150, 0.4);
  transform: translateY(-18px);
}

.mobile-nav .nav-item-container.active .icon-wrapper {
  width: 30px;
  height: 30px;
}

.mobile-nav .nav-item-container.active .icon-default {
  opacity: 0;
  transform: translate(-50%, -50%) scale(0.8);
}

.mobile-nav .nav-item-container.active .icon-active {
  opacity: 1;
  width: 28px;
  height: 28px;
  transform: translate(-50%, -50%) scale(1);
}

/* =========================================================
   HEADER RIGHT - LOGOUT BUTTON
========================================================= */
.header-right {
  display: flex;
  align-items: center;
  gap: 16px;
  position: relative;
  z-index: 200;
}

.logout-button {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  background: linear-gradient(135deg, #dc2626, #b91c1c);
  color: #ffffff;
  text-decoration: none;
  border-radius: 20px;
  font-size: 13px;
  font-weight: 600;
  transition: all 0.3s ease;
  box-shadow: 0 2px 8px rgba(220, 38, 38, 0.3);
  cursor: pointer;
}

.logout-button:hover {
  background: linear-gradient(135deg, #b91c1c, #991b1b);
  box-shadow: 0 4px 12px rgba(220, 38, 38, 0.4);
  transform: translateY(-2px);
}

.logout-button:active {
  transform: translateY(0);
}

.logout-button svg {
  stroke: currentColor;
}

/* =========================================================
   DARK MODE TOGGLE
========================================================= */
.dark-mode-toggle {
  display: flex;
  align-items: center;
  gap: 8px;
}

.dark-label {
  font-size: 12px;
  color: #1f73c9;
  font-weight: 500;
  white-space: nowrap;
}

.switch {
  position: relative;
  display: inline-block;
  width: 34px;
  height: 19px;
  flex-shrink: 0;
}

.switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: #004d9d;
  transition: 0.4s ease;
  border-radius: 30px;
}

.slider:before {
  position: absolute;
  content: "";
  height: 13px;
  width: 13px;
  left: 3px;
  bottom: 3px;
  background-color: white;
  transition: 0.4s ease;
  border-radius: 50%;
}

input:checked + .slider {
  background-color: #2196f3;
}

input:checked + .slider:before {
  transform: translateX(15px);
}

.dropdown-menu {
  display: none;
}

/* =========================================================
   DARK MODE STYLES
========================================================= */
body.dark {
  background-color: #1a1a1a;
  color: #e8e8e8;
}

body.dark .admin-header-wrapper {
  background: linear-gradient(145deg, #2a2a2a, #1e1e1e);
  box-shadow: 0px 6px 10px rgba(0, 0, 0, 0.3);
}

body.dark .admin-nav {
  background: linear-gradient(135deg, #1a4d7a, #0f3a5f);
  border-color: rgba(102, 179, 255, 0.2);
}

body.dark .icon-default {
  stroke: #ffffff;
  color: #ffffff;
}

body.dark .icon-active {
  stroke: #1a4d7a;
  fill: #1a4d7a;
  color: #1a4d7a;
}

body.dark .logout-button {
  background: linear-gradient(135deg, #ef4444, #dc2626);
}

body.dark .logout-button:hover {
  background: linear-gradient(135deg, #dc2626, #b91c1c);
}

body.dark .dark-label {
  color: #66b3ff;
}

/* =========================================================
   RESPONSIVE DESIGN
========================================================= */

/* Large Tablets (1024px and below) */
@media screen and (max-width: 1024px) {
  .admin-header-wrapper {
    padding: 12px 24px;
  }

  .desktop-nav {
    padding: 10px 55px;
    min-height: 50px;
  }

  .desktop-nav ul {
    gap: 55px;
  }

  .header-left .logo {
    height: 19px;
  }

  .desktop-nav .nav-item-container.active {
    width: 40px;
    height: 40px;
    transform: translateY(18px);
  }

  .desktop-nav .nav-item-container.active .icon-wrapper {
    width: 30px;
    height: 30px;
  }

  .desktop-nav .nav-item-container.active .icon-active {
    width: 26px;
    height: 26px;
  }
}

/* Tablets (768px and below) - MOBILE MODE */
@media screen and (max-width: 768px) {
  body {
    padding-top: 70px;
    padding-bottom: 80px;
  }

  .admin-header-wrapper {
    padding: 12px 18px;
    flex-direction: row;
    justify-content: space-between;
    width: calc(100% - 20px);
  }

  .header-left {
    width: auto;
    justify-content: flex-start;
  }

  .header-left .logo {
    height: 18px;
  }

  /* Hide desktop nav */
  .desktop-nav {
    display: none !important;
  }

  /* Show mobile nav at bottom */
  .mobile-nav {
    display: flex !important;
    width: calc(100% - 40px);
    max-width: 500px;
    padding: 12px 30px;
    min-height: 60px;
    border-radius: 50px;
  }

  .mobile-nav ul {
    gap: 35px;
    justify-content: center;
  }

  .mobile-nav .nav-item-container {
    width: 32px;
    height: 32px;
  }

  .mobile-nav .icon-wrapper {
    width: 22px;
    height: 22px;
  }

  .mobile-nav .icon-default,
  .mobile-nav .icon-active {
    width: 22px;
    height: 22px;
  }

  .mobile-nav .nav-item-container.active {
    width: 50px;
    height: 50px;
    transform: translateY(-18px);
  }

  .mobile-nav .nav-item-container.active .icon-wrapper {
    width: 30px;
    height: 30px;
  }

  .mobile-nav .nav-item-container.active .icon-active {
    width: 28px;
    height: 28px;
  }

  .header-right {
    width: auto;
    gap: 14px;
  }

  .logout-button {
    padding: 7px 14px;
    font-size: 12px;
  }

  .logout-button svg {
    width: 18px;
    height: 18px;
  }
}

/* Mobile Phones (480px and below) */
@media screen and (max-width: 480px) {
  body {
    padding-top: 70px;
    padding-bottom: 80px;
  }

  .admin-header-wrapper {
    padding: 10px 14px;
    border-radius: 12px;
    width: calc(100% - 16px);
  }

  .header-left .logo {
    height: 17px;
  }

  .desktop-nav {
    display: none !important;
  }

  .mobile-nav {
    display: flex !important;
    width: calc(100% - 30px);
    max-width: 450px;
    padding: 10px 18px;
    border-radius: 40px;
    min-height: 56px;
  }

  .mobile-nav ul {
    gap: 22px;
  }

  .mobile-nav .nav-item-container {
    width: 30px;
    height: 30px;
  }

  .mobile-nav .icon-wrapper {
    width: 20px;
    height: 20px;
  }

  .mobile-nav .icon-default,
  .mobile-nav .icon-active {
    width: 20px;
    height: 20px;
  }

  .mobile-nav .nav-item-container.active {
    width: 46px;
    height: 46px;
    transform: translateY(-16px);
  }

  .mobile-nav .nav-item-container.active .icon-wrapper {
    width: 28px;
    height: 28px;
  }

  .mobile-nav .nav-item-container.active .icon-active {
    width: 26px;
    height: 26px;
  }

  .dark-label {
    font-size: 11px;
  }

  .switch {
    width: 30px;
    height: 17px;
  }

  .slider:before {
    height: 11px;
    width: 11px;
  }

  input:checked + .slider:before {
    transform: translateX(13px);
  }

  .logout-button {
    padding: 6px 12px;
    font-size: 11px;
  }

  .logout-button svg {
    width: 16px;
    height: 16px;
  }
}

/* Extra Small Devices (360px and below) */
@media screen and (max-width: 360px) {
  .admin-header-wrapper {
    padding: 8px 12px;
  }

  .mobile-nav {
    width: calc(100% - 20px);
    min-height: 52px;
    padding: 8px 14px;
  }

  .mobile-nav ul {
    gap: 18px;
  }

  .mobile-nav .nav-item-container {
    width: 28px;
    height: 28px;
  }

  .mobile-nav .nav-item-container.active {
    width: 42px;
    height: 42px;
    transform: translateY(-14px);
  }

  .mobile-nav .nav-item-container.active .icon-wrapper {
    width: 26px;
    height: 26px;
  }

  .mobile-nav .nav-item-container.active .icon-active {
    width: 24px;
    height: 24px;
  }

  .header-right {
    gap: 10px;
  }

  .dark-label {
    font-size: 10px;
  }
}

/* =========================================================
   SMOOTH TRANSITIONS
========================================================= */
.admin-header-wrapper,
.admin-header-wrapper *,
.dropdown-menu,
.dropdown-menu * {
  transition: background-color 0.4s cubic-bezier(0.4, 0, 0.2, 1),
    color 0.4s cubic-bezier(0.4, 0, 0.2, 1),
    border-color 0.4s cubic-bezier(0.4, 0, 0.2, 1),
    box-shadow 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.nav-item-container,
.switch,
.slider,
.logout-button {
  transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1) !important;
}

/* =========================================================
   UTILITY CLASSES
========================================================= */
.page-container {
  position: relative;
  overflow: visible;
}

.header-spacing {
  margin-bottom: 18px;
}
