/* =============================
   Balvi Infra — style.css
   ============================= */

:root {
  --primary:    #C8102E;
  --primary-dk: #9e0c24;
  --secondary:  #1A2744;
  --accent:     #F2A900;
  --surface:    #EAEAEA;
  --surface-lt: #F5F5F5;
  --muted:      #7B8794;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
  font-family: 'Barlow', sans-serif;
  background: #EAEAEA;
  color: #1A2744;
  overflow-x: hidden;
}

/* ── Typography ── */
.font-heading { font-family: 'Barlow Condensed', sans-serif; }

/* ── NAV ── */
.nav-link:hover .nav-underline,
.nav-link.active-nav .nav-underline { width: 100%; }
.nav-link.active-nav { color: var(--primary); }

/* Hamburger animation */
#hamburger.open .ham-line:nth-child(1) {
  transform: translateY(8px) rotate(45deg);
}
#hamburger.open .ham-line:nth-child(2) {
  opacity: 0; transform: scaleX(0);
}
#hamburger.open .ham-line:nth-child(3) {
  transform: translateY(-8px) rotate(-45deg);
}

/* Scrolled header */
#site-header.scrolled #topbar   { max-height: 0; padding-top: 0; padding-bottom: 0; }
#site-header.scrolled #navbar-main { box-shadow: 0 2px 20px rgba(0,0,0,0.12); }

/* ── HERO ── */
/* 
  The hero uses a Swiper that is `absolute inset-0` inside the section.
  The section itself must have an explicit height so content doesn't collapse.
*/
.hero-section {
  position: relative;
  height: 90vh;
  min-height: 520px;
  max-height: 900px;
  display: flex;
  align-items: center;
  overflow: hidden;
}

/* The outer wrapper section that contains the Swiper */
section.hero-section {
  height: 90vh;
  min-height: 520px;
}

/* Each swiper slide also needs full height */
.hero-swiper,
.hero-swiper .swiper-wrapper,
.hero-swiper .swiper-slide {
  height: 100% !important;
  width: 100%;
}

/* Inner .hero-section inside each slide */
.hero-swiper .swiper-slide .hero-section {
  height: 100%;
  min-height: 520px;
}

.hero-bg {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center center;
  background-repeat: no-repeat;
}

.hero-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to right, rgba(26,39,68,0.75) 0%, rgba(26,39,68,0.35) 60%, transparent 100%);
}

.hero-content {
  position: relative;
  z-index: 2;
  width: 100%;
}

/* Typed cursor */
.typed-cursor { color: var(--accent); font-size: inherit; }

/* ── SWIPER ── */
.swiper-pagination-bullet { background: rgba(255,255,255,.5); opacity: 1; width: 8px; height: 8px; }
.swiper-pagination-bullet-active { background: var(--primary); width: 28px; border-radius: 4px; }
.swiper-button-next, .swiper-button-prev { color: white; background: rgba(200,16,46,.7); width: 44px; height: 44px; border-radius: 0; }
.swiper-button-next::after, .swiper-button-prev::after { font-size: 14px; font-weight: 800; }

/* ── SECTION LABELS ── */
.section-label {
  display: inline-flex; align-items: center; gap: 10px;
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 12px; font-weight: 700; letter-spacing: .2em;
  text-transform: uppercase; color: var(--primary);
  margin-bottom: 12px;
}
.section-label::before {
  content: ''; display: block; width: 32px; height: 2px; background: var(--primary);
}

.section-title {
  font-family: 'Barlow Condensed', sans-serif;
  font-size: clamp(2rem, 5vw, 3.5rem);
  font-weight: 800; line-height: 1.05;
  color: var(--secondary); text-transform: uppercase;
}
.section-title span { color: var(--primary); }

/* ── CARDS ── */
.service-card {
  background: #fff;
  border-bottom: 3px solid transparent;
  transition: border-color .3s, transform .3s, box-shadow .3s;
}
.service-card:hover {
  border-color: var(--primary);
  transform: translateY(-6px);
  box-shadow: 0 20px 40px rgba(0,0,0,.1);
}
.service-icon {
  width: 56px; height: 56px; background: #EAEAEA;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.5rem; color: var(--primary);
  transition: background .3s, color .3s;
}
.service-card:hover .service-icon { background: var(--primary); color: #fff; }

.project-card { position: relative; overflow: hidden; }
.project-card img { transition: transform .6s ease; width: 100%; height: 280px; object-fit: cover; display: block; }
.project-card:hover img { transform: scale(1.08); }
.project-overlay {
  position: absolute; inset: 0;
  background: linear-gradient(to top, rgba(26,39,68,.9) 30%, transparent 70%);
  display: flex; flex-direction: column; justify-content: flex-end;
  padding: 24px;
  transform: translateY(12px); opacity: .85; transition: all .4s;
}
.project-card:hover .project-overlay { transform: translateY(0); opacity: 1; }

/* ── STAT STRIP ── */
.stat-strip { background: var(--secondary); }
.stat-num {
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 3.5rem; font-weight: 800; color: var(--accent);
  line-height: 1;
}

/* ── CTA BAND ── */
.cta-band { background: var(--primary); }

/* ── WHY US ── */
.why-item { display: flex; gap: 16px; align-items: flex-start; }
.why-icon {
  width: 48px; height: 48px; flex-shrink: 0; background: var(--primary);
  display: flex; align-items: center; justify-content: center;
  color: #fff; font-size: 1.1rem;
}

/* ── CLIENTS ── */
.client-logo {
  filter: grayscale(100%) opacity(.5);
  transition: filter .3s, transform .3s;
  max-height: 48px; object-fit: contain;
}
.client-logo:hover { filter: none; transform: scale(1.08); }

/* ── SCROLL TOP ── */
#scrollTop.visible { opacity: 1; visibility: visible; }

/* ── PATTERN BG ── */
.pattern-bg {
  background-color: #EAEAEA;
  background-image:
    linear-gradient(rgba(26,39,68,.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(26,39,68,.04) 1px, transparent 1px);
  background-size: 40px 40px;
}

/* ── ANIMATIONS ── */
@keyframes floatY {
  0%,100% { transform: translateY(0); }
  50%      { transform: translateY(-10px); }
}
.float-anim { animation: floatY 5s ease-in-out infinite; }

/* ================================================================
   RESPONSIVE — Full Mobile / Tablet / Desktop
   ================================================================ */

/* ── Global overflow prevention ── */
html, body { overflow-x: hidden; max-width: 100vw; }
img { max-width: 100%; height: auto; }
.container { width: 100%; }

/* ── Hero: Tablet (768px and below) ── */
@media (max-width: 768px) {
  .hero-section,
  section.hero-section {
    height: 75vh;
    min-height: 460px;
  }
  .hero-swiper .swiper-slide .hero-section {
    min-height: 460px;
  }
  .hero-overlay {
    background: linear-gradient(to bottom, rgba(26,39,68,0.5) 0%, rgba(26,39,68,0.75) 100%);
  }
  .hero-content {
    padding-top: 3rem !important;
    padding-bottom: 3rem !important;
  }
  .hero-content h1 {
    font-size: clamp(1.8rem, 6vw, 2.8rem) !important;
  }
}

/* ── Hero: Mobile (480px and below) ── */
@media (max-width: 480px) {
  .hero-section,
  section.hero-section {
    height: 70vh;
    min-height: 400px;
  }
  .hero-swiper .swiper-slide .hero-section {
    min-height: 400px;
  }
  .hero-content {
    padding-top: 2rem !important;
    padding-bottom: 5rem !important;
  }
  .hero-content h1 {
    font-size: clamp(1.6rem, 7vw, 2.2rem) !important;
    line-height: 1.1 !important;
  }
  .hero-content p {
    font-size: 0.875rem !important;
    line-height: 1.5 !important;
  }
  .hero-content .flex.flex-wrap {
    flex-direction: column;
    gap: 0.6rem;
    align-items: flex-start;
  }
  .hero-content a {
    padding: 0.75rem 1.25rem !important;
    font-size: 0.7rem !important;
    width: auto !important;
  }
  /* Hide scroll indicator on very small screens */
  .hero-section > .absolute.bottom-8.right-8 {
    display: none !important;
  }
  /* Swiper pagination – push above bottom edge */
  .swiper-pagination {
    bottom: 12px !important;
  }
}

/* ── About section floating badge – prevent overflow ── */
@media (max-width: 1024px) {
  .anime-float { animation: none !important; }
}
@media (max-width: 768px) {
  /* The -bottom-8 / -right-6 badge overflows on mobile */
  .absolute.-bottom-8.-right-6,
  .absolute.-bottom-8.-right-8 {
    position: static !important;
    margin-top: 1rem;
    width: 100% !important;
    display: inline-block;
  }
  /* Remove negative top/left decorative corner on mobile */
  .absolute.-top-4.-left-4 {
    display: none;
  }
  /* About image full width */
  .h-96 { height: 14rem; }
}

/* ── Section spacing ── */
@media (max-width: 768px) {
  .section-title { font-size: clamp(1.6rem, 6vw, 2.5rem); }
  .py-20 { padding-top: 3rem !important; padding-bottom: 3rem !important; }
  .py-28 { padding-top: 4rem !important; padding-bottom: 4rem !important; }
  .lg\:py-28 { padding-top: 3rem !important; padding-bottom: 3rem !important; }
}

/* ── Typed intro strip ── */
@media (max-width: 640px) {
  .bg-secondary.py-5 .container > .flex {
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 0.5rem;
    padding-top: 0.5rem;
    padding-bottom: 0.5rem;
  }
  #typed-text { font-size: 1rem; }
}

/* ── Stats strip ── */
@media (max-width: 768px) {
  .stat-num { font-size: 2.5rem; }
  .stat-strip .grid { gap: 1.5rem; }
}
@media (max-width: 480px) {
  .stat-num { font-size: 2rem; }
  .stat-strip .grid {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 1.25rem;
  }
}

/* ── Service cards ── */
@media (max-width: 640px) {
  .service-card { border-radius: 0; overflow: hidden; }
  /* Single column on very small screens */
  .grid.sm\:grid-cols-2.lg\:grid-cols-3 { grid-template-columns: 1fr; }
}

/* ── Project cards ── */
.project-card { aspect-ratio: 4/3; min-height: 200px; }
@media (max-width: 480px) {
  .project-card { aspect-ratio: 3/2; min-height: 160px; }
  .project-card img { height: auto; }
}

/* ── CTA Band ── */
@media (max-width: 768px) {
  .cta-band .container { flex-direction: column !important; text-align: center; gap: 1.5rem; }
  .cta-band h2 { font-size: clamp(1.5rem, 5vw, 2rem); }
}
@media (max-width: 640px) {
  .cta-band .flex.flex-wrap { flex-direction: column; align-items: stretch; }
  .cta-band .flex.flex-wrap a { justify-content: center; padding: 0.85rem 1rem; }
}

/* ── Why Us items ── */
.why-item { display: flex; align-items: flex-start; gap: 1rem; }
@media (max-width: 480px) {
  .why-item { gap: 0.75rem; }
  .why-icon { width: 2.5rem; height: 2.5rem; font-size: 1rem; flex-shrink: 0; }
}

/* ── Clients grid ── */
@media (max-width: 480px) {
  .grid-cols-2.sm\:grid-cols-3 { grid-template-columns: repeat(2, 1fr); }
}

/* ── Footer ── */
@media (max-width: 640px) {
  footer .grid { grid-template-columns: 1fr !important; gap: 2rem; }
  footer h4 { font-size: 1rem; }
  footer .lg\:col-span-1 { grid-column: span 1 !important; }
}

/* ── Nav mobile menu ── */
#mobile-menu a { border-bottom: 1px solid rgba(255,255,255,0.08); }
#mobile-menu a:last-of-type { border-bottom: none; }

/* ── Floating call/whatsapp buttons ── */
@media (max-width: 640px) {
  /* Keep them from overlapping content */
  a.fixed.bottom-\[100px\].left-\[20px\],
  a.fixed.bottom-\[30px\].left-\[20px\] {
    width: 48px !important;
    height: 48px !important;
    font-size: 1.2rem !important;
  }
  #scrollTop {
    bottom: 1rem;
    right: 1rem;
    width: 40px;
    height: 40px;
  }
}

/* ── Page banner on inner pages ── */
@media (max-width: 768px) {
  .bg-secondary.py-20 { padding-top: 3.5rem !important; padding-bottom: 3.5rem !important; }
  .bg-secondary.py-20 h1 { font-size: clamp(2.2rem, 8vw, 3.5rem) !important; }
}
@media (max-width: 480px) {
  .bg-secondary.py-20 h1 { font-size: clamp(1.8rem, 9vw, 2.5rem) !important; }
}

/* ── Projects page filter buttons ── */
.filter-btn { white-space: nowrap; }
@media (max-width: 640px) {
  .filter-btn { padding: 0.4rem 0.85rem; font-size: 0.7rem; }
  /* allow wrap */
  .flex.flex-wrap.justify-center.gap-3 { gap: 0.5rem; }
}

/* ── Project modal responsive ── */
@media (max-width: 640px) {
  #projectModal > div { max-height: 95vh; border-radius: 0.5rem; }
  #projectModal h2 { font-size: 1.5rem; }
}

/* ── Services page grid ── */
@media (max-width: 640px) {
  .grid.md\:grid-cols-2.lg\:grid-cols-3 { grid-template-columns: 1fr; }
  .grid.sm\:grid-cols-2.lg\:grid-cols-4 { grid-template-columns: repeat(2, 1fr); }
}

/* ── About page vision/mission/values ── */
@media (max-width: 640px) {
  .grid.md\:grid-cols-3 { grid-template-columns: 1fr; }
}

/* ── Contact page ── */
@media (max-width: 768px) {
  .grid.lg\:grid-cols-2 { grid-template-columns: 1fr; }
}

/* ── Infinite slider / marquee track ── */
@media (max-width: 640px) {
  .card { min-width: 16rem; max-width: 16rem; }
  .slider-track { animation-duration: 30s; }
}

/* ── Testimonial swiper ── */
@media (max-width: 640px) {
  .testi-swiper .swiper-slide { padding: 1rem; }
}

/* ================================================================
   ADMIN PANEL — Responsive Improvements
   ================================================================ */

body.admin-body { overflow-x: hidden; }

.admin-table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; width: 100%; }
.admin-table-wrap table { min-width: 600px; }

.dataTables_wrapper { overflow-x: auto; }
table.dataTable { min-width: 500px; }

@media (max-width: 768px) {
  .admin-content { padding: 1rem; }
  .stat-grid-admin { grid-template-columns: repeat(2, 1fr) !important; }
  .admin-btn-sm { padding: 0.5rem 0.75rem; font-size: 0.75rem; }
  #bulkBar { flex-direction: column; align-items: flex-start; }
}

@media (max-width: 480px) {
  .stat-grid-admin { grid-template-columns: 1fr !important; }
}