/* ============================================
   MOBILE RESPONSIVE FIXES & BURGER MENU
   ============================================ */

/* ============================================
   BURGER MENU STYLES
   ============================================ */

/* Burger menu button */
.mobile-menu-btn {
  position: relative;
  width: 30px;
  height: 30px;
  background: transparent;
  border: none;
  cursor: pointer;
  z-index: 60;
  display: flex;
  flex-direction: column;
  justify-content: space-around;
  padding: 0;
}

.mobile-menu-btn span {
  display: block;
  height: 3px;
  width: 100%;
  background: white;
  border-radius: 2px;
  transition: all 0.3s ease;
  transform-origin: center;
}

.light-mode .mobile-menu-btn span,
body.light-mode .mobile-menu-btn span {
  background: #1f2937;
}

.light-mode .mobile-menu-btn,
body.light-mode .mobile-menu-btn {
  outline: 2px solid rgba(31, 41, 55, 0.2);
  border-radius: 4px;
}

/* Burger menu animation */
.mobile-menu-btn.active span:nth-child(1) {
  transform: rotate(45deg) translate(6px, 6px);
}

.mobile-menu-btn.active span:nth-child(2) {
  opacity: 0;
}

.mobile-menu-btn.active span:nth-child(3) {
  transform: rotate(-45deg) translate(6px, -6px);
}

/* ============================================
   MOBILE NAVIGATION MENU
   ============================================ */

.mobile-nav {
  position: fixed;
  top: 0;
  right: -85%;
  width: 85%;
  max-width: 320px;
  height: 100vh;
  background: rgba(17, 24, 39, 0.98);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  z-index: 55;
  transition: right 0.3s ease-in-out;
  overflow-y: auto;
  box-shadow: -4px 0 20px rgba(0, 0, 0, 0.15);
}

.mobile-nav.open {
  right: 0;
}

.mobile-nav-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  z-index: 54;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
}

.mobile-nav-overlay.show {
  opacity: 1;
  visibility: visible;
}

.mobile-nav-content {
  padding: 20px 16px 20px;
  display: flex;
  flex-direction: column;
  height: 100%;
}

.mobile-nav-header {
  display: none;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
  padding-bottom: 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.mobile-nav-logo {
  display: flex;
  align-items: center;
  gap: 8px;
}

.mobile-nav-logo svg {
  width: 24px;
  height: 24px;
  color: var(--color-primary);
}

.mobile-nav-logo span {
  font-size: 14px;
  font-weight: 700;
  color: var(--color-primary);
}

.mobile-nav-close {
  background: none;
  border: none;
  font-size: 20px;
  color: rgba(255, 255, 255, 0.7);
  cursor: pointer;
  padding: 4px;
  border-radius: 50%;
  transition: all 0.2s ease;
  min-width: 32px;
  min-height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.mobile-nav-close:hover {
  background: rgba(255, 255, 255, 0.1);
  color: white;
}

.mobile-nav-menu {
  list-style: none;
  padding: 0;
  margin: 0;
}

.mobile-nav-item {
  margin-bottom: 4px;
}

.mobile-nav-link {
  display: block;
  padding: 12px 14px;
  color: rgba(255, 255, 255, 0.8);
  text-decoration: none;
  border-radius: 8px;
  font-weight: 500;
  font-size: 15px;
  transition: all 0.2s ease;
  position: relative;
}

.mobile-nav-link:hover {
  background: rgba(59, 130, 246, 0.15);
  color: var(--color-primary);
  transform: translateX(-4px);
}

.mobile-nav-link.active {
  background: var(--color-primary);
  color: white;
  box-shadow: 0 4px 12px rgba(59, 130, 246, 0.4);
}

.mobile-nav-link.active::before {
  content: '';
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 3px;
  height: 18px;
  background: white;
  border-radius: 0 1.5px 1.5px 0;
}

/* ============================================
   RESPONSIVE IMPROVEMENTS
   ============================================ */

/* Header improvements for mobile */
@media (max-width: 768px) {
  .header {
    padding: 0 16px;
  }

  .header .flex {
    height: 60px;
  }

  .header .text-xl {
    font-size: 18px;
  }

  .header svg {
    width: 24px;
    height: 24px;
  }
}

/* Navigation improvements */
@media (max-width: 768px) {
  .desktop-nav {
    display: none !important;
  }

  .mobile-menu-btn {
    display: flex !important;
  }

  .mobile-nav {
    width: 80%;
    right: -80%;
    max-width: 300px;
  }
}

@media (min-width: 769px) {
  .mobile-menu-btn {
    display: none !important;
  }

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

/* ============================================
   CONTENT RESPONSIVE FIXES
   ============================================ */

@media (max-width: 768px) {

  /* Container adjustments */
  .container {
    padding-left: 16px;
    padding-right: 16px;
  }

  /* Typography adjustments */
  .text-4xl {
    font-size: 28px;
    line-height: 1.2;
  }

  .text-3xl {
    font-size: 24px;
    line-height: 1.3;
  }

  .text-2xl {
    font-size: 20px;
    line-height: 1.4;
  }

  .text-xl {
    font-size: 18px;
    line-height: 1.4;
  }

  /* Spacing adjustments */
  .py-20 {
    padding-top: 60px;
    padding-bottom: 60px;
  }

  .py-16 {
    padding-top: 40px;
    padding-bottom: 40px;
  }

  .py-12 {
    padding-top: 30px;
    padding-bottom: 30px;
  }

  /* Grid adjustments */
  .grid-cols-3 {
    grid-template-columns: 1fr;
    gap: 20px;
  }

  .grid-cols-2 {
    grid-template-columns: 1fr;
    gap: 16px;
  }

  /* Card adjustments */
  .card {
    padding: 20px;
    margin-bottom: 20px;
  }

  /* Button adjustments */
  .btn {
    padding: 12px 24px;
    font-size: 14px;
  }

  /* Form adjustments */
  .form-input {
    padding: 12px 16px;
    font-size: 16px;
  }
}

@media (max-width: 480px) {

  /* Extra small screens */
  .container {
    padding-left: 12px;
    padding-right: 12px;
  }

  .mobile-nav {
    width: 90%;
    right: -90%;
  }

  .mobile-nav-content {
    padding: 50px 12px 16px;
  }

  .mobile-nav-link {
    padding: 10px 12px;
    font-size: 14px;
  }

  .mobile-nav-logo span {
    font-size: 12px;
  }

  .text-4xl {
    font-size: 24px;
  }

  .text-3xl {
    font-size: 20px;
  }

  .py-20 {
    padding-top: 40px;
    padding-bottom: 40px;
  }

  .card {
    padding: 16px;
  }

  .btn {
    padding: 10px 20px;
    font-size: 13px;
  }
}

/* ============================================
   ACCESSIBILITY IMPROVEMENTS
   ============================================ */

/* Focus styles for mobile navigation */
.mobile-nav-link:focus {
  outline: 2px solid var(--color-primary);
  outline-offset: 2px;
}

.mobile-menu-btn:focus {
  outline: 2px solid var(--color-primary);
  outline-offset: 2px;
}

/* Reduce motion for users who prefer it */
@media (prefers-reduced-motion: reduce) {

  .mobile-nav,
  .mobile-nav-overlay,
  .mobile-menu-btn span,
  .mobile-nav-link {
    transition: none;
  }

  .mobile-nav-link:hover {
    transform: none;
  }
}

/* ============================================
   DARK MODE SUPPORT
   ============================================ */

@media (prefers-color-scheme: dark) {
  .mobile-nav {
    background: rgba(15, 23, 42, 0.99);
    color: white;
  }

  .mobile-nav-link {
    color: rgba(255, 255, 255, 0.8);
  }

  .mobile-nav-link:hover {
    background: rgba(59, 130, 246, 0.15);
    color: var(--color-primary);
  }

  .mobile-nav-link.active {
    background: var(--color-primary);
    color: white;
  }

  .mobile-nav-close {
    color: rgba(255, 255, 255, 0.7);
  }

  .mobile-nav-close:hover {
    background: rgba(255, 255, 255, 0.1);
    color: white;
  }

  .mobile-nav-header {
    border-bottom-color: rgba(255, 255, 255, 0.1);
  }
}

/* ============================================
   UTILITY CLASSES
   ============================================ */

.hidden-mobile {
  display: block;
}

.visible-mobile {
  display: none;
}

@media (max-width: 768px) {
  .hidden-mobile {
    display: none !important;
  }

  .visible-mobile {
    display: block !important;
  }
}

/* Smooth scrolling for mobile */
html {
  scroll-behavior: smooth;
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
}
