/* ==========================================================================
   CSS Custom Properties & Theme Setup
   ========================================================================== */
:root {
  /* Color Palette based on Dark Theme with Cyan/Purple Highlights */
  --bg-color: #050914;
  --bg-secondary: #0a1128;
  --bg-tertiary: #121c3a;
  --primary-color: #00e5ff;
  --primary-glow: rgba(0, 229, 255, 0.4);
  --secondary-color: #9d4edd;
  --secondary-glow: rgba(157, 78, 221, 0.4);
  --text-main: #f8f9fa;
  --text-muted: #a0abbf;
  --border-color: #1f2d50;
  --success: #00e676;
  --danger: #ff1744;
  --font-heading: 'Inter', system-ui, -apple-system, sans-serif;
  --font-body: 'Roboto', system-ui, -apple-system, sans-serif;
  --header-height: 90px;
  --transition-fast: 0.2s ease;
  --transition-normal: 0.4s cubic-bezier(0.25, 0.8, 0.25, 1);
  --transition-slow: 0.8s cubic-bezier(0.25, 0.8, 0.25, 1);
}

/* ==========================================================================
   Reset & Base Styles
   ========================================================================== */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  font-size: 16px;
}

body {
  font-family: var(--font-body);
  background-color: var(--bg-color);
  color: var(--text-main);
  line-height: 1.6;
  overflow-x: hidden;
}

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-heading);
  font-weight: 700;
  line-height: 1.2;
  margin-bottom: 1rem;
}

a {
  text-decoration: none;
  color: var(--text-main);
  transition: var(--transition-fast);
}

ul {
  list-style: none;
}

img {
  max-width: 100%;
  display: block;
}

/* Scrollbar Styling */
::-webkit-scrollbar {
  width: 10px;
}
::-webkit-scrollbar-track {
  background: var(--bg-color);
}
::-webkit-scrollbar-thumb {
  background: var(--bg-tertiary);
  border-radius: 5px;
}
::-webkit-scrollbar-thumb:hover {
  background: var(--primary-color);
}

/* Selection */
::selection {
  background: var(--primary-color);
  color: #000;
}

/* ==========================================================================
   Typography & Utilities
   ========================================================================== */
.section-title {
  font-size: 3rem;
  text-align: center;
  margin-bottom: 1rem;
  background: linear-gradient(90deg, var(--primary-color), var(--secondary-color));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  position: relative;
  display: inline-block;
  left: 50%;
  transform: translateX(-50%);
}

.section-subtitle {
  text-align: center;
  color: var(--text-muted);
  font-size: 1.1rem;
  max-width: 600px;
  margin: 0 auto 4rem;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.8rem 2rem;
  border-radius: 50px;
  font-weight: 600;
  cursor: pointer;
  border: none;
  transition: var(--transition-normal);
  font-family: var(--font-heading);
  text-transform: uppercase;
  letter-spacing: 1px;
  font-size: 0.9rem;
  position: relative;
  overflow: hidden;
}

.btn-primary {
  background: linear-gradient(45deg, var(--primary-color), var(--secondary-color));
  color: #fff;
  box-shadow: 0 4px 15px var(--primary-glow);
}

.btn-primary:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 25px var(--primary-glow);
}

.btn-secondary {
  background: transparent;
  color: var(--primary-color);
  border: 2px solid var(--primary-color);
}

.btn-secondary:hover {
  background: var(--primary-color);
  color: #000;
}

.container {
  width: 90%;
  max-width: 1400px;
  margin: 0 auto;
}

.section-padding {
  padding: 6rem 0;
}

/* ==========================================================================
   Animations & Keyframes
   ========================================================================== */
@keyframes float {
  0% { transform: translateY(0px) rotate(0deg); }
  50% { transform: translateY(-20px) rotate(2deg); }
  100% { transform: translateY(0px) rotate(0deg); }
}

@keyframes pulseGlow {
  0% { box-shadow: 0 0 0 0 var(--primary-glow); }
  70% { box-shadow: 0 0 20px 15px rgba(0, 229, 255, 0); }
  100% { box-shadow: 0 0 0 0 rgba(0, 229, 255, 0); }
}

@keyframes slideUpFade {
  0% { opacity: 0; transform: translateY(50px); }
  100% { opacity: 1; transform: translateY(0); }
}

@keyframes drawLine {
  to { stroke-dashoffset: 0; }
}

.reveal {
  opacity: 0;
  transform: translateY(40px);
  transition: var(--transition-slow);
}

.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}

/* ==========================================================================
   Strict Site Header (Consistent Across All Pages)
   ========================================================================== */
.site-header {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: var(--header-height);
  background: rgba(5, 9, 20, 0.95);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border-color);
  z-index: 1000;
  transition: var(--transition-fast);
}

.site-header.scrolled {
  height: 70px;
  box-shadow: 0 5px 20px rgba(0,0,0,0.5);
}

.header-container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  height: 100%;
}

.header-logo img {
  height: 50px;
  width: auto;
  transition: var(--transition-fast);
}

.header-nav ul {
  display: flex;
  gap: 2.5rem;
}

.header-nav a {
  font-size: 1rem;
  font-weight: 500;
  position: relative;
  padding: 0.5rem 0;
}

.header-nav a::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 0;
  height: 2px;
  background: var(--primary-color);
  transition: var(--transition-normal);
}

.header-nav a:hover::after {
  width: 100%;
}

.header-nav a:hover {
  color: var(--primary-color);
}

.mobile-menu-btn {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  flex-direction: column;
  gap: 5px;
}

.mobile-menu-btn span {
  width: 30px;
  height: 3px;
  background: var(--text-main);
  transition: var(--transition-fast);
}

/* ==========================================================================
   Hero Section (Index Page)
   ========================================================================== */
.hero-section {
  padding-top: calc(var(--header-height) + 4rem);
  min-height: 100vh;
  display: flex;
  align-items: center;
  position: relative;
  overflow: hidden;
}

.hero-bg-elements {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: -1;
  overflow: hidden;
}

.hero-sphere {
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
  opacity: 0.5;
}

.sphere-1 {
  width: 400px;
  height: 400px;
  background: var(--primary-color);
  top: -100px;
  right: -100px;
  animation: float 8s infinite ease-in-out;
}

.sphere-2 {
  width: 300px;
  height: 300px;
  background: var(--secondary-color);
  bottom: -50px;
  left: -100px;
  animation: float 10s infinite ease-in-out reverse;
}

.hero-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4rem;
  align-items: center;
}

.hero-content h1 {
  font-size: 4rem;
  margin-bottom: 1.5rem;
  background: linear-gradient(to right, #fff, var(--primary-color));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.hero-content p {
  font-size: 1.2rem;
  color: var(--text-muted);
  margin-bottom: 2.5rem;
}

.hero-buttons {
  display: flex;
  gap: 1.5rem;
}

/* 3D Dashboard Element in Hero */
.hero-3d-visual {
  perspective: 1000px;
}

.dashboard-mockup {
  background: rgba(10, 17, 40, 0.8);
  border: 1px solid var(--border-color);
  border-radius: 15px;
  padding: 20px;
  transform: rotateY(-15deg) rotateX(10deg);
  box-shadow: -20px 30px 50px rgba(0,0,0,0.5);
  transition: transform 0.5s ease;
  backdrop-filter: blur(5px);
}

.hero-3d-visual:hover .dashboard-mockup {
  transform: rotateY(-5deg) rotateX(5deg);
}

.mockup-header {
  display: flex;
  gap: 8px;
  margin-bottom: 20px;
}

.mockup-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--border-color);
}
.mockup-dot:nth-child(1) { background: #ff5f56; }
.mockup-dot:nth-child(2) { background: #ffbd2e; }
.mockup-dot:nth-child(3) { background: #27c93f; }

.mockup-body {
  display: flex;
  flex-direction: column;
  gap: 15px;
}

.mockup-bar {
  height: 20px;
  background: var(--bg-tertiary);
  border-radius: 10px;
  overflow: hidden;
  position: relative;
}

.mockup-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--primary-color), var(--secondary-color));
  width: 0;
  animation: fillBar 2s forwards 1s;
}

@keyframes fillBar {
  to { width: var(--w); }
}

/* ==========================================================================
   Services Section (3D Tilt Cards)
   ========================================================================== */
.services-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 2rem;
}

.service-card {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: 15px;
  padding: 2.5rem 2rem;
  position: relative;
  overflow: hidden;
  transform-style: preserve-3d;
  transition: transform 0.1s ease, box-shadow 0.3s ease;
  cursor: pointer;
}

.service-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 4px;
  background: linear-gradient(90deg, var(--primary-color), var(--secondary-color));
  transform: scaleX(0);
  transform-origin: left;
  transition: transform var(--transition-normal);
}

.service-card:hover::before {
  transform: scaleX(1);
}

.service-icon {
  width: 60px;
  height: 60px;
  background: rgba(0, 229, 255, 0.1);
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 1.5rem;
  color: var(--primary-color);
  transform: translateZ(30px);
}

.service-icon svg {
  width: 30px;
  height: 30px;
  fill: currentColor;
}

.service-card h3 {
  font-size: 1.5rem;
  margin-bottom: 1rem;
  transform: translateZ(20px);
}

.service-card p {
  color: var(--text-muted);
  transform: translateZ(10px);
}

/* ==========================================================================
   Interactive ROI Calculator Section
   ========================================================================== */
.calculator-section {
  background: var(--bg-secondary);
  border-top: 1px solid var(--border-color);
  border-bottom: 1px solid var(--border-color);
}

.calc-container {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4rem;
  background: var(--bg-tertiary);
  padding: 3rem;
  border-radius: 20px;
  box-shadow: 0 20px 40px rgba(0,0,0,0.3);
}

.calc-controls {
  display: flex;
  flex-direction: column;
  gap: 2rem;
}

.calc-group {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.calc-group label {
  display: flex;
  justify-content: space-between;
  font-weight: 600;
  color: var(--text-main);
}

.calc-group span {
  color: var(--primary-color);
}

input[type=range] {
  -webkit-appearance: none;
  width: 100%;
  background: transparent;
}

input[type=range]::-webkit-slider-thumb {
  -webkit-appearance: none;
  height: 20px;
  width: 20px;
  border-radius: 50%;
  background: var(--primary-color);
  cursor: pointer;
  margin-top: -8px;
  box-shadow: 0 0 10px var(--primary-glow);
}

input[type=range]::-webkit-slider-runnable-track {
  width: 100%;
  height: 4px;
  cursor: pointer;
  background: var(--border-color);
  border-radius: 2px;
}

.calc-results {
  background: var(--bg-color);
  padding: 2rem;
  border-radius: 15px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
  border: 1px solid var(--primary-color);
  box-shadow: inset 0 0 20px var(--primary-glow);
}

.result-item {
  margin-bottom: 2rem;
}

.result-item:last-child {
  margin-bottom: 0;
}

.result-title {
  font-size: 1.1rem;
  color: var(--text-muted);
  margin-bottom: 0.5rem;
}

.result-value {
  font-size: 3.5rem;
  font-weight: 700;
  font-family: var(--font-heading);
  color: var(--primary-color);
  text-shadow: 0 0 10px var(--primary-glow);
}

/* ==========================================================================
   Industry Tabs Section
   ========================================================================== */
.industry-tabs {
  display: flex;
  justify-content: center;
  gap: 1rem;
  margin-bottom: 3rem;
  flex-wrap: wrap;
}

.tab-btn {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  color: var(--text-main);
  padding: 0.8rem 2rem;
  border-radius: 30px;
  cursor: pointer;
  transition: var(--transition-fast);
  font-family: var(--font-heading);
  font-weight: 600;
}

.tab-btn.active, .tab-btn:hover {
  background: var(--primary-color);
  color: #000;
  border-color: var(--primary-color);
}

.tab-content {
  display: none;
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: 15px;
  padding: 3rem;
  animation: slideUpFade 0.5s ease;
}

.tab-content.active {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 3rem;
  align-items: center;
}

.tab-image {
  background: var(--bg-tertiary);
  height: 300px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
}

.tab-image svg {
  width: 100px;
  height: 100px;
  fill: var(--primary-color);
  opacity: 0.5;
}

/* ==========================================================================
   Campaign Reports Section (Pure CSS Charts)
   ========================================================================== */
.reports-section {
  background: var(--bg-secondary);
}

.chart-container {
  background: var(--bg-tertiary);
  border: 1px solid var(--border-color);
  border-radius: 15px;
  padding: 2rem;
  display: flex;
  align-items: flex-end;
  height: 400px;
  gap: 2%;
  position: relative;
}

.chart-y-axis {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  height: 100%;
  padding-bottom: 30px;
  color: var(--text-muted);
  font-size: 0.8rem;
  width: 40px;
}

.chart-bar-wrapper {
  flex: 1;
  height: calc(100% - 30px);
  display: flex;
  align-items: flex-end;
  justify-content: center;
  position: relative;
  group: hover;
}

.chart-bar {
  width: 60%;
  background: linear-gradient(to top, var(--secondary-color), var(--primary-color));
  border-radius: 5px 5px 0 0;
  position: relative;
  transition: var(--transition-normal);
  cursor: pointer;
  height: 0; /* Animated via JS or CSS */
}

.chart-bar:hover {
  filter: brightness(1.2);
  box-shadow: 0 0 15px var(--primary-glow);
}

.chart-tooltip {
  position: absolute;
  top: -40px;
  left: 50%;
  transform: translateX(-50%);
  background: #fff;
  color: #000;
  padding: 5px 10px;
  border-radius: 4px;
  font-size: 0.8rem;
  font-weight: bold;
  opacity: 0;
  transition: opacity 0.2s;
  pointer-events: none;
  white-space: nowrap;
}

.chart-bar:hover .chart-tooltip {
  opacity: 1;
}

.chart-label {
  position: absolute;
  bottom: -30px;
  left: 50%;
  transform: translateX(-50%);
  color: var(--text-muted);
  font-size: 0.9rem;
}

/* ==========================================================================
   Testimonials Section
   ========================================================================== */
.testimonials-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 2rem;
}

.testimonial-card {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  padding: 2rem;
  border-radius: 15px;
  position: relative;
}

.testimonial-card::before {
  content: '"';
  position: absolute;
  top: -10px;
  left: 20px;
  font-size: 6rem;
  color: rgba(0, 229, 255, 0.1);
  font-family: serif;
  line-height: 1;
}

.client-info {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-top: 1.5rem;
}

.client-avatar {
  width: 50px;
  height: 50px;
  border-radius: 50%;
  background: var(--primary-color);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: bold;
  color: #000;
}

/* ==========================================================================
   Contact / CTA Section
   ========================================================================== */
.contact-section {
  background: linear-gradient(135deg, var(--bg-tertiary), var(--bg-color));
  position: relative;
  overflow: hidden;
}

.contact-form-container {
  max-width: 800px;
  margin: 0 auto;
  background: var(--bg-secondary);
  padding: 3rem;
  border-radius: 15px;
  border: 1px solid var(--border-color);
  box-shadow: 0 10px 30px rgba(0,0,0,0.5);
}

.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
  margin-bottom: 1.5rem;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.form-group.full-width {
  grid-column: 1 / -1;
}

.form-control {
  background: var(--bg-color);
  border: 1px solid var(--border-color);
  color: var(--text-main);
  padding: 1rem;
  border-radius: 8px;
  font-family: var(--font-body);
  font-size: 1rem;
  transition: var(--transition-fast);
}

.form-control:focus {
  outline: none;
  border-color: var(--primary-color);
  box-shadow: 0 0 10px var(--primary-glow);
}

textarea.form-control {
  resize: vertical;
  min-height: 150px;
}

/* ==========================================================================
   Live Chat Widget
   ========================================================================== */
.chat-widget {
  position: fixed;
  bottom: 30px;
  right: 30px;
  z-index: 1000;
}

.chat-toggle {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: var(--primary-color);
  color: #000;
  border: none;
  cursor: pointer;
  box-shadow: 0 5px 15px var(--primary-glow);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition-normal);
  animation: pulseGlow 2s infinite;
}

.chat-toggle:hover {
  transform: scale(1.1);
}

.chat-toggle svg {
  width: 30px;
  height: 30px;
  fill: currentColor;
}

.chat-window {
  position: absolute;
  bottom: 80px;
  right: 0;
  width: 350px;
  height: 450px;
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: 15px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: 0 10px 30px rgba(0,0,0,0.5);
  opacity: 0;
  pointer-events: none;
  transform: translateY(20px);
  transition: var(--transition-normal);
}

.chat-window.open {
  opacity: 1;
  pointer-events: all;
  transform: translateY(0);
}

.chat-header {
  background: var(--primary-color);
  color: #000;
  padding: 1rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-weight: bold;
}

.chat-close {
  background: none;
  border: none;
  color: #000;
  font-size: 1.5rem;
  cursor: pointer;
}

.chat-body {
  flex: 1;
  padding: 1rem;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.chat-msg {
  max-width: 80%;
  padding: 0.8rem;
  border-radius: 10px;
  font-size: 0.9rem;
}

.msg-agent {
  background: var(--bg-tertiary);
  align-self: flex-start;
  border-bottom-left-radius: 0;
}

.msg-user {
  background: var(--primary-color);
  color: #000;
  align-self: flex-end;
  border-bottom-right-radius: 0;
}

.chat-input {
  display: flex;
  padding: 1rem;
  border-top: 1px solid var(--border-color);
  background: var(--bg-color);
}

.chat-input input {
  flex: 1;
  background: none;
  border: none;
  color: var(--text-main);
  outline: none;
}

.chat-input button {
  background: none;
  border: none;
  color: var(--primary-color);
  cursor: pointer;
  font-weight: bold;
}

/* ==========================================================================
   Legal Pages Specific Styling
   ========================================================================== */
.legal-header {
  padding-top: calc(var(--header-height) + 4rem);
  text-align: center;
  margin-bottom: 3rem;
}

.legal-content {
  background: var(--bg-secondary);
  padding: 4rem;
  border-radius: 15px;
  border: 1px solid var(--border-color);
  margin-bottom: 4rem;
}

.legal-content h2 {
  color: var(--primary-color);
  margin-top: 2.5rem;
  margin-bottom: 1rem;
}

.legal-content p {
  margin-bottom: 1.5rem;
  color: var(--text-muted);
}

.legal-content ul {
  margin-bottom: 1.5rem;
  padding-left: 1.5rem;
  color: var(--text-muted);
  list-style-type: disc;
}

/* ==========================================================================
   Strict Site Footer (Consistent Across All Pages)
   ========================================================================== */
.site-footer {
  background: #020611;
  border-top: 1px solid var(--border-color);
  padding: 5rem 0 2rem;
  margin-top: auto;
}

.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1.5fr;
  gap: 3rem;
  margin-bottom: 3rem;
}

.footer-brand img {
  height: 50px;
  margin-bottom: 1.5rem;
}

.footer-brand p {
  color: var(--text-muted);
  margin-bottom: 1.5rem;
  max-width: 300px;
}

.footer-heading {
  font-size: 1.2rem;
  color: #fff;
  margin-bottom: 1.5rem;
  position: relative;
  padding-bottom: 0.5rem;
}

.footer-heading::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 40px;
  height: 2px;
  background: var(--primary-color);
}

.footer-links li {
  margin-bottom: 0.8rem;
}

.footer-links a {
  color: var(--text-muted);
}

.footer-links a:hover {
  color: var(--primary-color);
  padding-left: 5px;
}

.footer-contact li {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  color: var(--text-muted);
  margin-bottom: 1rem;
}

.footer-contact svg {
  width: 20px;
  height: 20px;
  fill: var(--primary-color);
  flex-shrink: 0;
}

.footer-bottom {
  text-align: center;
  padding-top: 2rem;
  border-top: 1px solid var(--border-color);
  color: var(--text-muted);
  font-size: 0.9rem;
}

/* ==========================================================================
   Responsive Design Media Queries
   ========================================================================== */
@media (max-width: 1024px) {
  .hero-grid, .calc-container, .tab-content.active, .form-grid {
    grid-template-columns: 1fr;
  }
  .hero-3d-visual {
    order: -1;
    max-width: 500px;
    margin: 0 auto;
  }
  .footer-grid {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 768px) {
  .header-nav {
    position: fixed;
    top: var(--header-height);
    left: -100%;
    width: 100%;
    height: calc(100vh - var(--header-height));
    background: var(--bg-color);
    flex-direction: column;
    justify-content: center;
    align-items: center;
    transition: var(--transition-normal);
  }
  .header-nav.active {
    left: 0;
  }
  .header-nav ul {
    flex-direction: column;
    text-align: center;
    gap: 2rem;
  }
  .mobile-menu-btn {
    display: flex;
  }
  .section-title {
    font-size: 2.2rem;
  }
  .hero-content h1 {
    font-size: 2.5rem;
  }
  .footer-grid {
    grid-template-columns: 1fr;
  }
  .legal-content {
    padding: 2rem;
  }
}