/* ============================================
   VISION - International Construction Co.
   PREMIUM ANIMATIONS, INTERACTIONS & CARDS
   ============================================ */

@import url('https://fonts.googleapis.com/css2?family=DM+Sans:wght@400;500;700&family=Bebas+Neue&display=swap');
@import 'tailwindcss';
@import 'tw-animate-css';
@import 'shadcn/tailwind.css';

@custom-variant dark (&:is(.dark *));

:root {
  --background: oklch(1 0 0);
  --foreground: oklch(0.145 0 0);
  --card: oklch(1 0 0);
  --card-foreground: oklch(0.145 0 0);
  --popover: oklch(1 0 0);
  --popover-foreground: oklch(0.145 0 0);
  --primary: oklch(0.205 0 0);
  --primary-foreground: oklch(0.985 0 0);
  --secondary: oklch(0.97 0 0);
  --secondary-foreground: oklch(0.205 0 0);
  --muted: oklch(0.97 0 0);
  --muted-foreground: oklch(0.556 0 0);
  --accent: oklch(0.97 0 0);
  --accent-foreground: oklch(0.205 0 0);
  --destructive: oklch(0.577 0.245 27.325);
  --destructive-foreground: oklch(0.577 0.245 27.325);
  --border: oklch(0.922 0 0);
  --input: oklch(0.922 0 0);
  --ring: oklch(0.708 0 0);
  --chart-1: oklch(0.646 0.222 41.116);
  --chart-2: oklch(0.6 0.118 184.704);
  --chart-3: oklch(0.398 0.07 227.392);
  --chart-4: oklch(0.828 0.189 84.429);
  --chart-5: oklch(0.769 0.188 70.08);
  --radius: 0.625rem;
  --sidebar: oklch(0.985 0 0);
  --sidebar-foreground: oklch(0.145 0 0);
  --sidebar-primary: oklch(0.205 0 0);
  --sidebar-primary-foreground: oklch(0.985 0 0);
  --sidebar-accent: oklch(0.97 0 0);
  --sidebar-accent-foreground: oklch(0.205 0 0);
  --sidebar-border: oklch(0.922 0 0);
  --sidebar-ring: oklch(0.708 0 0);

  /* Brand Identity (Custom) */
  --primary: #FF1817;        
  --primary-dark: #C20100;
  --dark: #111111;           
  --light: #FFFFFF;
  
  /* Fonts */
  --font-h: 'Bebas Neue', sans-serif;
  --font-b: 'DM Sans', sans-serif;

  /* Theme: Light Mode */
  --bg: #FFFFFF;
  --bg-alt: #F8F8F8;
  --text: #111111;
  --text-alt: #555555;
  --border: #DDDDDD;
  --card: #FFFFFF;
  --header-bg: rgba(255, 255, 255, 0.05);
  --transition: all 0.4s cubic-bezier(0.165, 0.84, 0.44, 1);
}

.dark {
  --background: oklch(0.145 0 0);
  --foreground: oklch(0.985 0 0);
  --card: oklch(0.145 0 0);
  --card-foreground: oklch(0.985 0 0);
  --popover: oklch(0.145 0 0);
  --popover-foreground: oklch(0.985 0 0);
  --primary: oklch(0.985 0 0);
  --primary-foreground: oklch(0.205 0 0);
  --secondary: oklch(0.269 0 0);
  --secondary-foreground: oklch(0.985 0 0);
  --muted: oklch(0.269 0 0);
  --muted-foreground: oklch(0.708 0 0);
  --accent: oklch(0.269 0 0);
  --accent-foreground: oklch(0.985 0 0);
  --destructive: oklch(0.396 0.141 25.723);
  --destructive-foreground: oklch(0.637 0.237 25.331);
  --border: oklch(0.269 0 0);
  --input: oklch(0.269 0 0);
  --ring: oklch(0.439 0 0);
  --chart-1: oklch(0.488 0.243 264.376);
  --chart-2: oklch(0.696 0.17 162.48);
  --chart-3: oklch(0.769 0.188 70.08);
  --chart-4: oklch(0.627 0.265 303.9);
  --chart-5: oklch(0.645 0.246 16.439);
  --sidebar: oklch(0.205 0 0);
  --sidebar-foreground: oklch(0.985 0 0);
  --sidebar-primary: oklch(0.488 0.243 264.376);
  --sidebar-primary-foreground: oklch(0.985 0 0);
  --sidebar-accent: oklch(0.269 0 0);
  --sidebar-accent-foreground: oklch(0.985 0 0);
  --sidebar-border: oklch(0.269 0 0);
  --sidebar-ring: oklch(0.439 0 0);
}

/* Theme: Dark Mode Overrides (Custom) */
[data-theme="dark"] {
  --bg: #0D0D0D;
  --bg-alt: #161616;
  --text: #FFFFFF;
  --text-alt: #AAAAAA;
  --border: #262626;
  --card: #161616;
  --header-bg: rgba(0, 0, 0, 0.25);
}

@theme inline {
  --font-sans: 'Geist', 'Geist Fallback';
  --font-mono: 'Geist Mono', 'Geist Mono Fallback';
  --color-background: var(--background);
  --color-foreground: var(--foreground);
  --color-card: var(--card);
  --color-card-foreground: var(--card-foreground);
  --color-popover: var(--popover);
  --color-popover-foreground: var(--popover-foreground);
  --color-primary: var(--primary);
  --color-primary-foreground: var(--primary-foreground);
  --color-secondary: var(--secondary);
  --color-secondary-foreground: var(--secondary-foreground);
  --color-muted: var(--muted);
  --color-muted-foreground: var(--muted-foreground);
  --color-accent: var(--accent);
  --color-accent-foreground: var(--accent-foreground);
  --color-destructive: var(--destructive);
  --color-destructive-foreground: var(--destructive-foreground);
  --color-border: var(--border);
  --color-input: var(--input);
  --color-ring: var(--ring);
  --color-chart-1: var(--chart-1);
  --color-chart-2: var(--chart-2);
  --color-chart-3: var(--chart-3);
  --color-chart-4: var(--chart-4);
  --color-chart-5: var(--chart-5);
  --radius-sm: calc(var(--radius) - 4px);
  --radius-md: calc(var(--radius) - 2px);
  --radius-lg: var(--radius);
  --radius-xl: calc(var(--radius) + 4px);
  --color-sidebar: var(--sidebar);
  --color-sidebar-foreground: var(--sidebar-foreground);
  --color-sidebar-primary: var(--sidebar-primary);
  --color-sidebar-primary-foreground: var(--sidebar-primary-foreground);
  --color-sidebar-accent: var(--sidebar-accent);
  --color-sidebar-accent-foreground: var(--sidebar-accent-foreground);
  --color-sidebar-border: var(--sidebar-border);
  --color-sidebar-ring: var(--sidebar-ring);
}

@layer base {
  * {
    @apply border-border outline-ring/50;
  }
  body {
    @apply bg-background text-foreground;
  }
}

/* ============================================
   Base Styles & Reset
   ============================================ */
* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { 
  font-family: var(--font-b); 
  background: var(--bg); 
  color: var(--text); 
  line-height: 1.6; 
  transition: background 0.5s ease;
  overflow-x: hidden;
}
a { text-decoration: none; color: inherit; transition: var(--transition); }
ul { list-style: none; }
img { max-width: 100%; display: block; }

h1, h2, h3, h4, .btn, .brand-name, nav a { 
  font-family: var(--font-h); 
  text-transform: uppercase; 
  letter-spacing: 1px; 
}
h1 { font-size: clamp(3.5rem, 8vw, 6rem); line-height: 0.9; margin-bottom: 1rem; }
h2 { font-size: clamp(2.5rem, 5vw, 3.5rem); border-left: 10px solid var(--primary); padding-left: 20px; margin-bottom: 2.5rem; }

.section-title { border-left: 5px solid var(--primary); padding-left: 15px; }
.text-center { text-align: center; }

.section-header {
  text-align: center;
  margin-bottom: 4rem;
  animation: slideInDown 0.8s ease-out;
}

.section-header h2 {
  border: none;
  padding: 0;
  display: inline-block;
  position: relative;
  margin-bottom: 1rem;
}

.section-header h2::after {
  content: '';
  position: absolute;
  bottom: -10px;
  left: 50%;
  transform: translateX(-50%);
  width: 80px;
  height: 4px;
  background: var(--primary);
  border-radius: 2px;
}

.section-header p {
  font-size: 1.1rem;
  color: var(--text-alt);
  margin-top: 1.5rem;
}

/* ============================================
   Buttons
   ============================================ */
.btn {
  position: relative;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.8);
  color: white;
  background: linear-gradient(45deg, #FF1817, #C20100);
  padding: 0.75rem 2rem;
  display: inline-block;
  transition: all 0.4s cubic-bezier(0.23, 1, 0.32, 1);
  z-index: 1;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
  margin-top: 20px;
  cursor: pointer;
  font-size: 1.1rem;
}

.btn-primary {
  background-color: var(--primary);
  color: white;
  border: 2px solid var(--primary);
  background: var(--primary);
}

.btn-primary:hover, .btn-outline:hover {
  background-color: transparent !important;
  color: var(--primary) !important;
  border-color: var(--primary) !important;
  transform: translateY(-3px);
  box-shadow: 0 10px 20px rgba(255,24,23,0.3);
}

.btn-outline {
  background-color: transparent;
  color: white;
}

.btn-outline-light {
  position: relative;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.8);
  color: white;
  background: linear-gradient(45deg, #FF1817, #C20100);
  padding: 0.75rem 2rem;
  display: inline-block;
  transition: all 0.4s cubic-bezier(0.23, 1, 0.32, 1);
  z-index: 1;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.btn-outline-light:hover {
  color: white;
  transform: scale(1.05);
  box-shadow: 0 0 10px rgba(255, 24, 23, 0.6), 0 0 20px rgba(255, 24, 23, 0.4), 0 0 40px rgba(255, 24, 23, 0.2);
  filter: brightness(1.2);
  border-color: #FF1817;
}

.btn-outline-light::after {
  content: "";
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
  transition: all 0.6s ease;
  z-index: -1;
}

.btn-outline-light:hover::after {
  left: 100%;
}

.btn-link {
  color: var(--primary);
  font-weight: 600;
  display: inline-block;
  margin-top: auto;
}
.btn-link:hover { transform: translateX(5px); }

/* Back to Top Button */
#backToTop {
  display: none; 
  position: fixed;
  bottom: 30px;
  right: 30px;
  z-index: 99;
  border: none;
  outline: none;
  background-color: var(--primary);
  color: white;
  cursor: pointer;
  padding: 15px;
  border-radius: 50%;
  width: 50px;
  height: 50px;
  align-items: center;
  justify-content: center;
  transition: var(--transition);
  box-shadow: 0 5px 15px rgba(255,24,23,0.4);
}

#backToTop:hover {
  background-color: white;
  color: var(--primary);
  transform: scale(1.1);
}

/* ============================================
   Header & Navigation (Glassmorphism)
   ============================================ */
header, .navbar { 
  background: var(--header-bg);
  backdrop-filter: blur(15px);
  -webkit-backdrop-filter: blur(15px);
  border-bottom: 3px solid var(--primary); 
  position: fixed; 
  width: 100%;
  top: 0; 
  left: 0;
  z-index: 9999 !important;
  padding: 0.5rem 0;
  transition: all 0.3s ease;
}

/* Change style when scrolled */
header.scrolled, .navbar.scrolled {
  background: rgba(255, 255, 255, 0.7) !important;
  padding: 0.2rem 0;
  box-shadow: 0 5px 20px rgba(0,0,0,0.1);
}

[data-theme="dark"] header.scrolled, [data-theme="dark"] .navbar.scrolled {
  background: rgba(13, 13, 13, 0.7) !important;
}

.header-container, .nav-container { 
  display: flex; justify-content: space-between; align-items: center; 
  max-width: 1800px; margin: auto; padding: 0.5rem 5%; height: 70px;
}
.nav-container { max-width: 1400px; padding: 1rem 5%; }

/* LOGO */
.logo a { display: flex; align-items: center; gap: 12px; }
.logo img { height: 90px; width: auto; transition: none; }
.logo:hover img { transform: none !important; }
.logo a::after { display: none !important; content: none !important; }
[data-theme="dark"] .logo img { filter: brightness(0) invert(1); }

#main-logo {
  height: 90px !important;
  width: auto;
  transition: height 0.4s cubic-bezier(0.165, 0.84, 0.44, 1) !important;
}
.nav-scrolled #main-logo { height: 80px !important; }

nav ul, .nav-links { display: flex; gap: 2.5rem; align-items: center; }
nav a, .nav-links a { 
  font-size: 1.25rem; 
  position: relative; 
  color: var(--text);
  transition: all 0.3s ease;
}

nav a:hover, nav a.active, .nav-links a:hover, .nav-links a.active { 
  color: var(--primary) !important;
  transform: translateY(-2px);
}

nav a::after, .nav-links a::after {
  content: ''; 
  position: absolute; 
  bottom: -5px; 
  left: 0; 
  width: 0; 
  height: 3px;
  background: linear-gradient(90deg, var(--primary), transparent);
  transition: width 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}
nav a.active::after, nav a:hover::after, .nav-links a:not(.btn):hover::after, .nav-links a.active::after { 
  width: 100%; 
}

/* Theme Toggle */
.theme-toggle {
  background: transparent; border: 2px solid var(--primary); color: var(--primary);
  width: 45px; height: 45px; border-radius: 50%; cursor: pointer;
  display: flex; align-items: center; justify-content: center; font-size: 1.3rem;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.theme-toggle:hover {
  background: var(--primary); color: white;
  transform: rotate(15deg) scale(1.1);
  box-shadow: 0 0 15px var(--primary);
}

[data-theme="dark"] .theme-toggle:hover {
  background: #f1c40f; border-color: #f1c40f;
  box-shadow: 0 0 15px #f1c40f;
}

   /* ============================================
      Hero Section & Video
      ============================================ */
   .hero { 
     height: 100vh; 
     position: relative; 
     display: flex; 
     align-items: center; 
     justify-content: center; 
     text-align: center; 
     color: white; 
     overflow: hidden;
     background-size: cover;
     background-position: center;
     background-attachment: fixed;
   }

   /* Hero video element */
   .hero video {
     position: absolute;
     top: 0;
     left: 0;
     width: 100%;
     height: 100%;
     object-fit: cover;
     z-index: 1;
   }

   /* Overlay on top of video */
   .hero::before {
     content: '';
     position: absolute;
     top: 0;
     left: 0;
     width: 100%;
     height: 100%;
     background: linear-gradient(135deg, rgba(0,0,0,0.6) 0%, rgba(0,0,0,0.4) 50%, rgba(0,0,0,0.6) 100%);
     z-index: 2;
   }
   
   .hero-slideshow { position: absolute; top: 0; left: 0; width: 100%; height: 100%; z-index: 1; }
   
   .slide {
     position: absolute; width: 100%; height: 100%; background-size: cover;
     background-position: center; opacity: 0; animation: slideLoop 18s linear infinite;
   }
   
   .slide:nth-child(1) { animation-delay: 0s; }
   .slide:nth-child(2) { animation-delay: 6s; }
   .slide:nth-child(3) { animation-delay: 12s; }
   
   @keyframes slideLoop {
     0% { opacity: 0; transform: scale(1); }
     5% { opacity: 1; }
     33% { opacity: 1; }
     38% { opacity: 0; }
     100% { opacity: 0; transform: scale(1.1); }
   }
   
   .hero-content { position: relative; z-index: 3; }
   

/* Static Page Hero (From cards.css) */
.page-hero {
  min-height: 45vh;
  background-image: linear-gradient(rgba(0,0,0,0.7), rgba(0,0,0,0.7)), url('https://images.unsplash.com/photo-1504307651254-35680f356dfd?q=80');
  background-size: cover;
  background-position: center;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  color: white;
  margin-top: 80px; /* Accounts for fixed header */
}

section.hero-sub {
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  background-size: cover;
  background-position: center;
  min-height: 60vh;
  margin-top: 0;
  padding-top: 100px;
  color: white;
  position: relative;
}

/* ============================================
   Layout & Grids
   ============================================ */
.container, .about-container, .values-container { 
  max-width: 1400px; 
  margin: 0 auto; 
  padding: 5rem 5%; 
}

.grid { display: grid; gap: 3rem; grid-template-columns: repeat(auto-fit, minmax(350px, 1fr)); }
.grid-2 { grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); }
.grid-3 { grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); }
.grid-4 { grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); }
.projects-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 30px; }

.about-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 4rem; align-items: center; }
.about-text p { color: var(--text-alt); margin-bottom: 1.5rem; font-size: 1.1rem; }
.about-image img { border-radius: 8px; border: 1px solid var(--border); }

.values-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 2rem; }

.section-divider {
  border: 0; height: 1px; background: rgba(255, 255, 255, 0.1); width: 80%; margin: 2rem auto;
}

/* ============================================
   Search & Filters (From cards.css)
   ============================================ */
.search-wrapper { max-width: 600px; margin: 0 auto 20px auto; text-align: center; }
#searchInput {
  width: 100%; padding: 12px 20px; border-radius: 30px; border: 1px solid #ddd;
  outline: none; font-size: 1rem;
}

.filter-wrapper { display: flex; justify-content: center; flex-wrap: wrap; gap: 10px; margin-bottom: 40px; }
.filter-btn {
  padding: 10px 25px; border: 2px solid var(--primary); background: transparent;
  color: var(--primary); font-family: inherit; font-weight: bold; cursor: pointer;
  transition: all 0.3s ease; text-transform: uppercase;
}
.filter-btn.active, .filter-btn:hover { background: var(--primary); color: white; }

/* ============================================
   Cards
   ============================================ */
.card { 
  background: var(--card); border: 1px solid var(--border); 
  padding: 2.5rem; border-radius: 8px; transition: var(--transition);
  display: flex; flex-direction: column; position: relative; overflow: hidden;
}

.card:hover {
  transform: translateY(-10px); border-color: var(--primary);
  box-shadow: 0 15px 40px rgba(255, 24, 23, 0.2);
  background: linear-gradient(135deg, rgba(255,24,23,0.05), rgba(0,0,0,0));
}

.card-image-wrapper { position: relative; overflow: hidden; background: var(--dark); display: block; }
.card-image { width: 100%; height: 320px; object-fit: cover; transition: 0.6s ease; }

.product-icon {
  font-size: 2.5rem; color: var(--primary); margin-bottom: 1.5rem;
  width: 70px; height: 70px; display: flex; align-items: center; justify-content: center;
  background: rgba(255,24,23,0.1); border-radius: 50%; transition: var(--transition);
}
.card:hover .product-icon { transform: scale(1.1) rotate(5deg); background: rgba(255,24,23,0.2); }
.card p { color: var(--text-alt); flex-grow: 1; margin-bottom: 1rem;}
.counter { font-size: 3.5rem; font-family: var(--font-h); color: var(--primary); line-height: 1; margin-bottom: 10px;}

/* Project Card Style (Theme Aware) */
.project-card {
  background: var(--card); /* Adapts to light/dark card background */
  border: 1px solid var(--border); /* Adapts to light/dark border */
  box-shadow: 0 10px 20px rgba(0,0,0,0.1);
  padding: 2.5rem; 
  border-radius: 8px; 
  transition: all 0.4s ease;
  height: 100%; 
  cursor: pointer; 
  display: flex; 
  flex-direction: column;
}

/* Slightly deeper shadow for dark mode to maintain depth */
[data-theme="dark"] .project-card {
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.3);
}

.project-card:hover {
  border-top: 3px solid var(--primary); 
  transform: translateY(-5px);
  box-shadow: 0 10px 20px rgba(245, 0, 0, 0.2);
}

.project-thumbnail {
  width: 100%; 
  height: 260px; 
  object-fit: cover; 
  border-radius: 4px;
  margin-bottom: 1.5rem; 
  filter: grayscale(80%); 
  transition: all 0.4s ease;
}

.project-card:hover .project-thumbnail { 
  filter: grayscale(0%); 
}

.project-meta {
  font-size: 0.75rem; 
  color: var(--primary); 
  text-transform: uppercase;
  letter-spacing: 2px; 
  margin-bottom: 0.5rem; 
  display: block; 
  font-weight: bold;
}

.project-card h3 { 
  font-size: 1.5rem; 
  color: var(--text); /* Adapts to light/dark heading text */
  margin: 0 0 1rem 0; 
}

.project-card p { 
  color: var(--text-alt); /* Adapts to light/dark paragraph text */
  font-size: 1rem; 
  line-height: 1.7; 
  margin: 0; 
  flex-grow: 1; 
}

.project-link {
  display: inline-block; 
  margin-top: 1.5rem; 
  padding-bottom: 0.2rem;
  color: var(--text); /* Adapts to light/dark link text */
  text-decoration: none; 
  font-size: 0.9rem; 
  font-weight: 600;
  border-bottom: 1px solid var(--border); /* Adapts to light/dark underline */
  transition: all 0.3s ease;
}

.project-card:hover .project-link {
  color: var(--primary); 
  border-bottom-color: var(--primary); 
  transform: translateX(5px);
}

/* Service Cards */
.service-card { border-top: 4px solid var(--primary); justify-content: center; }
.service-card i { transition: transform 0.4s ease; }
.service-card:hover { background: var(--primary); color: white !important; }
.service-card:hover i { color: white !important; transform: scale(1.2) rotate(10deg); }
.service-card:hover p { color: rgba(255, 255, 255, 0.9); }

.info-section .card::after, .grid-3 .card::after { display: none !important; }
section.about-services .card::after { content: 'VIEW'; }

/* Hover Buttons on Cards */
.product-card { display: block; transition: all 0.3s ease; }
.product-card.hide { display: none; }
.card-content .btn {
  position: absolute; top: 50%; left: 50%;
  transform: translate(-50%, -50%) scale(0.8); opacity: 0;
  background: var(--primary); color: white; padding: 12px 24px; font-weight: bold;
  border: 2px solid var(--primary); transition: all 0.3s ease; z-index: 10;
}
.product-card:hover .btn { opacity: 1; transform: translate(-50%, -50%) scale(1); }
.product-card:hover .btn:hover { background: transparent; color: var(--primary); }

/* ============================================
   Instagram Style Modal (From cards.css)
   ============================================ */
.modal-overlay { 
  display: none; align-items: center; justify-content: center; position: fixed; 
  top: 0; left: 0; width: 100%; height: 100%; background: rgba(0, 0, 0, 0.8); 
  z-index: 1000; opacity: 0; transition: opacity 0.3s ease; padding: 20px; box-sizing: border-box; 
}
.modal-overlay.show { opacity: 1; }
.insta-layout { 
  display: flex; flex-direction: row; background: #fff; width: 100%; max-width: 1000px; 
  height: 80vh; max-height: 700px; border-radius: 12px; overflow: hidden; position: relative; 
  box-shadow: 0 10px 30px rgba(0,0,0,0.3); 
}
.close-btn { 
  position: absolute; top: 15px; right: 20px; font-size: 28px; color: #333; cursor: pointer; 
  z-index: 10; background: #fff; border-radius: 50%; width: 35px; height: 35px; 
  display: flex; align-items: center; justify-content: center; box-shadow: 0 2px 5px rgba(0,0,0,0.1); 
}
.modal-image-wrapper { flex: 1.2; background: #000; display: flex; align-items: center; justify-content: center; border-right: 1px solid #eee; }
.modal-image-wrapper img { max-width: 100%; max-height: 100%; object-fit: contain; }
.modal-details-wrapper { flex: 1; display: flex; flex-direction: column; background: #fff; }
.modal-header { padding: 20px; border-bottom: 1px solid #eee; display: flex; flex-direction: column; gap: 5px; }
.modal-header h2 { margin: 0; font-size: 1.5rem; color: #222; }
.modal-header .project-meta { font-size: 0.85rem; font-weight: 600; color: #666; text-transform: uppercase; }
.modal-scroll-area { padding: 20px; overflow-y: auto; flex: 1; }
.modal-scroll-area p { color: #555; line-height: 1.6; margin-bottom: 20px; }
.modal-specs { list-style: none; padding: 0; margin: 0; border-top: 1px solid #eee; padding-top: 20px; }
.modal-specs li { display: flex; justify-content: space-between; margin-bottom: 12px; font-size: 0.9rem; padding: 8px 12px; background: #f9f9f9; border-radius: 6px; }
.modal-specs li strong { color: #333; }
.modal-specs li span { color: #666; text-align: right; word-break: break-word; max-width: 80%; }

/* ============================================
   Explosion View
   ============================================ */
.explosion-container {
  position: relative; width: 100%; height: 500px; background: var(--card);
  border-radius: 15px; overflow: hidden; display: flex; justify-content: center;
  align-items: center; border: 1px solid var(--border);
}
.product-part {
  position: absolute; width: 320px; transition: all 0.8s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  cursor: pointer; z-index: 5;
}
.product-part img { width: 100%; filter: drop-shadow(0 10px 15px rgba(0,0,0,0.1)); }
.explosion-container.exploded .part-top { transform: translateY(-120px) scale(1.05); }
.explosion-container.exploded .part-mid { transform: scale(1); opacity: 0.8; }
.explosion-container.exploded .part-bottom { transform: translateY(120px) scale(0.95); }
.product-part:hover { z-index: 10; filter: brightness(1.2); }
#part-info-overlay {
  position: absolute; top: 20px; left: 20px; background: var(--primary); color: white;
  padding: 15px; border-radius: 5px; max-width: 250px; display: none; z-index: 20;
  font-size: 0.85rem; box-shadow: 0 5px 15px rgba(0,0,0,0.3);
}

/* ============================================
   Forms & Utilities
   ============================================ */
input[type="text"], input[type="email"], input[type="tel"], textarea, select { transition: all 0.3s ease; }
input[type="text"]:focus, input[type="email"]:focus, input[type="tel"]:focus, textarea:focus, select:focus {
  transform: translateY(-2px); box-shadow: 0 10px 25px rgba(0,0,0,0.1);
}

#loadingMessage { text-align: center; grid-column: 1 / -1; font-weight: bold; padding: 40px 0; }
.loading {
  display: inline-block; width: 20px; height: 20px; border: 3px solid rgba(255,255,255,.3);
  border-radius: 50%; border-top-color: white; animation: spin 1s ease-in-out infinite;
}

/* ============================================
   Animations
   ============================================ */
@keyframes slideInDown { from { transform: translateY(-50px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }
@keyframes slideInUp { from { transform: translateY(50px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }
@keyframes scaleIn { from { transform: scale(0.9); opacity: 0; } to { transform: scale(1); opacity: 1; } }
@keyframes pulse { 0%, 100% { box-shadow: 0 0 0 0 rgba(255, 24, 23, 0.7); } 50% { box-shadow: 0 0 0 10px rgba(255, 24, 23, 0); } }
@keyframes float { 0%, 100% { transform: translateY(0px); } 50% { transform: translateY(-10px); } }
@keyframes shimmer { 0% { background-position: -1000px 0; } 100% { background-position: 1000px 0; } }
@keyframes rotate { from { transform: rotate(0deg); } to { transform: rotate(360deg); } }
@keyframes spin { 0% { transform: rotate(0deg); } 100% { transform: rotate(360deg); } }

.reveal { opacity: 0; transform: translateY(40px); transition: 0.8s all cubic-bezier(0.165, 0.84, 0.44, 1); }
.reveal.active { opacity: 1; transform: translateY(0); }
.reveal-stagger .stagger-item { opacity: 0; transform: translateY(30px); transition: 0.6s all ease-out; }
.reveal-stagger.active .stagger-item { opacity: 1; transform: translateY(0); }
.reveal-stagger.active .stagger-item:nth-child(1) { transition-delay: 0.1s; }
.reveal-stagger.active .stagger-item:nth-child(2) { transition-delay: 0.2s; }
.reveal-stagger.active .stagger-item:nth-child(3) { transition-delay: 0.3s; }
.reveal-stagger.active .stagger-item:nth-child(4) { transition-delay: 0.4s; }
.reveal-stagger.active .stagger-item:nth-child(5) { transition-delay: 0.5s; }

.image-hover { overflow: hidden; }
.image-hover img { transition: 0.6s ease; }
.image-hover:hover img { transform: scale(1.05); filter: brightness(1.1); }

/* ============================================
   Footer
   ============================================ */
footer { background: #080808; color: #777; padding: 35px 5% 15px; border-top: 5px solid var(--primary); }
.footer-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 25px; max-width: 1300px; margin: auto; padding: 30px 0 15px; }
footer h4 { color: white; font-size: 1.5rem; margin-bottom: 1rem; position: relative; }
footer h4::after { content: ''; position: absolute; left: 0; bottom: -8px; width: 40px; height: 3px; background: var(--primary); }
.footer-bottom { padding: 10px 5%; border-top: 1px solid rgba(255, 255, 255, 0.05); }
.footer-bottom-container { display: flex; align-items: center; justify-content: space-between; max-width: 1800px; margin: auto; position: relative; }
.copyright-text { flex: 1; text-align: left; }
.social-links { display: flex; gap: 15px; position: absolute; left: 50%; transform: translateX(-50%); }
.social-links a { width: 35px; height: 35px; background: rgba(255, 255, 255, 0.05); border: 1px solid rgba(255, 255, 255, 0.1); display: flex; align-items: center; justify-content: center; border-radius: 50%; color: #777; font-size: 0.9rem; transition: all 0.3s ease; }
.social-links a:hover { background: var(--primary); color: white; transform: translateY(-3px); border-color: var(--primary); }
.footer-spacer { flex: 1; }

/* ============================================
   Media Queries & Responsiveness
   ============================================ */
.menu-toggle { display: none; background: none; border: none; font-size: 2.5rem; color: var(--text); cursor: pointer; }

@media (max-width: 992px) {
  .menu-toggle { display: block; }
  nav { position: fixed; top: 0; right: -100%; width: 75%; height: 100vh; background: var(--bg); z-index: 2000; padding: 100px 40px; transition: 0.5s ease; }
  nav.active { right: 0; }
  nav ul { flex-direction: column; gap: 2rem; }
  nav a { font-size: 2rem; }
  .footer-bottom-container { flex-direction: column; gap: 20px; }
  .social-links { position: static; transform: none; order: -1; }
  .copyright-text { text-align: center; }
  .about-grid { grid-template-columns: 1fr; gap: 3rem; text-align: center; }
  .about-image { order: -1; }
  .section-title { border-left: none; padding-left: 0; border-bottom: 3px solid var(--primary); display: inline-block; padding-bottom: 5px; }
}

@media (max-width: 768px) {
  h1 { font-size: clamp(2.5rem, 8vw, 3.5rem); }
  h2 { font-size: clamp(1.8rem, 5vw, 2.5rem); padding-left: 15px; border-left: 5px solid var(--primary); }
  .grid[style*="grid-template-columns: 2fr 1fr"] { grid-template-columns: 1fr !important; }
  #slider-wrapper { height: 350px; }
  .slider-btn { padding: 15px 12px; font-size: 18px; }
  .nav-container { flex-direction: column; gap: 1rem; padding: 1rem; }
  .nav-links { gap: 1.5rem; flex-wrap: wrap; justify-content: center; }
  .hero-content { padding-bottom: 15vh; text-align: center; margin: 0 auto; }
  .insta-layout { flex-direction: column; height: 90vh; }
  .modal-image-wrapper { flex: none; height: 40%; }
  .modal-details-wrapper { flex: 1; height: 60%; }
  .close-btn { top: 10px; right: 10px; }
}

@media (max-width: 480px) {
  body { font-size: 14px; }
  h1 { font-size: clamp(2rem, 6vw, 2.8rem); }
  .container { padding: 50px 12px; }
  table tr { display: flex; flex-direction: column; padding: 12px 0; }
  table td:first-child { font-weight: bold; }
  .btn-primary { width: 100% !important; }
  .footer-grid { grid-template-columns: 1fr; }
}

@media (max-width: 360px) {
  h1 { font-size: 1.8rem; }
  #slider-wrapper { height: 200px; }
  .slider-btn { padding: 10px 6px; font-size: 14px; }
}

/* --- Typography Elements --- */
.hero-title-highlight {
  color: #ffffff !important;
  -webkit-text-fill-color: #ffffff !important;
}

.ribbon-target {
  /* Note: "px" without a number is technically invalid CSS, 
     but it was preserved exactly as it appeared in the original inline style. 
     You may want to update it to something like "0px" or remove it if unused. */
  margin-top: 0px; 
}

.text-build {
  padding-bottom: 100px;
}

/* ============================================
   Pagination Controls
   ============================================ */
.pagination-wrapper {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 10px;
  margin-top: 50px;
  flex-wrap: wrap;
}

.page-btn {
  padding: 10px 18px;
  border: 1px solid var(--border);
  background: var(--card);
  color: var(--text);
  border-radius: 6px;
  cursor: pointer;
  font-family: var(--font-b);
  font-weight: bold;
  transition: all 0.3s ease;
}

.page-btn:hover:not(:disabled) {
  background: var(--primary);
  color: white;
  border-color: var(--primary);
  transform: translateY(-2px);
  box-shadow: 0 5px 15px rgba(255, 24, 23, 0.2);
}

.page-btn.active {
  background: var(--primary);
  color: white;
  border-color: var(--primary);
}

.page-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  background: var(--bg-alt);
}