/* ============================================================
   MEGALODON BUILDS — Custom CSS
   Brand: Eclipse #081E39 | Lapis #00478F | Cyan #00ACEE
         Pearls #F0EFFE | Lion #CE2A21
   Fonts: Playfair Display (display) | Inter (body)
   ============================================================ */

/* ─── CSS Custom Properties ──────────────────────────────── */
:root {
  --color-eclipse:    #081E39;
  --color-lapis:      #00478F;
  --color-cyan:       #00ACEE;
  --color-pearls:     #F0EFFE;
  --color-lion:       #CE2A21;
  --color-lion-dark:  #a82218;
  --color-white:      #ffffff;
  --color-gray-100:   #f3f4f6;
  --color-gray-600:   #4b5563;
  --color-gray-900:   #111827;

  --font-display: 'Playfair Display', Georgia, 'Times New Roman', serif;
  --font-body:    'Inter', system-ui, -apple-system, sans-serif;

  --shadow-card:  0 4px 24px rgba(8,30,57,0.10);
  --shadow-hover: 0 12px 40px rgba(8,30,57,0.18);
  --transition:   all 0.28s cubic-bezier(0.4, 0, 0.2, 1);
  --radius-sm:    4px;
  --radius-md:    8px;
  --radius-lg:    16px;
}

/* ─── Base ───────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  font-family: var(--font-body);
  color: var(--color-gray-900);
  background-color: var(--color-white);
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

h1, h2, h3, h4, h5 {
  font-family: var(--font-display);
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: -0.01em;
}

img { max-width: 100%; height: auto; }

a { transition: var(--transition); }

/* ─── Utility: Brand Gradient ────────────────────────────── */
.gradient-eclipse {
  background: linear-gradient(135deg, var(--color-eclipse) 0%, #0d2e56 100%);
}
.gradient-lapis {
  background: linear-gradient(135deg, var(--color-lapis) 0%, #0060c0 100%);
}
.gradient-hero {
  background: linear-gradient(
    to right,
    rgba(8,30,57,0.92) 0%,
    rgba(8,30,57,0.70) 60%,
    rgba(0,71,143,0.40) 100%
  );
}
.gradient-overlay {
  background: linear-gradient(
    to top,
    rgba(8,30,57,0.90) 0%,
    rgba(8,30,57,0.50) 50%,
    rgba(8,30,57,0.15) 100%
  );
}

/* ─── Typography Utilities ───────────────────────────────── */
.font-display { font-family: var(--font-display); }
.font-body    { font-family: var(--font-body); }

.section-label {
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  font-family: var(--font-body);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--color-cyan);
}
.section-label::before,
.section-label::after {
  content: '';
  display: block;
  width: 2rem;
  height: 2px;
  background: var(--color-cyan);
  flex-shrink: 0;
}

.section-title {
  font-family: var(--font-display);
  font-size: clamp(2rem, 4vw, 3rem);
  font-weight: 700;
  color: var(--color-eclipse);
  line-height: 1.15;
}
.section-title.light { color: var(--color-white); }

/* ─── Buttons ────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 0.9375rem;
  line-height: 1;
  letter-spacing: 0.01em;
  padding: 0.875rem 2rem;
  border-radius: var(--radius-sm);
  border: 2px solid transparent;
  cursor: pointer;
  transition: var(--transition);
  text-decoration: none;
  white-space: nowrap;
}

.btn-primary {
  background: var(--color-lion);
  color: var(--color-white);
  border-color: var(--color-lion);
}
.btn-primary:hover {
  background: var(--color-lion-dark);
  border-color: var(--color-lion-dark);
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(206,42,33,0.35);
  color: var(--color-white);
}

.btn-secondary {
  background: var(--color-eclipse);
  color: var(--color-white);
  border-color: var(--color-eclipse);
}
.btn-secondary:hover {
  background: var(--color-lapis);
  border-color: var(--color-lapis);
  transform: translateY(-2px);
  color: var(--color-white);
}

.btn-outline {
  background: transparent;
  color: var(--color-white);
  border-color: var(--color-white);
}
.btn-outline:hover {
  background: var(--color-white);
  color: var(--color-eclipse);
}

.btn-outline-cyan {
  background: transparent;
  color: var(--color-cyan);
  border-color: var(--color-cyan);
}
.btn-outline-cyan:hover {
  background: var(--color-cyan);
  color: var(--color-white);
}

.btn-sm { padding: 0.625rem 1.25rem; font-size: 0.875rem; }
.btn-lg { padding: 1.125rem 2.5rem; font-size: 1.0625rem; }

/* ─── Cards ──────────────────────────────────────────────── */
.card {
  background: var(--color-white);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-card);
  transition: var(--transition);
  overflow: hidden;
}
.card:hover {
  box-shadow: var(--shadow-hover);
  transform: translateY(-4px);
}

.card-image {
  width: 100%;
  height: 220px;
  object-fit: cover;
  display: block;
}

/* Service card accent on hover */
.service-card {
  border-bottom: 3px solid transparent;
}
.service-card:hover {
  border-bottom-color: var(--color-cyan);
}

/* Project card overlay */
.project-card { position: relative; overflow: hidden; }
.project-card img {
  width: 100%;
  height: 280px;
  object-fit: cover;
  display: block;
  transition: transform 0.4s ease;
}
.project-card:hover img { transform: scale(1.05); }

.project-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(8,30,57,0.92) 0%, rgba(8,30,57,0.30) 60%, transparent 100%);
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 1.5rem;
  opacity: 0;
  transition: opacity 0.3s ease;
}
.project-card:hover .project-overlay { opacity: 1; }
.project-card .project-info {
  padding: 1rem 1.25rem 1.25rem;
  background: var(--color-white);
}

/* ─── Navbar ─────────────────────────────────────────────── */
.navbar-sticky {
  position: sticky;
  top: 0;
  z-index: 1000;
  transition: box-shadow 0.3s ease;
}
.navbar-sticky.scrolled {
  box-shadow: 0 4px 24px rgba(8,30,57,0.25);
}

.nav-link {
  position: relative;
  font-weight: 500;
  font-size: 0.9375rem;
  color: rgba(255,255,255,0.88);
  padding: 0.25rem 0;
  transition: color 0.2s;
}
.nav-link::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  width: 0;
  height: 2px;
  background: var(--color-cyan);
  transition: width 0.25s ease;
}
.nav-link:hover,
.nav-link.active { color: var(--color-white); }
.nav-link:hover::after,
.nav-link.active::after { width: 100%; }

/* Dropdown */
.dropdown-menu {
  position: absolute;
  top: calc(100% + 0.5rem);
  left: 0;
  min-width: 240px;
  background: var(--color-white);
  border-radius: var(--radius-md);
  box-shadow: 0 20px 60px rgba(8,30,57,0.20);
  border-top: 3px solid var(--color-cyan);
  opacity: 0;
  visibility: hidden;
  transform: translateY(-8px);
  transition: all 0.22s ease;
  z-index: 200;
}
.dropdown:hover .dropdown-menu,
.dropdown-menu:hover {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}
.dropdown-item {
  display: block;
  padding: 0.7rem 1.25rem;
  color: var(--color-eclipse);
  font-weight: 500;
  font-size: 0.9rem;
  border-bottom: 1px solid var(--color-gray-100);
  transition: background 0.15s;
}
.dropdown-item:hover {
  background: var(--color-pearls);
  color: var(--color-lapis);
  padding-left: 1.5rem;
}
.dropdown-item:last-child { border-bottom: none; }

/* ─── Hero ───────────────────────────────────────────────── */
.hero-section {
  position: relative;
  min-height: 100svh;
  display: flex;
  align-items: center;
  overflow: hidden;
}
.hero-bg {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
  z-index: 0;
  transform: scale(1.03);
  transition: transform 8s ease;
}
.hero-section:hover .hero-bg { transform: scale(1); }
.hero-overlay {
  position: absolute;
  inset: 0;
  z-index: 1;
}
.hero-content {
  position: relative;
  z-index: 2;
}

/* ─── Animated Counter ───────────────────────────────────── */
[data-counter] {
  display: inline-block;
  font-variant-numeric: tabular-nums;
  font-family: var(--font-display);
}

/* ─── Stats bar ──────────────────────────────────────────── */
.stats-bar {
  background: var(--color-lapis);
}
.stat-item {
  text-align: center;
  padding: 2.5rem 1rem;
  border-right: 1px solid rgba(255,255,255,0.15);
}
.stat-item:last-child { border-right: none; }
.stat-number {
  font-family: var(--font-display);
  font-size: 3rem;
  font-weight: 700;
  color: var(--color-white);
  line-height: 1;
}
.stat-label {
  font-size: 0.875rem;
  color: rgba(255,255,255,0.75);
  margin-top: 0.375rem;
  font-weight: 500;
  letter-spacing: 0.03em;
}

/* ─── Section Spacing ────────────────────────────────────── */
.section { padding: 5rem 0; }
.section-sm { padding: 3rem 0; }
.section-lg { padding: 7rem 0; }

/* ─── Badge / Pill ───────────────────────────────────────── */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 0.25rem 0.75rem;
  border-radius: 100px;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.badge-cyan  { background: rgba(0,172,238,0.15); color: var(--color-cyan); border: 1px solid rgba(0,172,238,0.3); }
.badge-lion  { background: rgba(206,42,33,0.12);  color: var(--color-lion); border: 1px solid rgba(206,42,33,0.25); }
.badge-lapis { background: rgba(0,71,143,0.12);   color: var(--color-lapis); border: 1px solid rgba(0,71,143,0.25); }
.badge-green { background: rgba(16,185,129,0.12); color: #059669; border: 1px solid rgba(16,185,129,0.25); }
.badge-gray  { background: rgba(107,114,128,0.1); color: #6b7280; border: 1px solid rgba(107,114,128,0.2); }

/* ─── Forms ──────────────────────────────────────────────── */
.form-label {
  display: block;
  font-weight: 600;
  font-size: 0.875rem;
  color: var(--color-eclipse);
  margin-bottom: 0.375rem;
}
.form-input,
.form-select,
.form-textarea {
  width: 100%;
  padding: 0.75rem 1rem;
  border: 1.5px solid #d1d5db;
  border-radius: var(--radius-sm);
  font-family: var(--font-body);
  font-size: 0.9375rem;
  color: var(--color-gray-900);
  background: var(--color-white);
  transition: border-color 0.2s, box-shadow 0.2s;
  outline: none;
}
.form-input:focus,
.form-select:focus,
.form-textarea:focus {
  border-color: var(--color-cyan);
  box-shadow: 0 0 0 3px rgba(0,172,238,0.12);
}
.form-textarea { resize: vertical; min-height: 120px; }

/* ─── Estimate Wizard ────────────────────────────────────── */
.wizard-step { display: none; }
.wizard-step.active { display: block; }

.step-indicator {
  display: flex;
  align-items: center;
  gap: 0;
  margin-bottom: 2.5rem;
}
.step-dot {
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.875rem;
  transition: var(--transition);
  flex-shrink: 0;
  border: 2px solid transparent;
}
.step-dot.pending   { background: #e5e7eb; color: #6b7280; }
.step-dot.active    { background: var(--color-cyan); color: white; border-color: var(--color-cyan); box-shadow: 0 0 0 4px rgba(0,172,238,0.2); }
.step-dot.completed { background: var(--color-lapis); color: white; }
.step-line {
  flex: 1;
  height: 2px;
  background: #e5e7eb;
  transition: background 0.3s;
}
.step-line.completed { background: var(--color-lapis); }

/* ─── FAQ Accordion ──────────────────────────────────────── */
.faq-item { border-bottom: 1px solid #e5e7eb; }
.faq-question {
  width: 100%;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.25rem 0;
  font-weight: 600;
  font-size: 1rem;
  color: var(--color-eclipse);
  cursor: pointer;
  background: none;
  border: none;
  text-align: left;
  gap: 1rem;
}
.faq-question:hover { color: var(--color-lapis); }
.faq-icon {
  width: 1.5rem;
  height: 1.5rem;
  flex-shrink: 0;
  color: var(--color-cyan);
  transition: transform 0.25s ease;
}
.faq-item.open .faq-icon { transform: rotate(45deg); }
.faq-answer {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.35s ease, padding 0.25s ease;
}
.faq-item.open .faq-answer { max-height: 600px; }
.faq-answer-inner {
  padding: 0 0 1.25rem;
  color: var(--color-gray-600);
  line-height: 1.75;
}

/* ─── Lightbox ───────────────────────────────────────────── */
#lightbox {
  position: fixed;
  inset: 0;
  background: rgba(8,30,57,0.96);
  z-index: 9999;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 2rem;
}
#lightbox.active { display: flex; }
#lightbox img {
  max-width: 90vw;
  max-height: 85vh;
  object-fit: contain;
  border-radius: var(--radius-md);
  box-shadow: 0 40px 80px rgba(0,0,0,0.5);
}
.lightbox-close {
  position: absolute;
  top: 1.5rem;
  right: 1.5rem;
  color: white;
  cursor: pointer;
  background: rgba(255,255,255,0.1);
  border: none;
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s;
}
.lightbox-close:hover { background: var(--color-lion); }
.lightbox-prev,
.lightbox-next {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(255,255,255,0.1);
  border: none;
  color: white;
  cursor: pointer;
  width: 3rem;
  height: 3rem;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s;
}
.lightbox-prev:hover,
.lightbox-next:hover { background: var(--color-cyan); }
.lightbox-prev { left: 1.5rem; }
.lightbox-next { right: 1.5rem; }
.lightbox-counter {
  position: absolute;
  bottom: 1.5rem;
  left: 50%;
  transform: translateX(-50%);
  color: rgba(255,255,255,0.7);
  font-size: 0.875rem;
}

/* ─── Portfolio Filter ───────────────────────────────────── */
.filter-bar {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  align-items: center;
}
.filter-btn {
  padding: 0.5rem 1.25rem;
  border-radius: 100px;
  font-size: 0.875rem;
  font-weight: 600;
  border: 1.5px solid #d1d5db;
  background: white;
  color: var(--color-eclipse);
  cursor: pointer;
  transition: var(--transition);
}
.filter-btn:hover { border-color: var(--color-cyan); color: var(--color-cyan); }
.filter-btn.active {
  background: var(--color-cyan);
  border-color: var(--color-cyan);
  color: white;
}
.filter-btn[data-filter="type-commercial"].active {
  background: var(--color-lapis);
  border-color: var(--color-lapis);
}

/* ─── Project Card (portfolio) ───────────────────────────── */
.portfolio-item { transition: var(--transition); }
.portfolio-item.hidden {
  display: none;
}

/* ─── Featured ribbon ────────────────────────────────────── */
.ribbon {
  position: absolute;
  top: 0.75rem;
  left: -0.25rem;
  background: var(--color-lion);
  color: white;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 0.25rem 0.75rem;
  z-index: 10;
}
.ribbon::after {
  content: '';
  position: absolute;
  bottom: -6px;
  left: 0;
  border-top: 6px solid var(--color-lion-dark);
  border-left: 6px solid transparent;
}

/* ─── Process Timeline ───────────────────────────────────── */
.process-line {
  position: absolute;
  top: 1.25rem;
  left: 50%;
  transform: translateX(-50%);
  width: calc(100% - 2rem);
  height: 2px;
  background: rgba(255,255,255,0.15);
  z-index: 0;
}
.process-step-num {
  width: 3rem;
  height: 3rem;
  border-radius: 50%;
  background: var(--color-cyan);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 1.125rem;
  font-family: var(--font-display);
  flex-shrink: 0;
  position: relative;
  z-index: 1;
  box-shadow: 0 0 0 4px rgba(0,172,238,0.25);
}

/* ─── Testimonial card ───────────────────────────────────── */
.testimonial-card {
  background: white;
  border-radius: var(--radius-lg);
  padding: 2rem;
  box-shadow: var(--shadow-card);
  transition: var(--transition);
  position: relative;
}
.testimonial-card:hover {
  box-shadow: var(--shadow-hover);
  transform: translateY(-4px);
}
.testimonial-card .quote-mark {
  font-family: var(--font-display);
  font-size: 5rem;
  line-height: 1;
  color: var(--color-pearls);
  position: absolute;
  top: 1rem;
  left: 1.5rem;
  pointer-events: none;
  user-select: none;
}
.star { color: #f59e0b; }

/* ─── Scroll Reveal ──────────────────────────────────────── */
.reveal {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.7s ease, transform 0.7s ease;
}
.reveal.revealed {
  opacity: 1;
  transform: translateY(0);
}
.reveal-delay-1 { transition-delay: 0.1s; }
.reveal-delay-2 { transition-delay: 0.2s; }
.reveal-delay-3 { transition-delay: 0.3s; }
.reveal-delay-4 { transition-delay: 0.4s; }

/* ─── Back to top ────────────────────────────────────────── */
#back-to-top {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  width: 3rem;
  height: 3rem;
  background: var(--color-eclipse);
  color: white;
  border: none;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 16px rgba(8,30,57,0.3);
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 0.3s, transform 0.3s, background 0.2s;
  z-index: 900;
}
#back-to-top.visible { opacity: 1; transform: translateY(0); }
#back-to-top:hover { background: var(--color-cyan); }

/* ─── Flash Messages ─────────────────────────────────────── */
.flash-message {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  padding: 1rem 1.25rem;
  border-radius: var(--radius-md);
  margin-bottom: 1.5rem;
  font-weight: 500;
}
.flash-success { background: #ecfdf5; color: #065f46; border: 1px solid #a7f3d0; }
.flash-error   { background: #fef2f2; color: #991b1b; border: 1px solid #fca5a5; }
.flash-close {
  margin-left: auto;
  background: none;
  border: none;
  cursor: pointer;
  color: inherit;
  opacity: 0.6;
  padding: 0;
  line-height: 1;
  flex-shrink: 0;
}
.flash-close:hover { opacity: 1; }

/* ─── Admin Panel ────────────────────────────────────────── */
.admin-sidebar {
  position: fixed;
  top: 0;
  left: 0;
  height: 100vh;
  width: 260px;
  background: var(--color-eclipse);
  display: flex;
  flex-direction: column;
  z-index: 500;
  transition: transform 0.3s ease;
  overflow-y: auto;
}
.admin-sidebar.hidden-mobile {
  transform: translateX(-100%);
}
.admin-content {
  margin-left: 260px;
  min-height: 100vh;
  background: #f8fafc;
  transition: margin-left 0.3s ease;
}
@media (max-width: 1024px) {
  .admin-sidebar { transform: translateX(-100%); }
  .admin-sidebar.open { transform: translateX(0); }
  .admin-content { margin-left: 0; }
}

.admin-nav-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 1.25rem;
  color: rgba(255,255,255,0.75);
  font-weight: 500;
  font-size: 0.9rem;
  border-radius: var(--radius-sm);
  margin: 0.125rem 0.75rem;
  transition: all 0.2s;
  text-decoration: none;
}
.admin-nav-item:hover { background: rgba(0,71,143,0.4); color: white; }
.admin-nav-item.active { background: var(--color-lapis); color: white; }

.admin-topbar {
  background: white;
  border-bottom: 1px solid #e5e7eb;
  padding: 0.875rem 1.5rem;
  display: flex;
  align-items: center;
  gap: 1rem;
  position: sticky;
  top: 0;
  z-index: 100;
}

.admin-card {
  background: white;
  border-radius: var(--radius-md);
  box-shadow: 0 1px 8px rgba(0,0,0,0.07);
  padding: 1.5rem;
  margin-bottom: 1.5rem;
}

.admin-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}
.admin-table th {
  background: var(--color-pearls);
  color: var(--color-eclipse);
  font-weight: 700;
  font-size: 0.8rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  padding: 0.75rem 1rem;
  text-align: left;
  border-bottom: 2px solid #e5e7eb;
}
.admin-table td {
  padding: 0.875rem 1rem;
  border-bottom: 1px solid #f3f4f6;
  color: #374151;
  vertical-align: middle;
}
.admin-table tr:hover td { background: #fafbff; }
.admin-table tr:last-child td { border-bottom: none; }

/* ─── Responsive Helpers ─────────────────────────────────── */
@media (max-width: 768px) {
  .section { padding: 3.5rem 0; }
  .section-lg { padding: 4rem 0; }
  .stat-number { font-size: 2.25rem; }
  .process-line { display: none; }
}

/* ─── Animations ─────────────────────────────────────────── */
@keyframes float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-8px); }
}
@keyframes pulse-dot {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.4; }
}
@keyframes slide-down {
  from { opacity: 0; transform: translateY(-10px); }
  to   { opacity: 1; transform: translateY(0); }
}

.anim-float  { animation: float 3s ease-in-out infinite; }
.anim-fadein { animation: slide-down 0.4s ease both; }

/* ─── Print ──────────────────────────────────────────────── */
@media print {
  .navbar-sticky, footer, #back-to-top { display: none !important; }
  body { font-size: 12pt; }
}
