/* ==============================================
   ARASAN ARENA - Responsive CSS
   Mobile-first breakpoints, adaptive layouts
   ============================================== */

/* ==================== GLOBAL RESPONSIVE FIXES ==================== */
html, body {
  overflow-x: hidden !important;
  width: 100% !important;
  position: relative;
  scroll-padding-top: var(--nav-h);
}

/* Fix for horizontal scroll caused by animations or absolute elements */
.section, .container, .hero, .page-hero, footer, main, .admin-main-v2 {
  max-width: 100vw !important;
  overflow-x: hidden !important;
}

/* Ensure images don't stretch containers */
img {
  height: auto;
  max-width: 100%;
}

/* ==================== NAVBAR RESPONSIVE ==================== */
@media (max-width: 1024px) {
  .navbar-menu   { display: none !important; }
  .hamburger     { display: flex !important; }
  .navbar-actions .btn { display: none !important; }
}

@media (max-width: 480px) {
  :root { --nav-h: 64px; }
  .navbar-brand img  { height: 32px !important; }
  .navbar-brand-name { font-size: 12px !important; }
  .navbar-tagline    { font-size: 7px !important; letter-spacing: 0.16em; }
}

/* ==================== HERO RESPONSIVE ==================== */
@media (max-width: 768px) {
  .hero { min-height: 90vh; }
  .hero-content-center { text-align: left; }
  .hero-buttons { justify-content: flex-start; }
  .page-hero { 
    height: auto !important;
    min-height: 500px;
    padding: 120px 0 60px !important;
  }
  .page-hero-content {
    padding: 0 var(--gutter);
    align-items: flex-start;
  }
  .hero-title { font-size: clamp(28px, 8vw, 42px) !important; }
  .hero-desc { font-size: 16px !important; margin-bottom: 24px !important; }
  .hero-buttons { 
    justify-content: flex-start !important; 
    flex-wrap: wrap;
    gap: 12px !important;
  }
}

@media (max-width: 480px) {
  .hero-buttons { flex-direction: column; width: 100%; }
  .hero-buttons .btn { width: 100%; justify-content: center; }
}

/* ==================== CARD GRIDS RESPONSIVE ==================== */
.grid-2, .grid-3, .grid-4 { width: 100%; }

@media (max-width: 1200px) {
  .grid-4 { grid-template-columns: repeat(3, 1fr); }
}

@media (max-width: 1024px) {
  .grid-3 { grid-template-columns: repeat(2, 1fr); }
  .grid-4 { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 768px) {
  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
  
  .hero-content-center { text-align: left !important; }
  .hero-content-center * { margin-left: 0 !important; margin-right: 0 !important; }
  .hero-buttons { justify-content: flex-start !important; }
  
  .mobile-nav { 
    max-height: calc(100vh - var(--nav-h)); 
    overflow-y: auto; 
    -webkit-overflow-scrolling: touch; 
  }
}

/* ==================== SHOWCASE GRID (INDEX.PHP) ==================== */
.showcase-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  grid-template-rows: repeat(2, 240px);
  gap: 16px;
}

@media (max-width: 1024px) {
  .showcase-grid {
    grid-template-columns: repeat(2, 1fr);
    grid-template-rows: repeat(4, 200px);
  }
}

@media (max-width: 600px) {
  .showcase-grid {
    grid-template-columns: 1fr;
    grid-template-rows: auto;
  }
  .showcase-grid > div {
    grid-column: span 1 !important;
    grid-row: span 1 !important;
    aspect-ratio: 4/3;
  }
}

/* ==================== BENTO GRID RESPONSIVE ==================== */
.bento-grid {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: clamp(12px, 2vw, 24px);
}
.col-8  { grid-column: span 8; }
.col-4  { grid-column: span 4; }
.col-6  { grid-column: span 6; }
.col-12 { grid-column: span 12; }

@media (max-width: 900px) {
  .col-8, .col-4, .col-6 { grid-column: span 12; }
  .bento-card { height: auto !important; min-height: 280px; }
  .feature-card { min-height: 200px; padding: 24px !important; }
}
@media (max-width: 600px) {
  .bento-grid { grid-template-columns: 1fr; }
}

/* ==================== TESTIMONIALS RESPONSIVE ==================== */
@media (max-width: 900px) {
  .testimonial-card.featured { transform: none; }
}
@media (max-width: 700px) {
  .grid-3.testimonials-grid { grid-template-columns: 1fr; }
}

/* ==================== PRICING RESPONSIVE ==================== */
@media (max-width: 900px) {
  .pricing-card.featured { transform: none; }
}
@media (max-width: 700px) {
  .grid-3.pricing-grid { grid-template-columns: 1fr; }
}

/* ==================== FOOTER RESPONSIVE ==================== */
@media (max-width: 900px) {
  .footer-grid { grid-template-columns: 1fr 1fr; gap: 40px; }
}
@media (max-width: 600px) {
  .footer-grid { grid-template-columns: 1fr; }
  .footer-bottom { flex-direction: column; text-align: center; }
  .footer-legal  { justify-content: center; }
}

/* ==================== GALLERY RESPONSIVE ==================== */
@media (max-width: 768px) {
  .gallery-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 480px) {
  .gallery-grid { grid-template-columns: 1fr; }
}

/* ==================== FORMS RESPONSIVE ==================== */
@media (max-width: 768px) {
  .form-row { grid-template-columns: 1fr !important; }
  .form-section { padding: 24px; }
}

/* ==================== TOUCH & MOBILE ENHANCEMENTS ==================== */
@media (hover: none) {
  .card:hover, .feature-card:hover, .hover-depth:hover { 
    transform: none !important; 
    box-shadow: var(--shadow-md) !important; 
  }
}

/* Minimum 44px touch targets */
@media (max-width: 768px) {
  .navbar-menu a, .mobile-nav a, .footer-links a, .btn, button, input[type="submit"] {
    min-height: 44px;
    min-width: 44px;
  }
}

/* Prevent zoom on input focus for iOS */
@media (max-width: 480px) {
  input, textarea, select { font-size: 16px !important; }
}

/* ==================== ADMIN PANEL RESPONSIVE FIXES ==================== */
@media (max-width: 992px) {
  .mobile-menu-btn { display: flex !important; }
  .sidebar-toggle-btn { display: none !important; }
  
  .admin-sidebar-v2 {
    position: fixed;
    left: 0; top: 0; bottom: 0;
    width: 280px !important;
    z-index: 10005;
    transform: translateX(-100%);
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 20px 0 50px rgba(0,0,0,0.5);
  }
  
  body.mobile-sidebar-open .admin-sidebar-v2 {
    transform: translateX(0);
  }
  
  body.mobile-sidebar-open .sidebar-overlay-v2 {
    display: block !important;
    opacity: 1 !important;
  }
  
  .admin-main-v2 { margin-left: 0 !important; width: 100% !important; }
  .admin-topbar-v2 { left: 0 !important; width: 100% !important; padding: 0 16px !important; }
  
  .topbar-search { display: none !important; }
  .topbar-title { font-size: 18px !important; }
}

@media (max-width: 480px) {
  .admin-card-v2 { padding: 16px !important; }
  .admin-card-title-v2 { font-size: 18px !important; }
  .admin-table-v2-wrapper { margin: 0 -16px; }
  .admin-table-v2 th, .admin-table-v2 td { padding: 12px 10px !important; font-size: 13px !important; }
}

/* ==================== WHATSAPP FAB RESPONSIVE ==================== */
@media (max-width: 768px) {
  .whatsapp-fab { bottom: 20px; right: 20px; width: 56px; height: 56px; }
  .whatsapp-fab-tooltip { display: none !important; }
}

/* ==================== PRINT ==================== */
@media print {
  .navbar, .whatsapp-fab, .loading-screen, .hamburger, .mobile-nav { display: none !important; }
  body { padding-top: 0; }
  .hero { min-height: auto; height: auto; }
}
