/* ============================================
   SOLIDFRAME WEB - GLOBAL STYLESHEET
   Premium Agency Design for Multi-Page Website
   ============================================ */

/* Base Reset & Smooth Scroll */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: 80px;
}

body {
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* ============================================
   CUSTOM UTILITIES (complement Tailwind)
   ============================================ */

/* Glass Morphism Effects */
.glass-light {
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(255, 255, 255, 0.25);
}

.glass-dark {
  background: rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.12);
}

/* Gradient Text */
.text-gradient {
  background: linear-gradient(135deg, #60a5fa, #38bdf8);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* ============================================
   BUTTONS
   ============================================ */

.btn-primary {
  background: linear-gradient(135deg, #3b82f6, #2563eb);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  overflow: hidden;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.btn-primary::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, #60a5fa, #3b82f6);
  opacity: 0;
  transition: opacity 0.3s;
}

.btn-primary:hover::after {
  opacity: 1;
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 35px rgba(59, 130, 246, 0.45);
}

.btn-primary > * {
  position: relative;
  z-index: 1;
}

.btn-outline {
  border: 1.5px solid rgba(255, 255, 255, 0.3);
  transition: all 0.3s ease;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.btn-outline:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.55);
  transform: translateY(-2px);
}

/* ============================================
   CARDS
   ============================================ */

.card-hover {
  transition: all 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}

.card-hover:hover {
  transform: translateY(-6px);
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.08);
}

/* ============================================
   DROPDOWN MENU (Desktop)
   ============================================ */

.dropdown {
  position: relative;
}

.dropdown-menu {
  position: absolute;
  top: calc(100% + 8px);
  left: 50%;
  transform: translateX(-50%) translateY(8px);
  opacity: 0;
  visibility: hidden;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  z-index: 50;
  min-width: 280px;
  background: white;
  border-radius: 16px;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.15);
  border: 1px solid rgba(0, 0, 0, 0.08);
  padding: 8px;
}

.dropdown:hover .dropdown-menu,
.dropdown-menu:focus-within {
  opacity: 1;
  visibility: visible;
  transform: translateX(-50%) translateY(0);
}

/* ============================================
   MOBILE DROPDOWN (Accordion)
   ============================================ */

.mobile-dropdown-content {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.35s cubic-bezier(0.4, 0, 0.2, 1), padding 0.3s ease;
}

.mobile-dropdown.active .mobile-dropdown-content {
  max-height: 500px;
  padding: 12px 0;
}

.mobile-dropdown-toggle::after {
  content: '+';
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.1);
  font-size: 14px;
  font-weight: 300;
  transition: transform 0.3s ease;
  margin-left: auto;
}

.mobile-dropdown.active .mobile-dropdown-toggle::after {
  content: '−';
  transform: rotate(0);
}

/* ============================================
   FAQ ACCORDION – ROBUST FIX
   ============================================ */
.faq-item {
  border-bottom: 1px solid #e2e8f0;
}

.faq-content {
  display: grid;
  grid-template-rows: 0fr;
  transition: grid-template-rows 0.35s cubic-bezier(0.4, 0, 0.2, 1);
  overflow: hidden;
  padding: 0 !important;
}

.faq-item.active .faq-content {
  grid-template-rows: 1fr;
  padding-top: 12px !important;
  padding-bottom: 4px !important;
}

.faq-content > div {
  min-height: 0;
  overflow: hidden;
}

.faq-toggle {
  transition: transform 0.3s ease;
  user-select: none;
  flex-shrink: 0;
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: #eff6ff;
  border-radius: 9999px;
  color: #2563eb;
  font-size: 18px;
  font-weight: 300;
}

.faq-item.active .faq-toggle {
  transform: rotate(45deg);
  background-color: #dbeafe;
}

/* ============================================
   BLOG READ MORE
   ============================================ */

.blog-full-content {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.4s ease-out, margin 0.3s ease;
}

.blog-card.expanded .blog-full-content {
  max-height: 500px;
  margin-top: 1rem;
}

/* ============================================
   MARQUEE ANIMATION (Trusted By)
   ============================================ */

.marquee-container {
  overflow: hidden;
  position: relative;
}

.marquee-content {
  display: flex;
  animation: marquee 22s linear infinite;
  width: max-content;
}

.marquee-container:hover .marquee-content {
  animation-play-state: paused;
}

@keyframes marquee {
  0% { transform: translateX(0); }
  100% { transform: translateX(-50%); }
}

/* ============================================
   ANIMATIONS
   ============================================ */

.anim-up {
  animation: fadeUp 0.7s ease-out both;
}

.anim-fade {
  animation: fadeIn 0.5s ease-out both;
}

@keyframes fadeUp {
  0% { opacity: 0; transform: translateY(24px); }
  100% { opacity: 1; transform: translateY(0); }
}

@keyframes fadeIn {
  0% { opacity: 0; }
  100% { opacity: 1; }
}

/* Reveal on scroll (used with Intersection Observer) */
.reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: all 0.7s cubic-bezier(0.16, 1, 0.3, 1);
}

.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}

/* ============================================
   NAVBAR SCROLL STATE
   ============================================ */

.navbar-scrolled {
  background: rgba(15, 23, 42, 0.96) !important;
  backdrop-filter: blur(20px) !important;
  -webkit-backdrop-filter: blur(20px) !important;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08) !important;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
}

/* ============================================
   BACK TO TOP BUTTON
   ============================================ */

#backToTop {
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  opacity: 0;
  transform: translateY(16px);
  pointer-events: none;
}

#backToTop.visible {
  opacity: 1 !important;
  transform: translateY(0) !important;
  pointer-events: auto !important;
}

/* ============================================
   HERO SECTION SPECIFIC
   ============================================ */

.hero-section {
  position: relative;
  min-height: 100vh;
  display: flex;
  align-items: center;
  overflow: hidden;
  background: #0f172a;
  padding-top: 72px;
}

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

.hero-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(15,23,42,0.92) 0%, rgba(30,58,138,0.75) 45%, rgba(30,58,138,0.65) 70%, rgba(15,23,42,0.88) 100%);
  z-index: 1;
}
/* ============================================
   HOMEPAGE HERO BACKGROUND IMAGE (only index.html)
   ============================================ */
#home .hero-bg {
  background-image: url('assets/frame.jpg');
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
}

/* ============================================
   FORM FOCUS STATES
   ============================================ */

input:focus,
select:focus,
textarea:focus {
  outline: none;
  border-color: #3b82f6;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15);
}

/* ============================================
   MOBILE MENU OVERLAY
   ============================================ */

#mobileMenu {
  transition: transform 0.4s ease-out;
}

/* ============================================
   RESPONSIVE ADJUSTMENTS
   ============================================ */

@media (min-width: 1024px) {
  .hero-section {
    padding-top: 0;
  }
}

@media (max-width: 1023px) {
  .hero-section {
    min-height: auto;
    padding-top: 88px;
    padding-bottom: 48px;
  }
  
  .hero-grid {
    grid-template-columns: 1fr !important;
    gap: 32px !important;
  }
  
  .hero-form-container {
    max-width: 100% !important;
    margin: 0 auto !important;
  }
}

@media (max-width: 639px) {
  .text-gradient {
    -webkit-text-fill-color: initial;
    background: none;
    color: #3b82f6;
  }
  
  .btn-primary,
  .btn-outline {
    width: 100%;
    justify-content: center;
  }
}

/* ============================================
   ADDITIONAL ENHANCEMENTS
   ============================================ */

/* Smooth transitions for interactive elements */
a, button {
  transition: all 0.2s ease;
}

/* Custom scrollbar (optional) */
::-webkit-scrollbar {
  width: 8px;
}

::-webkit-scrollbar-track {
  background: #f1f5f9;
}

::-webkit-scrollbar-thumb {
  background: #94a3b8;
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: #64748b;
}

/* Fix for mobile menu body overflow */
body.menu-open {
  overflow: hidden;
}

/* Blog card image container consistent height */
.blog-card .h-48 {
  height: 12rem;
}

/* Pricing card popular badge positioning */
.pricing-popular-badge {
  position: absolute;
  top: -12px;
  left: 50%;
  transform: translateX(-50%);
  background: #3b82f6;
  color: white;
  padding: 4px 16px;
  border-radius: 9999px;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  box-shadow: 0 4px 6px rgba(0,0,0,0.1);
}

/* Ensure images have proper alt fallback but look clean */
img {
  max-width: 100%;
  height: auto;
}

/* Contact form success message */
#formSuccess,
#formDone {
  transition: opacity 0.3s;
}

/* Dropdown menu item hover */
.dropdown-menu a:hover {
  background-color: #eff6ff;
}

/* Footer link hover */
footer a:hover {
  color: #60a5fa;
}


/* ============================================
   BLOG READ MORE (improved)
   ============================================ */
.blog-full-content {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.4s ease-out;
  margin: 0;
}

.blog-card.expanded .blog-full-content {
  /* max-height set dynamically via JS */
  margin-top: 1rem;
  margin-bottom: 0.5rem;
}

/* FAQ Accordion – fully expandable */
.faq-content {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  padding: 0 !important;
}

.faq-item.active .faq-content {
  /* max-height is set dynamically via JS to scrollHeight */
  padding-top: 12px !important;
  padding-bottom: 4px !important;
}

.faq-toggle {
  transition: transform 0.3s ease;
  user-select: none;
  flex-shrink: 0;
}

.faq-item.active .faq-toggle {
  transform: rotate(45deg);
}

/* About section image */
.about-image {
  transition: transform 0.3s ease;
}

.about-image:hover {
  transform: scale(1.02);
}

/* ============================================
   HOMEPAGE ABOUT SECTION – POLISHED LAYOUT
   ============================================ */

/* Ensure the image container keeps its aspect ratio and the image covers properly */
#about .aspect-\[4\/3\] {
  position: relative;
  width: 100%;
}

#about .aspect-\[4\/3\] img {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.4s ease;
}

/* Subtle zoom on hover – optional but adds a premium feel */
#about .aspect-\[4\/3\]:hover img {
  transform: scale(1.02);
}

/* Floating badge – keep it anchored and readable */
#about .absolute.-bottom-4 {
  bottom: -1rem;
  right: 1.25rem;
}

/* Make the badge slightly responsive */
@media (max-width: 640px) {
  #about .absolute.-bottom-4 {
    right: 0.5rem;
    bottom: -0.5rem;
  }
  #about .max-w-xs {
    max-width: 180px;
  }
}

/* Improve spacing between text and image on mobile */
@media (max-width: 1023px) {
  #about .grid {
    gap: 2rem;
  }
  #about .order-2 {
    margin-top: 0;
  }
}

/* Ensure the "Learn More About Us" button stays inline and centered on small screens if needed */
#about .btn-primary {
  white-space: nowrap;
}
@media (max-width: 480px) {
  #about .btn-primary {
    white-space: normal;
    text-align: center;
  }
}

/* Optional: add a soft glow to the image shadow for depth */
#about .shadow-lg {
  box-shadow: 0 20px 30px -10px rgba(0, 0, 0, 0.1);
}

.faq-content {
  display: grid;
  grid-template-rows: 0fr;
  transition: grid-template-rows 0.35s ease-out;
  overflow: hidden;
}
.faq-item.active .faq-content {
  grid-template-rows: 1fr;
  padding-top: 8px;
}
.faq-toggle {
  transition: transform 0.2s;
}
.faq-item.active .faq-toggle {
  transform: rotate(45deg);
}
/* ============================================
   TOP INFO BAR – FIXED & VISIBLE
   ============================================ */

/* Make the top bar fixed so it doesn't scroll away */
.bg-brand-950.text-white\/75 {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 51; /* above nav which is z-50 */
}

/* Push the navigation bar down by the height of the top bar (only on desktop) */
@media (min-width: 768px) {
  #nav {
    top: 36px; /* height of top bar (py-2.5 = 10px × 2 + text line-height ≈ 36px) */
  }
  
  /* Adjust mobile menu overlay to account for top bar */
  #mobileMenu {
    padding-top: 36px;
  }
  
  /* Smooth scroll padding to account for both bars */
  html {
    scroll-padding-top: 116px; /* top bar + nav height */
  }
}

/* On mobile, the top bar is hidden, so reset nav top position */
@media (max-width: 767px) {
  #nav {
    top: 0;
  }
  #mobileMenu {
    padding-top: 0;
  }
  html {
    scroll-padding-top: 80px;
  }
}

/* ============================================
   INDEX PAGE ONLY – Polished Tweaks & Fixes
   ============================================ */

/* ---------- HERO SECTION ---------- */
/* Ensure hero content never overflows on small screens */
#home .hero-grid {
  align-items: start;
}
#home .hero-form-container {
  margin-top: 0;
}

/* Slightly tighter hero padding on very small devices */
@media (max-width: 480px) {
  #home.hero-section {
    padding-top: 80px;
    padding-bottom: 40px;
  }
  #home .hero-grid {
    gap: 24px !important;
  }
}

/* ---------- ABOUT IMAGE FIX ---------- */
/* Already good, but ensure the badge doesn’t overlap text on mobile */
@media (max-width: 640px) {
  #about .absolute.-bottom-4 {
    bottom: 0;
    right: 0.5rem;
  }
  #about .max-w-xs {
    max-width: 160px;
  }
}

/* ---------- MARQUEE SPACING ---------- */
.marquee-container {
  padding-top: 8px;
  padding-bottom: 8px;
}

/* ---------- SERVICES CARDS CONSISTENCY ---------- */
/* Ensure all service cards have the same height on large screens */
@media (min-width: 1024px) {
  #services .grid > div {
    min-height: 280px;
  }
}

/* ---------- FORM FIELDS (quote form on homepage) ---------- */
#quoteForm input,
#quoteForm select,
#quoteForm textarea {
  transition: all 0.2s ease;
}
#quoteForm input:hover,
#quoteForm select:hover,
#quoteForm textarea:hover {
  border-color: #93c5fd;
}

/* ---------- CTA SECTION SPACING ---------- */
#contact {
  padding-top: 5rem;
  padding-bottom: 5rem;
}
@media (max-width: 639px) {
  #contact {
    padding-top: 3rem;
    padding-bottom: 3rem;
  }
}

/* ---------- BLOG CARDS (index page only) ---------- */
#blog .blog-card img {
  transition: transform 0.4s ease;
}
#blog .blog-card:hover img {
  transform: scale(1.03);
}

/* ---------- BACK TO TOP BUTTON VISIBILITY ---------- */
#backToTop {
  z-index: 999;
}

/* ---------- FIX MOBILE MENU Z-INDEX ---------- */
#mobileMenu {
  z-index: 1000;
}

/* ---------- SMOOTH FOCUS RING FOR ALL INTERACTIVE ELEMENTS ---------- */
a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: 2px solid #3b82f6;
  outline-offset: 2px;
}

/* ---------- HOMEPAGE SPECIFIC HERO BACKGROUND FALLBACK ---------- */
#home .hero-bg {
  background-color: #0f172a; /* fallback if image is missing */
}

/* ---------- NEWSLETTER FORM BUTTON ALIGNMENT ---------- */
footer form button {
  flex-shrink: 0;
}

/* ============================================
   CONTACT PAGE SPECIFIC STYLES
   ============================================ */

/* Hero overlay customisation */
.contact-hero .hero-overlay {
  background: linear-gradient(135deg, rgba(15,23,42,0.92) 0%, rgba(30,58,138,0.75) 70%);
}

/* Map container – responsive height */
.map-container {
  height: 400px;
  border-radius: 1.5rem;
  overflow: hidden;
  box-shadow: 0 10px 30px rgba(0,0,0,0.08);
}

@media (max-width: 640px) {
  .map-container {
    height: 280px;
  }
}

/* Make the contact form success message stand out */
#formSuccess {
  transition: opacity 0.3s ease;
  border-radius: 1rem;
  padding: 1.5rem;
}

/* Instagram button hover */
.instagram-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(168,85,247,0.3);
}

/* Smooth focus for all contact inputs (already in global but reinforce) */
input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: #3b82f6 !important;
  box-shadow: 0 0 0 3px rgba(59,130,246,0.15);
}

/* Fix for mobile menu z-index override */
#mobileMenu {
  z-index: 1000;
}
/* ========== Contact Page Enhancements ========== */

/* Form card */
#quote {
  transition: box-shadow 0.3s ease;
}

/* Input, select, textarea – subtle glow on hover */
input:hover, select:hover, textarea:hover {
  border-color: #93c5fd;
}

/* Submit button extra hover effect */
.btn-primary:active {
  transform: scale(0.98);
}

/* Green success pop‑up */
#formSuccess {
  animation: fadeIn 0.3s ease;
}

/* Map container */
.map-container {
  border-radius: 1.5rem;
  overflow: hidden;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.08);
  height: 400px;
}
@media (max-width: 640px) {
  .map-container {
    height: 280px;
    border-radius: 1rem;
  }
}

/* "Prefer to Talk Now" & "Why Contact Us" cards */
.bg-white.p-8.rounded-3xl.shadow-sm {
  transition: box-shadow 0.3s ease;
}
.bg-white.p-8.rounded-3xl.shadow-sm:hover {
  box-shadow: 0 20px 35px rgba(0,0,0,0.06);
}

/* Why Contact Us gradient card */
.bg-gradient-to-br.from-brand-50.to-white {
  transition: box-shadow 0.3s ease;
}
.bg-gradient-to-br.from-brand-50.to-white:hover {
  box-shadow: 0 15px 30px rgba(59,130,246,0.08);
}

/* Final CTA section */
.bg-gradient-to-br.from-brand-600.to-brand-800 .btn-primary {
  transition: all 0.3s ease;
}
.bg-gradient-to-br.from-brand-600.to-brand-800 .btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 25px rgba(255,255,255,0.2);
}

/* Reset any default select appearance for browsers */
select {
  -webkit-appearance: none;
  -moz-appearance: none;
  background-image: url("data:image/svg+xml;utf8,<svg fill='%2394a3b8' viewBox='0 0 20 20' xmlns='http://www.w3.org/2000/svg'><path fill-rule='evenodd' d='M5.293 7.293a1 1 0 011.414 0L10 10.586l3.293-3.293a1 1 0 111.414 1.414l-4 4a1 1 0 01-1.414 0l-4-4a1 1 0 010-1.414z' clip-rule='evenodd'/></svg>");
  background-repeat: no-repeat;
  background-position: right 1rem center;
  background-size: 1.2em;
  padding-right: 2.5rem;
}

/* Map label text */
.text-center.text-surface-400.text-xs.mt-3 {
  margin-top: 0.75rem;
}
