/* ==========================================================================
   Base & Variables (Hyper Color Flow Theme)
   ========================================================================== */
@import url("https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;500;600;700;800;900&display=swap");

:root {
  /* Color Palette */
  --bg-base: #f8fafc;
  --bg-surface: #ffffff;
  --bg-surface-alt: #f1f5f9;
  --bg-dark: #0f172a;

  --text-main: #0f172a;
  --text-muted: #64748b;
  --text-light: #f8fafc;

  /* Gradients */
  --grad-primary: linear-gradient(135deg, #2563eb, #7c3aed, #ec4899);
  --grad-secondary: linear-gradient(135deg, #06b6d4, #3b82f6);
  --grad-warm: linear-gradient(135deg, #f97316, #eab308);
  --grad-dark: linear-gradient(135deg, #0f172a, #1e293b);

  /* Accents */
  --accent-blue: #2563eb;
  --accent-purple: #7c3aed;
  --accent-pink: #ec4899;
  --accent-cyan: #06b6d4;
  --accent-orange: #f97316;

  /* Shadows */
  --shadow-sm:
    0 4px 6px -1px rgba(15, 23, 42, 0.05), 0 2px 4px -1px rgba(15, 23, 42, 0.03);
  --shadow-md:
    0 10px 15px -3px rgba(15, 23, 42, 0.1),
    0 4px 6px -2px rgba(15, 23, 42, 0.05);
  --shadow-lg:
    0 20px 25px -5px rgba(124, 58, 237, 0.1),
    0 10px 10px -5px rgba(124, 58, 237, 0.04);
  --shadow-glow: 0 0 20px rgba(124, 58, 237, 0.4);

  /* Structural */
  --radius-sm: 8px;
  --radius-md: 16px;
  --radius-lg: 24px;
  --radius-full: 9999px;
  --container-width: 1280px;
  --transition-fast: 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-smooth: 0.4s cubic-bezier(0.16, 1, 0.3, 1);
  --header-height: 90px;
}

/* ==========================================================================
      Reset & Global
      ========================================================================== */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  font-size: 16px;
}

body {
  font-family: "Poppins", sans-serif;
  background-color: var(--bg-base);
  color: var(--text-main);
  line-height: 1.6;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

a {
  text-decoration: none;
  color: inherit;
  transition: var(--transition-fast);
}
ul {
  list-style: none;
}
img {
  max-width: 100%;
  height: auto;
  display: block;
}
button {
  border: none;
  background: none;
  cursor: pointer;
  font-family: inherit;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
  width: 10px;
}
::-webkit-scrollbar-track {
  background: var(--bg-base);
}
::-webkit-scrollbar-thumb {
  background: var(--accent-purple);
  border-radius: var(--radius-full);
}
::-webkit-scrollbar-thumb:hover {
  background: var(--accent-pink);
}

/* ==========================================================================
      Typography & Utilities
      ========================================================================== */
h1,
h2,
h3,
h4,
h5,
h6 {
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: -0.02em;
}
h1 {
  font-size: clamp(2.5rem, 5vw, 4.5rem);
  margin-bottom: 1.5rem;
}
h2 {
  font-size: clamp(2rem, 4vw, 3rem);
  margin-bottom: 1rem;
}
h3 {
  font-size: clamp(1.5rem, 3vw, 2rem);
  margin-bottom: 1rem;
}
p {
  margin-bottom: 1rem;
  color: var(--text-muted);
  font-size: 1.125rem;
}

.text-gradient {
  background: var(--grad-primary);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  display: inline-block;
}

.text-gradient-alt {
  background: var(--grad-secondary);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.text-center {
  text-align: center;
}
.text-muted {
  color: var(--text-muted);
}
.font-bold {
  font-weight: 700;
}
.mb-1 {
  margin-bottom: 0.5rem;
}
.mb-2 {
  margin-bottom: 1rem;
}
.mb-4 {
  margin-bottom: 2rem;
}
.mb-8 {
  margin-bottom: 4rem;
}

/* Layout Utilities */
.container {
  width: 100%;
  max-width: var(--container-width);
  margin: 0 auto;
  padding: 0 2rem;
}

.section-padding {
  padding: 8rem 0;
}
.section-padding-sm {
  padding: 4rem 0;
}

.grid {
  display: grid;
  gap: 2rem;
}
.grid-2 {
  grid-template-columns: repeat(2, 1fr);
}
.grid-3 {
  grid-template-columns: repeat(3, 1fr);
}
.grid-4 {
  grid-template-columns: repeat(4, 1fr);
}

.flex {
  display: flex;
}
.flex-col {
  flex-direction: column;
}
.items-center {
  align-items: center;
}
.justify-center {
  justify-content: center;
}
.justify-between {
  justify-content: space-between;
}
.gap-1 {
  gap: 0.5rem;
}
.gap-2 {
  gap: 1rem;
}
.gap-4 {
  gap: 2rem;
}

/* ==========================================================================
      Components (MUI Style)
      ========================================================================== */

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.875rem 2rem;
  font-weight: 600;
  border-radius: var(--radius-full);
  transition: var(--transition-smooth);
  position: relative;
  overflow: hidden;
  z-index: 1;
  font-size: 1rem;
}

.btn-primary {
  background: var(--grad-primary);
  color: white;
  box-shadow: var(--shadow-md);
}

.btn-primary::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: var(--grad-secondary);
  opacity: 0;
  z-index: -1;
  transition: opacity var(--transition-smooth);
  border-radius: inherit;
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-glow);
  color: white;
}

.btn-primary:hover::before {
  opacity: 1;
}

.btn-outline {
  background: transparent;
  color: var(--text-main);
  border: 2px solid rgba(15, 23, 42, 0.1);
}

.btn-outline:hover {
  border-color: var(--accent-purple);
  color: var(--accent-purple);
}

/* Cards */
.card {
  background: var(--bg-surface);
  border-radius: var(--radius-lg);
  padding: 2.5rem;
  box-shadow: var(--shadow-sm);
  transition: var(--transition-smooth);
  border: 1px solid rgba(255, 255, 255, 0.5);
  position: relative;
  overflow: hidden;
}

.card::after {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 4px;
  background: var(--grad-primary);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform var(--transition-smooth);
}

.card:hover {
  transform: translateY(-10px);
  box-shadow: var(--shadow-lg);
}

.card:hover::after {
  transform: scaleX(1);
}

/* Chips/Badges */
.chip {
  display: inline-flex;
  align-items: center;
  padding: 0.5rem 1rem;
  background: rgba(124, 58, 237, 0.1);
  color: var(--accent-purple);
  border-radius: var(--radius-full);
  font-weight: 600;
  font-size: 0.875rem;
  margin-bottom: 1rem;
}

.chip i {
  margin-right: 0.5rem;
}

/* Forms */
.form-group {
  margin-bottom: 1.5rem;
}
.form-group label {
  display: block;
  margin-bottom: 0.5rem;
  font-weight: 500;
  color: var(--text-main);
}

.form-control {
  width: 100%;
  padding: 1rem 1.5rem;
  background: var(--bg-surface-alt);
  border: 2px solid transparent;
  border-radius: var(--radius-md);
  font-family: inherit;
  font-size: 1rem;
  color: var(--text-main);
  transition: var(--transition-fast);
}

.form-control:focus {
  outline: none;
  border-color: var(--accent-purple);
  background: var(--bg-surface);
  box-shadow: 0 0 0 4px rgba(124, 58, 237, 0.1);
}

/* ==========================================================================
      Header & Navigation (Universal)
      ========================================================================== */
.header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  padding: 10px;
  background: rgba(255, 255, 255, 0.8);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  z-index: 1000;
  transition: var(--transition-smooth);
  border-bottom: 1px solid rgba(15, 23, 42, 0.05);
}

.header.scrolled {
  background: rgba(255, 255, 255, 0.95);
  box-shadow: var(--shadow-md);
}

.header .container {
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.logo {
  height: 80px;
  filter: invert(1);
  transition: var(--transition-fast);
}

.nav-list {
  display: flex;
  gap: 2.5rem;
}
.nav-link {
  font-weight: 500;
  color: var(--text-main);
  position: relative;
  padding: 0.5rem 0;
}

.nav-link::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 2px;
  background: var(--grad-primary);
  transform: scaleX(0);
  transform-origin: right;
  transition: transform var(--transition-smooth);
}

.nav-link:hover::after {
  transform: scaleX(1);
  transform-origin: left;
}

.mobile-toggle {
  display: none;
  flex-direction: column;
  justify-content: space-between;
  width: 30px;
  height: 20px;
  z-index: 1001;
}

.mobile-toggle .bar {
  height: 2px;
  width: 100%;
  background-color: var(--text-main);
  transition: var(--transition-smooth);
}

.mobile-nav {
  position: fixed;
  top: 0;
  right: -100%;
  width: 100%;
  height: 100vh;
  background: var(--bg-surface);
  z-index: 999;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition-smooth);
}

.mobile-nav.active {
  right: 0;
}
.mobile-nav ul {
  text-align: center;
  display: flex;
  flex-direction: column;
  gap: 2rem;
}
.mobile-nav a {
  font-size: 2rem;
  font-weight: 700;
  color: var(--text-main);
}

/* ==========================================================================
      Footer (Universal)
      ========================================================================== */
.footer {
  background: var(--bg-dark);
  color: var(--text-light);
  padding: 6rem 0 2rem;
  position: relative;
  overflow: hidden;
}

.footer::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: var(--grad-primary);
}

.footer-top {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1.5fr;
  gap: 4rem;
  margin-bottom: 4rem;
}

.footer-logo {
  height: 80px;
  margin-bottom: 1.5rem;
  filter: brightness(0) invert(1);
}
.footer-about-text {
  color: #94a3b8;
  margin-bottom: 2rem;
}

.social-links {
  display: flex;
  gap: 1rem;
}
.social-link {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.1);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition-fast);
}

.social-link:hover {
  background: var(--accent-purple);
  transform: translateY(-3px);
}

.footer-col-title {
  color: white;
  font-size: 1.25rem;
  margin-bottom: 1.5rem;
  font-weight: 600;
}

.footer-links ul {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}
.footer-links a {
  color: #94a3b8;
  transition: var(--transition-fast);
}
.footer-links a:hover {
  color: white;
  padding-left: 5px;
}

.contact-info li {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  margin-bottom: 1rem;
  color: #94a3b8;
}

.contact-info i {
  color: var(--accent-cyan);
  margin-top: 5px;
}
.contact-info a {
  color: #94a3b8;
}
.contact-info a:hover {
  color: white;
}

.footer-bottom {
  text-align: center;
  padding-top: 2rem;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  color: #64748b;
}

/* ==========================================================================
      Index Page Specific Sections
      ========================================================================== */

/* Hero Section */
.hero {
  position: relative;
  padding: 12rem 0 6rem;
  min-height: 100vh;
  display: flex;
  align-items: center;
  overflow: hidden;
  background: var(--bg-base);
}

/* Abstract SVG Background */
.hero-bg {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  opacity: 0.6;
  pointer-events: none;
}

.hero .container {
  position: relative;
  z-index: 1;
}

.hero-content {
  max-width: 650px;
}
.hero-title {
  font-size: clamp(3rem, 6vw, 5.5rem);
  line-height: 1.1;
  margin-bottom: 1.5rem;
}
.hero-desc {
  font-size: 1.25rem;
  margin-bottom: 2.5rem;
  max-width: 500px;
}
.hero-actions {
  display: flex;
  gap: 1rem;
  align-items: center;
}

/* 3D Mockup */
.hero-visual {
  position: absolute;
  right: -5%;
  top: 50%;
  transform: translateY(-50%) perspective(1000px) rotateY(-15deg) rotateX(5deg);
  width: 600px;
  height: 600px;
  z-index: 1;
  transform-style: preserve-3d;
  transition: transform 0.1s ease-out;
}

.mockup-card {
  position: absolute;
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(20px);
  border-radius: var(--radius-lg);
  padding: 2rem;
  box-shadow: var(--shadow-lg);
  border: 1px solid rgba(255, 255, 255, 1);
}

.mockup-main {
  width: 400px;
  height: 500px;
  top: 50px;
  left: 100px;
  transform: translateZ(50px);
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.mockup-stat {
  width: 250px;
  height: 120px;
  top: 300px;
  left: -50px;
  transform: translateZ(100px);
  background: var(--grad-primary);
  color: white;
}

.mockup-chart {
  width: 100%;
  height: 150px;
  background: var(--bg-surface-alt);
  border-radius: var(--radius-md);
  position: relative;
  overflow: hidden;
}

.mockup-bar {
  position: absolute;
  bottom: 0;
  width: 30px;
  background: var(--accent-purple);
  border-radius: 4px 4px 0 0;
}

/* Marquee / Trust Banner */
.trust-banner {
  background: var(--bg-surface);
  padding: 3rem 0;
  border-top: 1px solid rgba(15, 23, 42, 0.05);
  border-bottom: 1px solid rgba(15, 23, 42, 0.05);
  overflow: hidden;
}

.marquee {
  display: flex;
  white-space: nowrap;
  animation: scroll 30s linear infinite;
  gap: 4rem;
}

.marquee-item {
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--text-muted);
  opacity: 0.5;
}

@keyframes scroll {
  0% {
    transform: translateX(0);
  }
  100% {
    transform: translateX(-50%);
  }
}

/* Services Section */
.services {
  background: var(--bg-base);
}
.service-icon {
  width: 60px;
  height: 60px;
  border-radius: 16px;
  background: rgba(124, 58, 237, 0.1);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  color: var(--accent-purple);
  margin-bottom: 1.5rem;
  transition: var(--transition-smooth);
}

.card:hover .service-icon {
  background: var(--grad-primary);
  color: white;
  transform: scale(1.1) rotate(5deg);
}

/* Calculator Section (Interactive) */
.calculator-section {
  background: var(--bg-dark);
  color: white;
  position: relative;
}

.calc-wrapper {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--radius-lg);
  padding: 4rem;
  backdrop-filter: blur(10px);
}

.range-slider {
  width: 100%;
  -webkit-appearance: none;
  height: 8px;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.2);
  outline: none;
  margin: 1.5rem 0;
}

.range-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--accent-cyan);
  cursor: pointer;
  box-shadow: 0 0 10px rgba(6, 182, 212, 0.5);
}

.calc-results {
  background: rgba(0, 0, 0, 0.3);
  padding: 2rem;
  border-radius: var(--radius-md);
  text-align: center;
}

.calc-value {
  font-size: 3rem;
  font-weight: 800;
  color: var(--accent-cyan);
}

/* Case Studies */
.case-study {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4rem;
  align-items: center;
  margin-bottom: 6rem;
}

.case-study:nth-child(even) {
  direction: rtl;
}
.case-study:nth-child(even) > * {
  direction: ltr;
}

.cs-image {
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-lg);
  position: relative;
}

.cs-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s ease;
}

.cs-image:hover img {
  transform: scale(1.05);
}

/* Results / Counter Wall */
.results {
  background: var(--bg-surface-alt);
}
.stat-box {
  text-align: center;
  padding: 2rem;
}
.stat-number {
  font-size: 4rem;
  font-weight: 900;
  line-height: 1;
  margin-bottom: 0.5rem;
}

/* Live Chat Demo Section */
.chat-demo {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4rem;
  align-items: center;
}
.chat-ui {
  background: var(--bg-surface);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  overflow: hidden;
  border: 1px solid rgba(15, 23, 42, 0.05);
}
.chat-header {
  background: var(--grad-primary);
  color: white;
  padding: 1.5rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 1rem;
}
.chat-body {
  padding: 1.5rem;
  height: 300px;
  overflow-y: auto;
  background: var(--bg-surface-alt);
  display: flex;
  flex-direction: column;
  gap: 1rem;
}
.chat-msg {
  max-width: 80%;
  padding: 1rem;
  border-radius: 16px;
  font-size: 0.9rem;
}
.msg-bot {
  background: white;
  align-self: flex-start;
  border-bottom-left-radius: 0;
  box-shadow: var(--shadow-sm);
}
.msg-user {
  background: var(--accent-purple);
  color: white;
  align-self: flex-end;
  border-bottom-right-radius: 0;
}
.chat-input {
  padding: 1.5rem;
  background: white;
  border-top: 1px solid rgba(15, 23, 42, 0.05);
  display: flex;
  gap: 1rem;
}

/* CTA Footer Area */
.cta-section {
  background: var(--grad-primary);
  padding: 6rem 0;
  text-align: center;
  color: white;
}
.cta-section h2 {
  color: white;
}
.cta-section .btn {
  background: white;
  color: var(--text-main);
}
.cta-section .btn:hover {
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
}

/* ==========================================================================
      Subpages (Legal & Contact)
      ========================================================================== */
.page-header {
  padding: 12rem 0 4rem;
  background: var(--bg-dark);
  text-align: center;
  position: relative;
  color: white;
}

.page-header::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 100px;
  background: linear-gradient(to bottom, transparent, var(--bg-base));
}

.page-header h1 {
  color: white;
}
.page-header .text-gradient {
  background: var(--grad-secondary);
  -webkit-background-clip: text;
}

.legal-container {
  background: var(--bg-surface);
  border-radius: var(--radius-lg);
  padding: 4rem;
  box-shadow: var(--shadow-lg);
  margin: -4rem auto 6rem;
  position: relative;
  z-index: 10;
  max-width: 900px;
}

.legal-container h2 {
  font-size: 1.5rem;
  margin: 2rem 0 1rem;
  color: var(--text-main);
}
.legal-container p,
.legal-container ul {
  margin-bottom: 1.5rem;
  color: var(--text-muted);
}
.legal-container ul {
  padding-left: 1.5rem;
  list-style-type: disc;
}

/* Contact Page Specifics */
.contact-wrapper {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4rem;
  margin: -4rem auto 6rem;
  position: relative;
  z-index: 10;
}

.contact-info-card {
  background: var(--grad-primary);
  color: white;
  padding: 4rem;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
}

.contact-info-card h2,
.contact-info-card p {
  color: white;
}

.contact-method {
  display: flex;
  gap: 1.5rem;
  margin-top: 2rem;
  align-items: flex-start;
}

.method-icon {
  width: 50px;
  height: 50px;
  background: rgba(255, 255, 255, 0.2);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  flex-shrink: 0;
}

.contact-form-card {
  background: var(--bg-surface);
  padding: 4rem;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
}

/* ==========================================================================
      Animations & Interactivity (Pure CSS)
      ========================================================================== */
.animate-on-scroll {
  opacity: 0;
  transform: translateY(30px);
  transition: 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}
.animate-on-scroll.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.delay-1 {
  transition-delay: 0.1s;
}
.delay-2 {
  transition-delay: 0.2s;
}
.delay-3 {
  transition-delay: 0.3s;
}

@keyframes float {
  0% {
    transform: translateY(0px);
  }
  50% {
    transform: translateY(-20px);
  }
  100% {
    transform: translateY(0px);
  }
}

.floating {
  animation: float 6s ease-in-out infinite;
}

/* Ribbon Keyframes for Hero SVG */
@keyframes moveRibbon {
  0% {
    transform: translateX(0) scale(1);
  }
  50% {
    transform: translateX(5%) scale(1.05);
  }
  100% {
    transform: translateX(0) scale(1);
  }
}
.ribbon-path {
  animation: moveRibbon 15s infinite alternate ease-in-out;
  transform-origin: center;
}

/* ==========================================================================
      Responsive Design
      ========================================================================== */
@media (max-width: 1024px) {
  .grid-4,
  .grid-3 {
    grid-template-columns: repeat(2, 1fr);
  }
  .hero-visual {
    right: -20%;
    width: 500px;
    height: 500px;
  }
  .contact-wrapper {
    grid-template-columns: 1fr;
    margin-top: 0;
  }
  .legal-container,
  .contact-wrapper {
    padding: 2rem;
    margin-top: 0;
  }
}

@media (max-width: 768px) {
  .grid-2 {
    grid-template-columns: 1fr;
  }
  .nav-list {
    display: none;
  }
  .mobile-toggle {
    display: flex;
  }
  .header-cta {
    display: none;
  }
  .hero {
    flex-direction: column;
    text-align: center;
    padding-top: 8rem;
    min-height: auto;
  }
  .hero-visual {
    position: relative;
    right: auto;
    top: auto;
    transform: none;
    width: 100%;
    height: 400px;
    margin-top: 3rem;
  }
  .hero-actions {
    justify-content: center;
  }
  .footer-top {
    grid-template-columns: 1fr;
    gap: 2rem;
  }
  .case-study,
  .chat-demo {
    grid-template-columns: 1fr;
    text-align: center;
  }
  .case-study:nth-child(even) {
    direction: ltr;
  }
  .calc-wrapper {
    padding: 2rem;
  }
}
