/* This file contains all styles for mobile screens (max-width: 768px).*/

@media (max-width: 768px) {
  /* =================================
       Header & Navigation
    ================================= */

  .header-content {
    flex-direction: row !important; /* Keep logo and hamburger in a row */
    justify-content: space-between !important; /* Logo left, hamburger right */
    align-items: center !important;
    padding: 10px 20px !important; /* Add some padding */
    gap: 0 !important; /* Remove column gap */
    margin-top: 0 !important;
  }

  .header-content a {
    margin-left: 0 !important; /* Remove inconsistent margin */
  }

  .logo img[src$="HackArambh_logo.jpeg"] {
    width: 150px !important; /* Make logo a bit smaller on mobile */
  }

  /* Show hamburger on mobile */
  .hamburger {
    margin-left: 40%;
    display: flex !important;
    margin-right: 0 !important; /* Remove weird margin */
    flex-direction: column !important;
    cursor: pointer !important;
    gap: 5px !important;
    z-index: 101 !important;
  }

  .hamburger span {
    background-color: #022044;
    height: 3px !important;
    width: 25px !important;
    border-radius: 2px !important;
    transition: all 0.3s ease !important;
  }

  /* Hide desktop auth buttons */
  .auth-buttons {
    display: none !important;
  }

  /* Nav menu for mobile */
  nav {
    width: 100% !important;
  }

  nav ul {
    flex-direction: column !important;
    position: absolute !important;
    top: 60px !important; /* Position below header */
    left: 0 !important;
    width: 100% !important;
    background: linear-gradient(
      135deg,
      var(--primary),
      var(--secondary)
    ) !important;
    overflow: hidden !important;
    transform: scaleY(0) !important; /* collapsed */
    transform-origin: top !important;
    opacity: 0 !important;
    transition: transform 0.4s ease, opacity 0.4s ease !important;
    z-index: 99 !important;
    max-height: 0; /* Fallback */
  }

  /* Active menu - smooth open */
  nav.active ul {
    transform: scaleY(1) !important;
    opacity: 1 !important;
    max-height: 500px !important; /* Fallback */
  }

  nav ul li {
    margin: 10px 0 !important;
    text-align: center !important;
  }

  nav ul li a {
    color: white !important;
    font-size: 1.1rem !important;
    display: block !important;
    padding: 10px 0 !important;
  }

  /* Hamburger animation when clicked */
  .hamburger.active span:nth-child(1) {
    transform: rotate(45deg) translate(5px, 5px) !important;
  }
  .hamburger.active span:nth-child(2) {
    opacity: 0 !important;
  }
  .hamburger.active span:nth-child(3) {
    transform: rotate(-45deg) translate(5px, -5px) !important;
  }

  /* =================================
       Hero Section (All Pages)
    ================================= */

  .hero {
    padding: 60px 0; /* Reduce padding */
  }

  .hero h1 {
    font-size: 2.2rem;
  }

  .hero p {
    font-size: 1rem;
  }

  /* =================================
       Index Page: Sections
    ================================= */

  .categories-filter {
    gap: 10px; /* Reduce gap between filter buttons */
  }

  .filter-btn {
    padding: 8px 18px; /* Make buttons slightly smaller */
    font-size: 0.9rem;
  }

  /* Stack cards in a single column */
  .categories-grid {
    grid-template-columns: 1fr;
  }

  /* Stack feature cards */
  .features-grid {
    grid-template-columns: 1fr;
  }

  /* =================================
       Index Page: Timeline
    ================================= */

  .timeline-container::after {
    left: 31px; /* Move timeline bar to the left */
  }

  .timeline-item {
    width: 100%; /* Make items full width */
    padding-left: 70px; /* Add padding to the right of the bar */
    padding-right: 25px;
  }

  .timeline-item:nth-child(even) {
    left: 0; /* Align all items to the left */
  }

  /* =================================
       Contact Page Fixes
    ================================= */

  /* Override the container's inline style */
  .contact .container {
    max-width: 100% !important;
    padding: 0 15px !important; /* Add small padding */
  }

  .contact-grid {
    gap: 20px !important; /* Reduce gap */
  }

  /* Override inline padding on form/details cards */
  .contact-form,
  .contact-details {
    padding: 20px !important;
    min-width: 100% !important; /* Force full width */
  }

  /* Target the captcha row */
  .form-group[style*="display:flex"] {
    flex-wrap: wrap !important; /* Allow captcha to wrap */
    gap: 10px !important;
  }

  .form-group[style*="display:flex"] img {
    flex-grow: 1;
    max-width: 150px;
  }

  .form-group[style*="display:flex"] input[name="captcha"] {
    flex-grow: 2;
    flex-basis: 100px;
  }

  .form-group[style*="display:flex"] button[onclick="refreshCaptcha()"] {
    flex-grow: 0;
  }

  .contact-details .map iframe {
    height: 300px !important; /* Reduce map height */
  }

  /* =================================
       Floating WA Button
    ================================= */
  .float {
    width: 50px;
    height: 50px;
    bottom: 20px;
    right: 20px;
    font-size: 24px;
  }

  .my-float {
    margin-top: 13px;
  }
}
