/* Responsive overrides - added to improve mobile behaviour without changing desktop styles */

/* Ensure media elements don't overflow on small screens */
img,
video {
  max-width: 100%;
  height: auto;
  display: block;
}

/* Utility containers take available width on small screens */
.container,
.card,
.section {
  box-sizing: border-box;
}

/* Mobile targeted rules */
@media (max-width: 768px) {
  body {
    font-size: 14px;
    /* slightly smaller for mobile */
    padding: 10px;
  }

  .container,
  .card,
  .section {
    width: 100%;
    margin: auto;
    padding-left: 8px;
    padding-right: 8px;
  }

  /* If nav uses ul / flex, stack it on mobile */
  nav ul,
  .nav-links {
    display: flex !important;
    flex-direction: column !important;
    align-items: stretch !important;
    /* Full width items */
    gap: 0;
    /* Spacing handled by padding/borders */
  }

  /* Make hero and other large paddings smaller on mobile */
  .hero-section {
    padding: 32px 0;
  }

  /* Cards - ensure compact view keeps images & titles readable */
  .case-study-card {
    padding: 0;
  }

  .case-study-card .card-thumb {
    height: 160px;
  }

  .case-study-card .card-content {
    padding: 14px 16px;
  }

  /* Modal adjustments on small screens */
  .modal {
    max-width: 100%;
    margin: 12px;
  }

  .modal-slider .slides {
    height: 220px;
  }

  .modal-slider img.slide {
    max-height: 220px;
  }

  /* Header - burger mode: keep desktop header intact, only apply on small screens */
  .header-container {
    display: flex;
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
    padding: 12px;
    position: relative;
  }

  .header-container .logo {
    position: absolute;
    left: 12px;
    top: 12px;
    text-align: left;
  }

  .header-container .logo img {
    height: 80px;
    width: auto;
    display: inline-block;
    animation: fadeInLogo 0.8s ease-out;
  }

  @keyframes fadeInLogo {
    from {
      opacity: 0;
      transform: scale(0.8);
    }

    to {
      opacity: 1;
      transform: scale(1);
    }
  }

  /* Nav as floating popup on mobile */
  .nav-links {
    display: none;
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.95);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-left: 1px solid rgba(255, 65, 0, 0.2);
    box-shadow: -5px 0 25px rgba(0, 0, 0, 0.5);
    width: 100%;
    max-width: 300px;
    padding: 60px 20px 20px;
    z-index: 99999;
    transform: translateX(100%);
    transition: transform 0.3s ease-out;
  }

  /* Header Animation */
  header {
    animation: slideDown 0.5s ease-out;
  }

  @keyframes slideDown {
    from {
      transform: translateY(-100%);
      opacity: 0;
    }

    to {
      transform: translateY(0);
      opacity: 1;
    }
  }

  /* Enhanced Glassmorphism for Mobile Nav */
  .nav-links {
    background: rgba(10, 10, 10, 0.85);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    border-left: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: -10px 0 30px rgba(0, 0, 0, 0.8);
  }

  /* nav links styling inside popup */
  .nav-links a {
    display: block;
    padding: 16px 20px;
    font-size: 18px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    text-align: left;
    color: #fff;
    transition: background 0.3s, padding-left 0.3s;
  }

  .nav-links a:hover {
    background: rgba(255, 65, 0, 0.1);
    padding-left: 25px;
    color: #ff4100;
  }

  /* Do not hide specific links in the mobile nav — keep menu consistent across pages */
  /* Previously some links were hidden using exact href selectors which varied by page
     (e.g. 'about.html' vs 'pages/about.html'). Removing that ensures About/Profile are
     visible on all pages and the mobile menu is consistent. */

  /* Open state */
  .nav-links.open {
    display: block;
    transform: translateX(0);
  }

  /* Burger button styling */
  .burger {
    position: absolute;
    right: 14px;
    top: 12px;
    width: 40px;
    height: 40px;
    border-radius: 8px;
    background: rgba(0, 0, 0, 0.45);
    border: 1px solid rgba(255, 255, 255, 0.06);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 100000;
    cursor: pointer;
    transition: background-color 0.3s;
  }

  .burger:hover {
    background: rgba(255, 65, 0, 0.3);
  }

  /* Close button inside nav menu */
  .nav-close {
    position: absolute;
    top: 12px;
    right: 12px;
    width: 40px;
    height: 40px;
    border-radius: 8px;
    background: rgba(255, 65, 0, 0.2);
    border: none;
    color: #fff;
    font-size: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 100001;
    cursor: pointer;
    transition: background-color 0.3s;
  }

  .nav-close:hover {
    background: rgba(255, 65, 0, 0.3);
  }

  /* Booking button in mobile menu */
  .mobile-nav-btn {
    margin-top: 30px;
    padding: 0 20px;
    text-align: center;
  }

  .mobile-nav-btn a {
    display: block;
    background: linear-gradient(135deg, #ff4100, #ff6b3d);
    color: #fff !important;
    padding: 14px;
    border-radius: 12px;
    text-decoration: none;
    font-weight: 600;
    font-size: 16px;
    box-shadow: 0 4px 15px rgba(255, 65, 0, 0.3);
    border: none;
    text-align: center;
    width: 100%;
    box-sizing: border-box;
  }

  .mobile-nav-btn a:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(255, 65, 0, 0.4);
    background: linear-gradient(135deg, #ff5722, #ff8a65);
    padding-left: 14px;
    /* Reset hover effect from links */
  }

  /* Overlay when nav is open */
  .nav-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(3px);
    -webkit-backdrop-filter: blur(3px);
    z-index: 1090;
  }

  .nav-overlay.open {
    display: block;
  }
}

@media (max-width: 480px) {
  body {
    font-size: 13px;
    padding: 8px;
  }

  .case-study-card .card-thumb {
    height: 140px;
  }

  .modal-slider .slides {
    height: 180px;
  }

  .modal-slider img.slide {
    max-height: 180px;
  }
}

@media (max-width: 360px) {
  body {
    font-size: 12.5px;
    padding: 6px;
  }

  .case-study-card .card-thumb {
    height: 120px;
  }
}

/* Small helper when content needs centering on mobile */
.center-on-mobile {
  text-align: center;
}

/* Mobile Footer Adjustments */
@media (max-width: 768px) {
  .footer-content {
    display: flex;
    flex-direction: column;
    gap: 0;
  }

  .footer-section {
    border-bottom: 1px solid rgba(255, 65, 0, 0.2);
    padding: 0;
    margin: 0;
    width: 100%;
  }

  .footer-section h3 {
    padding: 15px;
    margin: 0;
    cursor: pointer;
    position: relative;
    display: block;
    font-size: 16px;
    width: 100%;
    box-sizing: border-box;
  }

  /* Plus icon */
  .footer-section h3::after {
    content: '+';
    position: absolute;
    right: 15px;
    top: 50%;
    transform: translateY(-50%);
    color: #ff4100;
    font-size: 20px;
    transition: transform 0.3s ease;
  }

  .footer-section.active h3::after {
    transform: translateY(-50%) rotate(45deg);
  }

  /* Hide content by default */
  .footer-section>*:not(h3) {
    display: none;
  }

  /* Show content when active */
  .footer-section.active>*:not(h3) {
    display: block;
    text-align: center;
    padding-bottom: 15px;
  }

  .footer-section.active p,
  .footer-section.active a {
    justify-content: center;
  }

  .footer-section.active .social-links {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    padding: 10px 0;
  }
}