/* ═══════════════════════════════════════════════════════════════
   TOMCO TECHNOLOGIES - RESPONSIVE UTILITIES
   ═══════════════════════════════════════════════════════════════ */

/* ───────────────────────────────────────────────────────────────
   RESPONSIVE UTILITIES - Show/Hide by Breakpoint
   ─────────────────────────────────────────────────────────────── */

/* Hide on mobile */
@media (max-width: 768px) {
  .hide-mobile {
    display: none !important;
  }
}

/* Hide on tablet */
@media (min-width: 769px) and (max-width: 1024px) {
  .hide-tablet {
    display: none !important;
  }
}

/* Hide on desktop */
@media (min-width: 1025px) {
  .hide-desktop {
    display: none !important;
  }
}

/* Show only on mobile */
.show-mobile {
  display: none !important;
}

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

/* Show only on tablet */
.show-tablet {
  display: none !important;
}

@media (min-width: 769px) and (max-width: 1024px) {
  .show-tablet {
    display: block !important;
  }
}

/* ───────────────────────────────────────────────────────────────
   MOBILE OPTIMIZATIONS
   ─────────────────────────────────────────────────────────────── */

@media (max-width: 768px) {
  /* Touch-friendly click areas */
  button,
  .btn,
  a {
    min-height: 44px;
    min-width: 44px;
  }

  /* Better text rendering on mobile */
  body {
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
  }

  /* Prevent text size adjustment on orientation change */
  html {
    -webkit-text-size-adjust: 100%;
    -ms-text-size-adjust: 100%;
  }

  /* Make images mobile-friendly */
  img {
    max-width: 100%;
    height: auto;
  }

  /* Better spacing on mobile */
  .section {
    padding: var(--space-3xl) 0;
  }

  /* Mobile-friendly tables */
  table {
    display: block;
    overflow-x: auto;
    white-space: nowrap;
  }
}

/* ───────────────────────────────────────────────────────────────
   TABLET ADJUSTMENTS
   ─────────────────────────────────────────────────────────────── */

@media (min-width: 769px) and (max-width: 1024px) {
  .container {
    padding: 0 var(--space-xl);
  }

  /* 2-column grids on tablet */
  .grid-3,
  .grid-4 {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* ───────────────────────────────────────────────────────────────
   LANDSCAPE MOBILE
   ─────────────────────────────────────────────────────────────── */

@media (max-width: 768px) and (orientation: landscape) {
  .hero {
    min-height: auto;
    padding: var(--space-3xl) 0;
  }

  .navbar-glass {
    height: 60px;
  }

  :root {
    --navbar-height: 60px;
  }
}

/* ───────────────────────────────────────────────────────────────
   LARGE SCREENS
   ─────────────────────────────────────────────────────────────── */

@media (min-width: 1440px) {
  .container {
    max-width: var(--container-2xl);
  }

  /* Larger text on big screens */
  .hero h1 {
    font-size: var(--fs-7xl);
  }

  .section-title {
    font-size: var(--fs-6xl);
  }
}

/* ───────────────────────────────────────────────────────────────
   PRINT STYLES
   ─────────────────────────────────────────────────────────────── */

@media print {
  /* Hide navigation and decorative elements */
  header,
  footer,
  .nav-toggle,
  .back-to-top,
  #particles-js,
  .hero-decoration {
    display: none !important;
  }

  /* Optimize for printing */
  body {
    color: #000;
    background: #fff;
  }

  /* Show links in print */
  a[href]:after {
    content: " (" attr(href) ")";
  }

  /* Page breaks */
  section {
    page-break-inside: avoid;
  }
}

/* ───────────────────────────────────────────────────────────────
   ACCESSIBILITY - HIGH CONTRAST MODE
   ─────────────────────────────────────────────────────────────── */

@media (prefers-contrast: high) {
  :root {
    --text-primary: #FFFFFF;
    --text-secondary: #E0E0E0;
    --bg-dark: #000000;
    --bg-dark-alt: #0A0A0A;
    --glass-border: rgba(255, 255, 255, 0.3);
  }

  .btn-primary {
    border: 2px solid white;
  }

  .glass-card {
    border-width: 2px;
  }
}

/* ───────────────────────────────────────────────────────────────
   TOUCHSCREEN OPTIMIZATION
   ─────────────────────────────────────────────────────────────── */

@media (hover: none) and (pointer: coarse) {
  /* Remove hover effects on touch devices */
  .glass-card:hover {
    transform: none;
  }

  /* Larger touch targets */
  .nav-link {
    padding: var(--space-lg);
  }

  /* Disable hover-only mega menus, rely on clicks */
  .megamenu {
    transition: none;
  }
}

/* ───────────────────────────────────────────────────────────────
   SAFE AREA (for notched devices)
   ─────────────────────────────────────────────────────────────── */

@supports (padding: max(0px)) {
  .container {
    padding-left: max(var(--space-xl), env(safe-area-inset-left));
    padding-right: max(var(--space-xl), env(safe-area-inset-right));
  }

  .navbar-glass {
    padding-left: max(0px, env(safe-area-inset-left));
    padding-right: max(0px, env(safe-area-inset-right));
  }
}

/* ───────────────────────────────────────────────────────────────
   ENHANCED RESPONSIVE BREAKPOINTS
   ─────────────────────────────────────────────────────────────── */

/* Extra Small Devices (< 480px) */
@media (max-width: 480px) {
  :root {
    --fs-5xl: 2rem;
    --fs-4xl: 1.75rem;
    --fs-3xl: 1.5rem;
    --fs-2xl: 1.25rem;
    --space-3xl: 2rem;
    --space-2xl: 1.5rem;
  }

  .container {
    padding: 0 var(--space-md);
  }

  .glass-card,
  .glass-card-static,
  .glass-card-premium-content {
    padding: var(--space-md);
    border-radius: var(--radius-lg);
  }

  .btn {
    width: 100%;
    justify-content: center;
  }

  .btn-lg {
    padding: 14px 24px;
    font-size: var(--fs-base);
  }

  /* Stack all grids vertically on very small screens */
  .services-grid,
  .values-grid,
  .pricing-grid {
    grid-template-columns: 1fr;
    gap: var(--space-lg);
  }

  /* Reduce hover effects on small screens */
  .glass-card:hover,
  .hover-lift:hover {
    transform: translateY(-4px);
  }

  /* Better spacing for hero sections */
  .hero {
    padding: var(--space-3xl) 0;
    min-height: auto;
  }

  .hero h1 {
    font-size: var(--fs-3xl);
    line-height: 1.2;
  }
}

/* Small Mobile (481px - 640px) */
@media (min-width: 481px) and (max-width: 640px) {
  .services-grid,
  .values-grid {
    grid-template-columns: 1fr;
  }

  .glass-card {
    padding: var(--space-lg);
  }
}

/* Medium Tablet (641px - 768px) */
@media (min-width: 641px) and (max-width: 768px) {
  .services-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .values-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .container {
    padding: 0 var(--space-lg);
  }
}

/* Large Tablet (769px - 1024px) */
@media (min-width: 769px) and (max-width: 1024px) {
  .services-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: var(--space-xl);
  }

  .values-grid {
    grid-template-columns: repeat(3, 1fr);
  }

  .pricing-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* Desktop (1025px - 1279px) */
@media (min-width: 1025px) and (max-width: 1279px) {
  .services-grid {
    grid-template-columns: repeat(3, 1fr);
  }

  .values-grid {
    grid-template-columns: repeat(3, 1fr);
  }

  .container {
    max-width: var(--container-xl);
  }
}

/* Large Desktop (1280px - 1439px) */
@media (min-width: 1280px) and (max-width: 1439px) {
  .services-grid {
    grid-template-columns: repeat(4, 1fr);
  }

  .container {
    max-width: var(--container-xl);
  }
}

/* Ultra Wide (>= 1920px) */
@media (min-width: 1920px) {
  .container {
    max-width: 1600px;
  }

  :root {
    --fs-7xl: 5rem;
    --fs-6xl: 4rem;
  }

  .glass-card {
    padding: var(--space-3xl);
  }
}

/* ───────────────────────────────────────────────────────────────
   IMPROVED GRID RESPONSIVENESS
   ─────────────────────────────────────────────────────────────── */

@media (max-width: 640px) {
  /* Force single column on small screens */
  .grid,
  .grid-2,
  .grid-3,
  .grid-4 {
    grid-template-columns: 1fr !important;
  }

  /* Better gap spacing */
  .services-grid,
  .values-grid,
  .pricing-grid,
  .faq-grid {
    gap: var(--space-lg);
  }

  /* Adjust section padding */
  .section {
    padding: var(--space-2xl) 0;
  }

  .section-header {
    margin-bottom: var(--space-xl);
  }

  /* Optimize glassmorphism for mobile performance */
  .glass-card {
    backdrop-filter: blur(16px) saturate(150%);
    -webkit-backdrop-filter: blur(16px) saturate(150%);
  }

  /* Reduce animation intensity on mobile */
  .animate-float,
  .animate-float-slow {
    animation: none;
  }
}

/* ───────────────────────────────────────────────────────────────
   FLEXIBLE IMAGES & MEDIA
   ─────────────────────────────────────────────────────────────── */

@media (max-width: 768px) {
  img,
  video,
  iframe {
    max-width: 100%;
    height: auto;
  }

  /* Better video embeds */
  .video-wrapper {
    position: relative;
    padding-bottom: 56.25%; /* 16:9 aspect ratio */
    height: 0;
    overflow: hidden;
  }

  .video-wrapper iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
  }
}

/* ───────────────────────────────────────────────────────────────
   SMOOTH SCROLL BEHAVIOR
   ─────────────────────────────────────────────────────────────── */

@media (prefers-reduced-motion: no-preference) {
  html {
    scroll-behavior: smooth;
  }
}
