/* =============================================
   MOBILE RESPONSIVE STYLES - DKG GROUP
   Covers: tablets (768px) & phones (480px)
   ============================================= */

/* =============================================
   MOBILE-FIRST OPTIMIZATIONS
   Disable expensive effects and improve touch UX
   ============================================= */

/* Disable particles on mobile for performance */
@media (max-width: 992px) {
  #canvas-particles {
    display: none !important;
  }
}

/* Disable custom cursor and glow effects on touch devices */
@media (max-width: 992px), (hover: none) and (pointer: coarse) {
  .custom-cursor,
  .custom-cursor-glow {
    display: none !important;
  }
  .mouse-glow-bg {
    display: none !important;
  }
}

/* ---- Hamburger Menu Button ---- */
.hamburger-btn {
  display: none;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 5px;
  width: 48px;
  height: 48px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--glass-border);
  border-radius: 10px;
  cursor: pointer !important;
  z-index: 200;
  transition: background 0.3s;
  padding: 8px;
}

.hamburger-btn span {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--text-primary);
  border-radius: 2px;
  transition: all 0.35s cubic-bezier(0.16, 1, 0.3, 1);
  transform-origin: center;
}

.hamburger-btn.open span:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}
.hamburger-btn.open span:nth-child(2) {
  opacity: 0;
  transform: scaleX(0);
}
.hamburger-btn.open span:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

/* ---- Mobile Navigation Drawer ---- */
.mobile-nav-drawer {
  display: none;
  position: fixed;
  top: 0;
  right: 0;
  width: 280px;
  height: 100vh;
  background: rgba(5, 5, 18, 0.97);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-left: 1px solid var(--glass-border);
  z-index: 190;
  padding: 100px 2rem 3rem;
  flex-direction: column;
  gap: 0.5rem;
  transform: translateX(100%);
  transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.mobile-nav-drawer.open {
  transform: translateX(0);
}

.mobile-nav-drawer a {
  display: block;
  padding: 1rem 1.5rem;
  color: var(--text-secondary);
  text-decoration: none;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.1rem;
  border-radius: 10px;
  transition: all 0.3s ease;
  border: 1px solid transparent;
}

.mobile-nav-drawer a:hover {
  color: var(--text-primary);
  background: rgba(124, 58, 237, 0.1);
  border-color: var(--glass-border);
}

.mobile-nav-drawer .cta-btn-nav {
  margin-top: 1rem;
  text-align: center;
}

/* Overlay behind drawer */
.mobile-nav-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  z-index: 180;
  opacity: 0;
  transition: opacity 0.3s;
  pointer-events: none;
}

.mobile-nav-overlay.open {
  opacity: 1;
  pointer-events: auto;
}

/* ============================================
   TABLET (max-width: 992px) — already partial
   ============================================ */
@media (max-width: 992px) {
  /* Show hamburger, hide desktop nav */
  .hamburger-btn {
    display: flex;
  }
  .mobile-nav-drawer {
    display: flex;
  }
  .mobile-nav-overlay {
    display: block;
  }

  section {
    padding: 6rem 2.5rem;
    min-height: auto;
  }

  /* Hero */
  .hero-section {
    grid-template-columns: 1fr;
    text-align: center;
    padding-top: 10rem;
    gap: 2rem;
  }

  .hero-title {
    font-size: 3.8rem;
  }

  .hero-changing-text-wrapper {
    font-size: 1.1rem;
    height: auto;
    margin: 0 auto 2.5rem auto;
  }

  .hero-actions {
    justify-content: center;
    flex-wrap: wrap;
  }

  .hero-3d-container {
    height: 380px;
  }

  /* Stats */
  .interactive-stats {
    grid-column: span 1;
    grid-template-columns: repeat(2, 1fr);
    gap: 1.5rem;
    padding: 2rem;
  }

  .stat-number {
    font-size: 2.5rem;
  }

  /* Showcase */
  .showcase-grid {
    grid-template-columns: 1fr;
    gap: 2rem;
  }

  /* Services */
  .services-grid {
    grid-template-columns: 1fr;
    gap: 2rem;
  }

  .service-card {
    grid-template-columns: 1fr;
    text-align: center;
  }

  .service-scene {
    margin: 0 auto;
    max-width: 260px;
  }

  /* Why DKG */
  .comparison-container {
    grid-template-columns: 1fr;
    gap: 2rem;
  }

  /* Process timeline RTL fix */
  .process-timeline {
    padding-right: 2.5rem;
    padding-left: 0;
  }

  /* Contact */
  .contact-grid {
    grid-template-columns: 1fr;
    gap: 3rem;
  }

  #canvas3d-earth {
    height: 300px;
  }

  /* Section headers */
  .section-title {
    font-size: 2.4rem;
  }
}

/* ============================================
   MOBILE (max-width: 768px)
   ============================================ */
@media (max-width: 768px) {

  /* Header */
  header {
    padding: 1.2rem 1.5rem;
  }

  header.scrolled {
    padding: 0.9rem 1.5rem;
  }

  .logo {
    font-size: 1.5rem;
  }

  section {
    padding: 5rem 1.5rem;
    min-height: auto;
  }

  /* Hero */
  .hero-section {
    padding-top: 9rem;
    gap: 1.5rem;
  }

  .hero-title {
    font-size: 3rem;
    letter-spacing: -0.05rem;
  }

  .hero-changing-text-wrapper {
    font-size: 1rem;
    height: auto;
    margin: 0 auto 1.5rem auto;
  }

  .hero-actions {
    flex-direction: column;
    align-items: center;
    gap: 1rem;
    margin-bottom: 2rem;
  }

  .btn-primary,
  .btn-secondary {
    width: 100%;
    max-width: 280px;
    justify-content: center;
    padding: 1rem 1.5rem;
    font-size: 0.95rem;
    min-height: 48px;
    display: flex;
    align-items: center;
  }

  .hero-3d-container {
    height: 300px;
  }

  /* Stats */
  .interactive-stats {
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
    padding: 1.5rem;
    margin-top: 2rem;
  }

  .stat-number {
    font-size: 2.2rem;
  }

  .stat-label {
    font-size: 0.85rem;
  }

  /* Section Headers */
  .section-title {
    font-size: 2rem;
    line-height: 1.3;
  }

  .section-subtitle {
    font-size: 1rem;
  }

  .section-header {
    margin-bottom: 2.5rem;
  }

  /* Showcase */
  .showcase-card {
    height: auto;
  }
  .showcase-preview-frame {
    height: 250px;
  }
  .showcase-details {
    height: auto;
    padding: 1.2rem;
  }

  /* Services */
  .service-card {
    padding: 2rem 1.5rem;
    gap: 1.5rem;
  }

  /* Why DKG */
  .comparison-card {
    padding: 2rem 1.5rem;
  }

  .comparison-header {
    font-size: 1.6rem;
  }

  .comparison-item {
    font-size: 0.95rem;
    padding: 0.6rem 0;
  }
  
  .comparison-card {
    padding: 1.5rem 1.2rem;
  }

  /* Process */
  .process-timeline {
    padding-right: 2rem;
    margin: 2rem auto;
  }

  .process-title {
    font-size: 1.4rem;
  }

  /* Live Code */
  .live-code-body {
    padding: 1rem;
    font-size: 0.85rem;
    min-height: 150px;
    overflow-x: auto;
  }
  
  .live-code-header {
    padding: 0.8rem 1rem;
    flex-wrap: wrap;
  }
  
  .live-code-dot {
    width: 10px;
    height: 10px;
  }

  /* Contact */
  .contact-grid {
    gap: 2rem;
  }

  #canvas3d-earth {
    height: 280px;
  }

  /* Form inputs on mobile */
  .form-group {
    margin-bottom: 1.5rem;
  }

  .form-label {
    font-size: 0.9rem;
    margin-bottom: 0.6rem;
  }

  .form-control {
    padding: 1rem 1rem;
    font-size: 16px;
    border-radius: 10px;
  }

  textarea {
    min-height: 100px;
    font-size: 16px;
  }

  /* Glass card */
  .glass-card {
    padding: 2rem 1.5rem;
  }

  /* Footer */
  footer {
    flex-direction: column !important;
    text-align: center;
    gap: 1rem !important;
    padding: 2rem 1rem !important;
    font-size: 0.9rem;
  }
  
  footer a {
    min-height: 44px;
    display: inline-flex;
    align-items: center;
  }

  /* Loader */
  .loader-logo {
    font-size: 2.8rem;
    letter-spacing: 0.3rem;
  }
}

/* ============================================
   SMALL PHONES (max-width: 480px)
   ============================================ */
@media (max-width: 480px) {

  section {
    padding: 3.5rem 1rem;
    min-height: auto;
  }

  .hero-title {
    font-size: 2.2rem;
    line-height: 1.2;
    margin-bottom: 1rem;
  }

  .hero-3d-container {
    height: 220px;
    margin-bottom: 2rem;
  }
  
  .section-title {
    font-size: 1.65rem;
    margin-bottom: 1rem;
  }
  
  .section-subtitle {
    font-size: 0.95rem;
  }

  /* Improve link/touch targets */
  a, button {
    min-height: 44px;
    display: inline-flex;
    align-items: center;
  }
  
  /* Better spacing on small screens */
  .hero-actions {
    gap: 0.8rem;
    margin-bottom: 1.5rem;
  }
  
  /* Stack stats 2 columns stays, just tighten */
  .interactive-stats {
    gap: 0.8rem;
    padding: 1.2rem;
    grid-template-columns: 1fr 1fr;
  }

  .stat-number {
    font-size: 1.8rem;
  }
  
  .stat-label {
    font-size: 0.8rem;
  }

  .section-title {
    font-size: 1.75rem;
  }

  /* Process */
  .process-timeline {
    padding-right: 1.5rem;
    margin: 1rem auto;
  }

  .process-node {
    width: 24px;
    height: 24px;
  }

  .process-num {
    font-size: 1rem;
  }

  .process-title {
    font-size: 1.1rem;
  }
  
  .process-desc {
    font-size: 0.9rem;
  }

  /* Live code */
  .live-code-body {
    font-size: 0.8rem;
    padding: 1.2rem;
  }

  /* Showcase card smaller */
  .showcase-card {
    height: auto;
    border-radius: 12px;
  }
  .showcase-preview-frame {
    height: 180px;
    border-radius: 12px 12px 0 0;
  }
  .showcase-details {
    height: auto;
    padding: 0.9rem;
  }
  
  .showcase-title {
    font-size: 1.1rem;
  }

  /* Buttons full width on small phones */
  .btn-primary,
  .btn-secondary {
    max-width: 100%;
    font-size: 0.9rem;
    padding: 0.9rem 1.2rem;
    min-height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
  }

  /* Contact section optimization */
  .contact-grid {
    gap: 1.5rem;
  }

  #canvas3d-earth {
    height: 240px;
  }

  .contact-grid > div:first-child {
    max-width: 100%;
  }

  /* Form optimization for small phones */
  .form-group {
    margin-bottom: 1.2rem;
  }

  .form-label {
    font-size: 0.88rem;
    margin-bottom: 0.5rem;
  }

  .form-control {
    padding: 0.9rem 0.9rem;
    font-size: 16px;
    border-radius: 8px;
    min-height: 44px;
  }

  textarea.form-control {
    min-height: 100px;
    font-size: 16px;
    padding: 0.9rem;
  }

  /* Mobile nav drawer narrower */
  .mobile-nav-drawer {
    width: 240px;
    padding: 90px 1.5rem 2rem;
  }

  .loader-logo {
    font-size: 2.2rem;
    letter-spacing: 0.2rem;
  }
}

/* ============================================
   Disable custom cursor + mouse glow on touch
   ============================================ */
@media (hover: none) and (pointer: coarse) {
  .custom-cursor,
  .custom-cursor-glow,
  .mouse-glow-bg {
    display: none !important;
  }

  a, button, input, textarea, select {
    cursor: pointer !important;
  }

  .showcase-card,
  .pricing-card,
  .faq-question,
  .hamburger-btn {
    cursor: pointer !important;
  }
}

/* ============================================
   ENHANCED MOBILE TOUCH INTERACTIONS & FORMS
   ============================================ */

/* Optimize form inputs for mobile */
@media (max-width: 768px) {
  input[type=" text\],
 input[type=\email\],
 input[type=\phone\],
 input[type=\tel\],
 input[type=\date\],
 input[type=\number\],
 textarea,
 select {
 font-size: 16px !important; /* Prevents iOS zoom */
 padding: 0.95rem 1.2rem !important;
 min-height: 48px !important;
 border-radius: 8px;
 margin-bottom: 0.5rem;
 }
 
 textarea {
 min-height: 120px;
 resize: vertical;
 }
 
 /* Label spacing on mobile */
 label {
 display: block;
 margin-bottom: 0.5rem;
 font-size: 0.95rem;
 }
}

/* Touch-friendly links and buttons */
@media (max-width: 768px) {
 a, button, [role=\button\] {
 min-height: 44px;
 display: inline-flex;
 align-items: center;
 justify-content: center;
 padding: 0.8rem 1.2rem;
 }
 
 /* Better spacing between clickable elements */
 .nav-links a,
 .mobile-nav-drawer a {
 padding: 0.8rem 1.2rem;
 margin: 0.25rem 0;
 }
}

/* ============================================
 PERFORMANCE OPTIMIZATIONS
 ============================================ */

/* Reduce animation complexity on mobile */
@media (max-width: 768px) {
 * {
 animation-duration: 0.5s !important;
 }
 
 .glass-card,
 .showcase-card,
 .service-card {
 transition: all 0.3s ease !important;
 }
}

/* Optimize Three.js containers */
@media (max-width: 992px) {
 .hero-3d-container {
 max-height: 380px;
 }
 
 .service-scene {
 max-width: 280px;
 }
}

@media (max-width: 768px) {
 .hero-3d-container {
 max-height: 320px;
 }
 
 .service-scene {
 max-width: 240px;
 }
}

@media (max-width: 480px) {
 .hero-3d-container {
 max-height: 220px;
 }
 
 .service-scene {
 max-width: 200px;
 margin: 0 auto;
 }
}

/* ============================================
 IMAGE & MEDIA RESPONSIVE
 ============================================ */

@media (max-width: 768px) {
 img {
 max-width: 100%;
 height: auto;
 display: block;
 }
 
 .showcase-preview-frame img {
 width: 100%;
 height: 100%;
 object-fit: cover;
 }
}

/* ============================================
 HEADER/NAV IMPROVEMENTS FOR MOBILE
 ============================================ */

@media (max-width: 768px) {
 header {
 gap: 1rem;
 justify-content: space-between;
 padding: 1rem 1.2rem;
 }
 
 .logo {
 font-size: 1.2rem;
 font-weight: 800;
 }
 
 .cta-btn-nav {
 font-size: 0.85rem;
 padding: 0.6rem 1rem;
 white-space: nowrap;
 }
}

/* ============================================
 SECTION SPACING OPTIMIZATION FOR MOBILE
 ============================================ */

@media (max-width: 480px) {
 section {
 padding: 3.5rem 1rem !important;
 }
 
 .section-header {
 margin-bottom: 2rem;
 }
 
 .section-tag {
 font-size: 0.8rem;
 letter-spacing: 0.2rem;
 }
 
 .section-subtitle {
 line-height: 1.5;
 }
}

/* ============================================
 CONTACT FORM OPTIMIZATION
 ============================================ */

@media (max-width: 768px) {
 .contact-grid {
 gap: 2rem;
 }
 
 .contact-form {
 display: flex;
 flex-direction: column;
 gap: 1rem;
 }
 
 .form-group {
 margin-bottom: 0.5rem;
 }
}

/* ============================================
 SCROLL & VIEWPORT OPTIMIZATIONS
 ============================================ */

@media (max-width: 768px) {
 html {
 scroll-behavior: smooth;
 -webkit-scroll-behavior: smooth;
 }
 
 /* Smooth scrolling on iOS */
 body {
 -webkit-user-select: none;
 -webkit-touch-callout: none;
 }
 
 /* Prevent double tap zoom */
 input[type=\button\],
 input[type=\submit\],
 button {
 touch-action: manipulation;
 }
}

/* ============================================
 PRINT STYLES FOR MOBILE
 ============================================ */

@media print {
 body {
 background: white;
 color: black;
 }
 
 .hamburger-btn,
 .mobile-nav-drawer,
 .mobile-nav-overlay {
 display: none !important;
 }
}
