/**
 * Techmenas.lt - Responsive Design & Mobile Styles
 * Breakpoints: Mobile (<768px), Tablet (768px-1279px), Desktop (1280px+)
 */

/* ============================================
   BASE MOBILE-FIRST STYLES
   ============================================ */

/* Prevent horizontal scroll */
html,
body {
  overflow-x: hidden;
  width: 100%;
  max-width: 100vw;
}

/* ============================================
   SMOOTH SCROLLING
   ============================================ */

html {
  scroll-behavior: smooth;
}

/* Respect user's motion preferences */
@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/* ============================================
   MOBILE MENU STYLES
   ============================================ */

/* Hamburger Icon */
.hamburger {
  display: none; /* Hidden by default, shown on mobile */
  flex-direction: column;
  justify-content: space-around;
  width: 28px;
  height: 24px;
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 0;
  z-index: 1001;
  transition: transform 0.3s ease;
}

.hamburger:hover {
  transform: scale(1.1);
}

.hamburger span {
  width: 100%;
  height: 3px;
  background: var(--color-text-primary);
  border-radius: 2px;
  transition: all 0.3s ease;
  transform-origin: center;
}

/* Hamburger animation when active */
.hamburger.active span:nth-child(1) {
  transform: translateY(10.5px) rotate(45deg);
}

.hamburger.active span:nth-child(2) {
  opacity: 0;
  transform: translateX(-20px);
}

.hamburger.active span:nth-child(3) {
  transform: translateY(-10.5px) rotate(-45deg);
}

/* Mobile Menu Overlay */
.mobile-menu-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.7);
  z-index: 999;
  opacity: 0;
  transition: opacity 0.3s ease;
}

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

/* Mobile Menu */
.mobile-menu {
  position: fixed;
  top: 0;
  right: -100%;
  width: 80%;
  max-width: 400px;
  height: 100vh;
  background: linear-gradient(180deg, #16213E 0%, #1A1A2E 100%);
  border-left: 1px solid var(--border-accent);
  box-shadow: -4px 0 24px rgba(0, 0, 0, 0.5);
  z-index: 1000;
  padding: 80px 32px 32px;
  overflow-y: auto;
  transition: right 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.mobile-menu.active {
  right: 0;
}

.mobile-menu nav {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.mobile-menu a {
  display: flex;
  align-items: center;
  padding: 16px 20px;
  color: var(--color-text-primary);
  text-decoration: none;
  font-size: 18px;
  font-weight: 500;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-primary);
  transition: all 0.3s ease;
}

.mobile-menu a:hover,
.mobile-menu a:focus {
  background: rgba(0, 191, 255, 0.1);
  border-color: var(--border-accent);
  color: var(--color-accent-blue);
  transform: translateX(8px);
  box-shadow: var(--shadow-glow-blue);
}

.mobile-menu .btn-primary {
  margin-top: 16px;
  justify-content: center;
  background: var(--gradient-accent);
  border: none;
}

/* ============================================
   NAVBAR SCROLL STATE
   ============================================ */

.navbar.scrolled {
  box-shadow: var(--shadow-md), 0 0 40px rgba(0, 191, 255, 0.1);
  background: rgba(22, 33, 62, 0.98);
}

/* ============================================
   ENHANCED HOVER EFFECTS
   ============================================ */

/* Navigation Links */
.nav-links a {
  position: relative;
  transition: all 0.3s ease;
}

.nav-links a::after {
  content: '';
  position: absolute;
  bottom: -4px;
  left: 0;
  width: 0;
  height: 2px;
  background: linear-gradient(90deg, #00BFFF 0%, #8A2BE2 100%);
  transition: width 0.3s ease;
}

.nav-links a:hover::after,
.nav-links a:focus::after {
  width: 100%;
}

.nav-links a:hover,
.nav-links a:focus {
  color: var(--color-accent-blue);
  text-shadow: var(--shadow-glow-cyan);
}

/* Button Hover Effects */
.btn-primary {
  transition: all var(--transition-base);
}

.btn-primary:hover,
.btn-primary:focus {
  transform: scale(1.05);
  box-shadow: var(--shadow-glow-blue-intense);
}

.btn-primary:active {
  transform: scale(0.98);
}

/* Card Hover Effects */
.card {
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.card:hover {
  transform: translateY(-8px);
  box-shadow: var(--shadow-lg), var(--shadow-glow-blue);
  border-color: var(--border-accent);
}

/* Form Input Focus */
input:focus,
textarea:focus,
select:focus {
  outline: none;
  border-color: var(--color-accent-blue) !important;
  box-shadow: 0 0 0 3px var(--border-accent) !important;
}

/* Accordion Hover */
.accordion-toggle {
  cursor: pointer;
  transition: all var(--transition-base);
}

.accordion-toggle:hover {
  background: var(--border-secondary);
}

.accordion-content {
  max-height: 0;
  overflow: hidden;
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  padding-top: 0;
}

/* Active accordion */
.card.active {
  border-left: 3px solid #00BFFF;
}

/* ============================================
   SKIP TO CONTENT (Accessibility)
   ============================================ */

.skip-to-content {
  position: absolute;
  top: -40px;
  left: 0;
  background: var(--color-accent-blue);
  color: white;
  padding: 8px 16px;
  text-decoration: none;
  z-index: 100;
  border-radius: 0 0 4px 0;
  font-weight: 600;
  transition: top 0.3s ease;
}

.skip-to-content:focus {
  top: 0;
  outline: 2px solid white;
  outline-offset: 2px;
}

/* ============================================
   RESPONSIVE BREAKPOINTS
   ============================================ */

/* Tablet and below (< 1280px) */
@media (max-width: 1279px) {
  /* Reduce hero heading size */
  .hero h1 {
    font-size: 3rem; /* 48px */
  }
  
  /* Adjust section headings */
  h2 {
    font-size: 2.25rem; /* 36px */
  }
  
  /* Reduce padding */
  section {
    padding-top: 4rem;
    padding-bottom: 4rem;
  }
}

/* Mobile and below (< 768px) */
@media (max-width: 767px) {
  /* Show hamburger menu */
  .hamburger {
    display: flex;
  }
  
  /* Hide desktop navigation */
  .nav-links {
    display: none;
  }
  
  .navbar .btn-primary {
    display: none;
  }
  
  /* Show mobile menu overlay when active */
  .mobile-menu.active ~ .mobile-menu-overlay {
    display: block;
  }
  
  /* Adjust hero section */
  .hero h1 {
    font-size: 2.25rem; /* 36px */
  }
  
  .hero p {
    font-size: 1rem; /* 16px */
  }
  
  /* Section headings */
  h2 {
    font-size: 1.875rem; /* 30px */
  }
  
  h3 {
    font-size: 1.5rem; /* 24px */
  }
  
  /* Reduce section padding */
  section {
    padding-top: 3rem;
    padding-bottom: 3rem;
    padding-left: 1rem;
    padding-right: 1rem;
  }
  
  /* Grid layouts to single column */
  .grid {
    grid-template-columns: 1fr !important;
    gap: 1.5rem !important;
  }
  
  /* Reduce card padding */
  .card {
    padding: 1.5rem !important;
  }
  
  /* Stack footer columns */
  footer .grid {
    grid-template-columns: 1fr !important;
  }
  
  /* Adjust navbar padding */
  .navbar {
    padding: 1rem;
  }
}

/* ============================================
   MOBILE BREAKPOINT: 414px (iPhone Plus, etc.)
   ============================================ */

@media (max-width: 414px) {
  /* Further reduce font sizes */
  h1 {
    font-size: 1.5rem !important;
  }

  h2 {
    font-size: 1.25rem !important;
  }

  /* Reduce spacing */
  section {
    padding: 2rem 0.75rem !important;
  }

  /* Smaller buttons but maintain touch targets */
  .btn,
  button {
    font-size: 14px !important;
    padding: 12px 16px !important;
  }
}

/* ============================================
   MOBILE BREAKPOINT: 375px (iPhone SE, etc.)
   ============================================ */

@media (max-width: 375px) {
  /* Minimum readable font sizes */
  body {
    font-size: 14px !important;
  }

  h1 {
    font-size: 1.375rem !important;
  }

  /* Tighter spacing */
  .space-y-8 > * + * {
    margin-top: 1rem !important;
  }

  .space-y-6 > * + * {
    margin-top: 0.75rem !important;
  }
}

/* ============================================
   MOBILE BREAKPOINT: 320px (Smallest devices)
   ============================================ */

@media (max-width: 320px) {
  /* Absolute minimum sizes */
  html {
    font-size: 14px !important;
  }

  h1 {
    font-size: 1.25rem !important;
  }

  h2 {
    font-size: 1.125rem !important;
  }

  /* Minimal padding */
  section {
    padding: 1.5rem 0.5rem !important;
  }

  .card {
    padding: 1rem !important;
  }
}

/* ============================================
   LANDSCAPE ORIENTATION FIXES
   ============================================ */

@media (max-height: 500px) and (orientation: landscape) {
  /* Reduce vertical spacing in landscape */
  section {
    padding-top: 2rem !important;
    padding-bottom: 2rem !important;
  }

  /* Reduce hero height */
  #home {
    min-height: auto !important;
  }

  /* Hide decorative elements */
  .animate-pulse {
    display: none !important;
  }
}

