@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800;900&display=swap');

:root {
  --red-primary: #E30613;
  --red-dark: #B3050F;
  --red-light: #FF4D4D;
  --red-glow: rgba(227, 6, 19, 0.3);
  --cyan-primary: #06B6D4;
  --cyan-dark: #0891B2;
  --cyan-light: #22D3EE;
  --cyan-glow: rgba(6, 182, 212, 0.3);
  --white: #FFFFFF;
  --gray-50: #F8F9FA;
  --gray-100: #F0F1F3;
  --gray-200: #E2E4E8;
  --gray-400: #9CA3AF;
  --gray-600: #6B7280;
  --gray-800: #1F2937;
  --gray-900: #111827;
  --dark: #0A0A0F;
  --font: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  --transition: cubic-bezier(0.16, 1, 0.3, 1);
}

*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  font-size: 16px;
  overflow-x: hidden;
}

body {
  font-family: var(--font);
  background: var(--white);
  color: var(--gray-800);
  line-height: 1.6;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

/* ================ NAVBAR ================ */
.navbar {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  z-index: 1000;
  padding: 1.2rem 3rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(17, 24, 39, 0.95);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  transition: all 0.5s var(--transition);
}

.navbar.scrolled {
  padding-block: 1rem;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
}

.nav-logo {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  text-decoration: none;
  color: var(--white);
  font-weight: 800;
  font-size: 1.4rem;
  letter-spacing: -0.02em;
}

.nav-logo-img {
  height: 42px;
  width: auto;
  filter: drop-shadow(0 0 10px var(--red-glow));
  transition: all 0.3s ease;
}

.nav-logo-text {
  font-size: 1.4rem;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.nav-logo:hover .nav-logo-img {
  filter: drop-shadow(0 0 15px rgba(230, 0, 18, 0.5));
  transform: scale(1.05);
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 2.5rem;
  list-style: none;
}

.nav-links a {
  color: rgba(255, 255, 255, 0.7);
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 500;
  letter-spacing: 0.02em;
  transition: color 0.3s ease;
  position: relative;
}

.nav-links a::after {
  content: '';
  position: absolute;
  bottom: -4px;
  left: 0;
  width: 0;
  height: 2px;
  background: var(--red-primary);
  transition: width 0.4s var(--transition);
}

.nav-links a:hover { color: var(--white); }
.nav-links a:hover::after { width: 100%; }

.nav-cta {
  background: var(--cyan-primary) !important;
  color: var(--white) !important;
  padding: 0.6rem 1.6rem;
  border-radius: 50px;
  font-weight: 600;
  transition: all 0.3s ease !important;
  box-shadow: 0 4px 20px var(--cyan-glow);
}

.nav-cta:hover {
  background: var(--cyan-light) !important;
  transform: translateY(-2px);
  box-shadow: 0 8px 30px rgba(6, 182, 212, 0.4) !important;
}

.nav-cta::after { display: none !important; }

/* ================ HERO ================ */
.hero {
  position: relative;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  padding: 6rem 3rem 4rem;
}

.hero-bg {
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, var(--dark) 0%, #150004 40%, #1a0002 60%, var(--dark) 100%);
  z-index: 0;
}

.hero-gradient-orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
  animation: orbFloat 8s ease-in-out infinite;
  z-index: 1;
}

.orb-1 {
  width: 600px;
  height: 600px;
  background: radial-gradient(circle, rgba(230, 0, 18, 0.25) 0%, transparent 70%);
  top: -10%;
  right: -10%;
  animation-delay: 0s;
}

.orb-2 {
  width: 400px;
  height: 400px;
  background: radial-gradient(circle, rgba(200, 0, 10, 0.15) 0%, transparent 70%);
  bottom: -5%;
  left: -5%;
  animation-delay: -3s;
}

.orb-3 {
  width: 300px;
  height: 300px;
  background: radial-gradient(circle, rgba(180, 0, 10, 0.1) 0%, transparent 70%);
  top: 40%;
  left: 30%;
  animation-delay: -5s;
}

@keyframes orbFloat {
  0%, 100% { transform: translate(0, 0) scale(1); }
  33% { transform: translate(30px, -30px) scale(1.05); }
  66% { transform: translate(-20px, 20px) scale(0.95); }
}

.hero-grid {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(230, 0, 18, 0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(230, 0, 18, 0.03) 1px, transparent 1px);
  background-size: 60px 60px;
  z-index: 1;
  mask-image: radial-gradient(ellipse 60% 60% at 50% 50%, black, transparent);
}

#particles-canvas {
  position: absolute;
  inset: 0;
  z-index: 2;
  pointer-events: none;
}

.hero-split {
  position: relative;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 4rem;
  max-width: 1200px;
  width: 100%;
}

.hero-content {
  flex: 1;
  text-align: left;
  max-width: 600px;
}

.hero-box-visual {
  flex: 0 0 auto;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  animation: fadeInUp 1s var(--transition) 0.5s both;
}

.hero-box-img {
  width: 380px;
  height: auto;
  filter: drop-shadow(0 20px 60px rgba(0, 0, 0, 0.5));
  animation: boxFloat 6s ease-in-out infinite;
  position: relative;
  z-index: 2;
}

.hero-logo-img {
  width: 420px;
  height: auto;
  filter: drop-shadow(0 0 50px rgba(230, 0, 18, 0.3)) drop-shadow(0 20px 60px rgba(0, 0, 0, 0.4));
  animation: boxFloat 6s ease-in-out infinite;
  position: relative;
  z-index: 2;
}

.box-glow {
  position: absolute;
  width: 300px;
  height: 300px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(230, 0, 18, 0.2) 0%, transparent 70%);
  filter: blur(40px);
  animation: glowPulse 4s ease-in-out infinite;
  z-index: 1;
}

@keyframes boxFloat {
  0%, 100% { transform: translateY(0) rotate(0deg); }
  25% { transform: translateY(-12px) rotate(1deg); }
  50% { transform: translateY(-5px) rotate(0deg); }
  75% { transform: translateY(-15px) rotate(-1deg); }
}

@keyframes glowPulse {
  0%, 100% { opacity: 0.5; transform: scale(1); }
  50% { opacity: 0.8; transform: scale(1.15); }
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 1.2rem;
  border: 1px solid rgba(230, 0, 18, 0.3);
  border-radius: 50px;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--red-light);
  background: rgba(230, 0, 18, 0.08);
  margin-bottom: 2rem;
  animation: fadeInUp 0.8s var(--transition) both;
}

.hero-badge .dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--red-primary);
  animation: pulse 2s ease-in-out infinite;
}

.hero-title {
  font-size: clamp(3rem, 7vw, 5.5rem);
  font-weight: 900;
  line-height: 1.05;
  letter-spacing: -0.03em;
  margin-bottom: 1.5rem;
  animation: fadeInUp 0.8s var(--transition) 0.2s both;
}

.hero-title .highlight {
  background: linear-gradient(135deg, var(--red-primary), var(--red-light), #FF4040);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero-subtitle {
  font-size: 1.15rem;
  color: rgba(255, 255, 255, 0.6);
  max-width: 520px;
  margin: 0 0 2.5rem;
  font-weight: 400;
  line-height: 1.7;
  animation: fadeInUp 0.8s var(--transition) 0.4s both;
}

.hero-buttons {
  display: flex;
  gap: 1rem;
  justify-content: flex-start;
  flex-wrap: wrap;
  animation: fadeInUp 0.8s var(--transition) 0.6s both;
}

.btn-primary {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 1rem 2.2rem;
  background: linear-gradient(135deg, var(--cyan-primary), var(--cyan-dark));
  color: var(--white);
  border: none;
  border-radius: 60px;
  font-size: 1rem;
  font-weight: 600;
  font-family: var(--font);
  cursor: pointer;
  text-decoration: none;
  transition: all 0.4s var(--transition);
  box-shadow: 0 8px 30px var(--cyan-glow);
  position: relative;
  overflow: hidden;
}

.btn-primary::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, var(--cyan-light), var(--cyan-primary));
  opacity: 0;
  transition: opacity 0.4s ease;
}

.btn-primary:hover {
  transform: translateY(-3px);
  box-shadow: 0 12px 40px rgba(6, 182, 212, 0.5);
}

.btn-primary:hover::before { opacity: 1; }
.btn-primary span { position: relative; z-index: 1; }

.btn-outline {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 1rem 2.2rem;
  background: transparent;
  color: var(--white);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 60px;
  font-size: 1rem;
  font-weight: 500;
  font-family: var(--font);
  cursor: pointer;
  text-decoration: none;
  transition: all 0.4s var(--transition);
  backdrop-filter: blur(10px);
}

.btn-outline:hover {
  border-color: var(--cyan-primary);
  background: rgba(6, 182, 212, 0.08);
  transform: translateY(-3px);
  color: var(--cyan-light);
}

.hero-stats {
  display: flex;
  justify-content: flex-start;
  gap: 3rem;
  margin-top: 3rem;
  animation: fadeInUp 0.8s var(--transition) 0.8s both;
}

.stat { text-align: center; }
.stat-number {
  font-size: 2rem;
  font-weight: 800;
  color: var(--white);
  letter-spacing: -0.02em;
}

.stat-label {
  font-size: 0.8rem;
  color: rgba(255, 255, 255, 0.4);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-top: 0.3rem;
}

/* ================ SECTIONS ================ */
section {
  padding: 7rem 3rem;
  position: relative;
}

.section-header {
  text-align: center;
  margin-bottom: 4rem;
}

.section-tag {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--red-primary);
  margin-bottom: 1rem;
}

.section-title {
  font-size: clamp(2rem, 4vw, 3rem);
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1.15;
  margin-bottom: 1rem;
}

.section-desc {
  font-size: 1.1rem;
  color: rgba(255, 255, 255, 0.5);
  max-width: 550px;
  margin: 0 auto;
}

/* ================ FEATURES ================ */
.features { background: var(--dark); }

.features-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 2rem;
  max-width: 1200px;
  margin: 0 auto;
}

.feature-card {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 20px;
  padding: 2.5rem;
  transition: all 0.5s var(--transition);
  position: relative;
  overflow: hidden;
}

.feature-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, transparent, var(--red-primary), transparent);
  opacity: 0;
  transition: opacity 0.5s ease;
}

.feature-card:hover {
  transform: translateY(-8px);
  border-color: rgba(230, 0, 18, 0.2);
  background: rgba(230, 0, 18, 0.03);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

.feature-card:hover::before { opacity: 1; }

.feature-icon {
  width: 56px;
  height: 56px;
  border-radius: 14px;
  background: rgba(230, 0, 18, 0.1);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 1.5rem;
  font-size: 1.5rem;
  transition: all 0.4s ease;
}

.feature-card:hover .feature-icon {
  background: rgba(230, 0, 18, 0.2);
  transform: scale(1.1);
}

.feature-title {
  font-size: 1.25rem;
  font-weight: 700;
  margin-bottom: 0.8rem;
  letter-spacing: -0.01em;
}

.feature-text {
  font-size: 0.95rem;
  color: rgba(255, 255, 255, 0.5);
  line-height: 1.7;
}

/* ================ HOW IT WORKS ================ */
.how-it-works {
  background: linear-gradient(180deg, var(--dark), #0D0D14, var(--dark));
}

.steps-container {
  max-width: 800px;
  margin: 0 auto;
  position: relative;
}

.steps-line {
  position: absolute;
  left: 28px;
  top: 0;
  bottom: 0;
  width: 2px;
  background: linear-gradient(180deg, var(--red-primary), rgba(230, 0, 18, 0.1));
}

.step {
  display: flex;
  gap: 2rem;
  margin-bottom: 3rem;
  position: relative;
}

.step-number {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--red-primary), var(--red-dark));
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 1.2rem;
  flex-shrink: 0;
  box-shadow: 0 0 30px var(--red-glow);
  z-index: 2;
}

.step-content {
  padding-top: 0.5rem;
}

.step-title {
  font-size: 1.3rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
}

.step-text {
  color: rgba(255, 255, 255, 0.5);
  line-height: 1.7;
}

/* ================ SECURITY ================ */
.security {
  background: var(--dark);
  overflow: hidden;
}

.security-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4rem;
  max-width: 1100px;
  margin: 0 auto;
  align-items: center;
}

.security-visual {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 400px;
}

.shield-container {
  position: relative;
  width: 200px;
  height: 240px;
}

.shield-icon {
  font-size: 10rem;
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  filter: drop-shadow(0 0 40px var(--red-glow));
  animation: shieldPulse 3s ease-in-out infinite;
}

@keyframes shieldPulse {
  0%, 100% { transform: translate(-50%, -50%) scale(1); filter: drop-shadow(0 0 40px var(--red-glow)); }
  50% { transform: translate(-50%, -50%) scale(1.05); filter: drop-shadow(0 0 60px rgba(230, 0, 18, 0.5)); }
}

.shield-ring {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  border: 1px solid rgba(230, 0, 18, 0.15);
  border-radius: 50%;
  animation: ringExpand 4s ease-in-out infinite;
}

.ring-1 { width: 250px; height: 250px; animation-delay: 0s; }
.ring-2 { width: 320px; height: 320px; animation-delay: -1.3s; }
.ring-3 { width: 390px; height: 390px; animation-delay: -2.6s; }

@keyframes ringExpand {
  0%, 100% { opacity: 0.3; transform: translate(-50%, -50%) scale(0.95); }
  50% { opacity: 0.8; transform: translate(-50%, -50%) scale(1.05); }
}

.security-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.security-item {
  display: flex;
  gap: 1rem;
  align-items: flex-start;
  padding: 1.2rem 1.5rem;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: 14px;
  transition: all 0.4s var(--transition);
}

.security-item:hover {
  background: rgba(230, 0, 18, 0.04);
  border-color: rgba(230, 0, 18, 0.15);
  transform: translateX(8px);
}

.security-item-icon {
  font-size: 1.5rem;
  flex-shrink: 0;
}

.security-item h4 {
  font-weight: 700;
  margin-bottom: 0.3rem;
}

.security-item p {
  font-size: 0.9rem;
  color: rgba(255, 255, 255, 0.5);
}

/* ================ CTA ================ */
.cta-section {
  padding: 8rem 3rem;
  text-align: center;
  position: relative;
  overflow: hidden;
}

.cta-bg {
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, var(--red-dark) 0%, var(--red-primary) 50%, var(--red-light) 100%);
  z-index: 0;
}

.cta-bg::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 20% 50%, rgba(255,255,255,0.1) 0%, transparent 50%),
    radial-gradient(circle at 80% 50%, rgba(0,0,0,0.2) 0%, transparent 50%);
}

.cta-content {
  position: relative;
  z-index: 2;
  max-width: 700px;
  margin: 0 auto;
}

.cta-title {
  font-size: clamp(2.5rem, 5vw, 3.5rem);
  font-weight: 900;
  letter-spacing: -0.02em;
  margin-bottom: 1.2rem;
  line-height: 1.1;
}

.cta-text {
  font-size: 1.15rem;
  opacity: 0.85;
  margin-bottom: 2.5rem;
  line-height: 1.7;
}

.btn-white {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 1.1rem 2.5rem;
  background: var(--white);
  color: var(--cyan-primary);
  border: none;
  border-radius: 60px;
  font-size: 1.05rem;
  font-weight: 700;
  font-family: var(--font);
  cursor: pointer;
  text-decoration: none;
  transition: all 0.4s var(--transition);
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.2);
}

.btn-white:hover {
  transform: translateY(-3px) scale(1.03);
  box-shadow: 0 15px 40px rgba(0, 0, 0, 0.3);
}

.cta-box-img {
  display: block;
  width: 260px;
  height: auto;
  margin: 0 auto 2.5rem;
  filter: drop-shadow(0 15px 40px rgba(0, 0, 0, 0.4));
  animation: boxFloat 6s ease-in-out infinite;
}

/* ================ FOOTER ================ */
footer {
  background: var(--gray-900);
  padding: 4rem 3rem 2rem;
  border-top: 1px solid rgba(255, 255, 255, 0.04);
}

.footer-content {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 2rem;
}

.footer-brand {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  text-decoration: none;
  color: var(--white);
  font-weight: 800;
  font-size: 1.2rem;
}

.footer-logo-img {
  height: 36px;
  width: auto;
  opacity: 0.8;
  transition: opacity 0.3s ease;
}

.footer-brand:hover .footer-logo-img {
  opacity: 1;
}

.footer-links {
  display: flex;
  gap: 2rem;
  list-style: none;
}

.footer-links a {
  color: rgba(255, 255, 255, 0.4);
  text-decoration: none;
  font-size: 0.85rem;
  transition: color 0.3s ease;
}

.footer-links a:hover { color: var(--red-primary); }

.footer-bottom {
  max-width: 1200px;
  margin: 3rem auto 0;
  padding-top: 2rem;
  border-top: 1px solid rgba(255, 255, 255, 0.04);
  text-align: center;
  color: rgba(255, 255, 255, 0.25);
  font-size: 0.8rem;
}

/* ================ SCROLL ANIMATIONS ================ */
.reveal {
  opacity: 0;
  transform: translateY(40px);
  transition: opacity 0.8s var(--transition), transform 0.8s var(--transition);
}

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

.reveal-left {
  opacity: 0;
  transform: translateX(-40px);
  transition: opacity 0.8s var(--transition), transform 0.8s var(--transition);
}

.reveal-left.visible {
  opacity: 1;
  transform: translateX(0);
}

.reveal-right {
  opacity: 0;
  transform: translateX(40px);
  transition: opacity 0.8s var(--transition), transform 0.8s var(--transition);
}

.reveal-right.visible {
  opacity: 1;
  transform: translateX(0);
}

@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(30px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.4; }
}

/* ================ MOBILE MENU ================ */
.menu-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 5px;
}

.menu-toggle span {
  display: block;
  width: 24px;
  height: 2px;
  background: var(--white);
  transition: all 0.3s ease;
}

/* ================ RESPONSIVE ================ */
@media (max-width: 968px) {
  .features-grid { grid-template-columns: 1fr; max-width: 500px; }
  .security-grid { grid-template-columns: 1fr; text-align: center; }
  .security-visual { min-height: 300px; }
  .hero-stats { gap: 2rem; }
  .hero-split { flex-direction: column; text-align: center; }
  .hero-content { text-align: center; max-width: 100%; }
  .hero-subtitle { margin: 0 auto 2.5rem; }
  .hero-buttons { justify-content: center; }
  .hero-stats { justify-content: center; }
  .hero-box-img { width: 280px; }
}

@media (max-width: 768px) {
  .navbar { padding: 1rem 1.5rem; }
  .nav-links { display: none; }
  .menu-toggle { display: flex; }
  .hero { padding: 5rem 1.5rem 3rem; }
  section { padding: 4rem 1.5rem; }
  .hero-stats { flex-direction: column; gap: 1.5rem; }
  .hero-buttons { flex-direction: column; align-items: center; }
  .footer-content { flex-direction: column; text-align: center; gap: 1.5rem; }
  .footer-links { flex-wrap: wrap; justify-content: center; gap: 1rem 1.5rem; }
  footer { padding-bottom: 6rem; }
  .cta-section { padding: 5rem 1.5rem; }
  .hero-box-visual { display: none; }
  .nav-logo-img { height: 28px; }

  /* Mobile menu open state */
  .nav-links.mobile-open {
    display: flex !important;
    flex-direction: column;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: rgba(10, 10, 15, 0.95);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    padding: 1.5rem;
    gap: 1.2rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  }
}

/* ================ CHATBOT WIDGET ================ */
#samaritan-chatbot {
  position: fixed;
  bottom: 0;
  right: 0;
  z-index: 9999;
  font-family: var(--font);
}

/* --- Bubble --- */
.chatbot-bubble {
  position: fixed;
  bottom: 24px;
  right: 24px;
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--red-primary), var(--red-dark));
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  box-shadow: 0 8px 32px rgba(230, 0, 18, 0.4);
  transition: all 0.4s var(--transition);
  z-index: 10001;
  overflow: visible;
}

.chatbot-bubble:hover {
  transform: scale(1.1);
  box-shadow: 0 12px 40px rgba(230, 0, 18, 0.5);
}

.chatbot-bubble-icon,
.chatbot-bubble-close {
  position: absolute;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s ease;
}

.chatbot-bubble-icon {
  opacity: 1;
  transform: scale(1) rotate(0deg);
}

.chatbot-bubble-close {
  opacity: 0;
  transform: scale(0.5) rotate(-90deg);
}

.chatbot-bubble.active .chatbot-bubble-icon {
  opacity: 0;
  transform: scale(0.5) rotate(90deg);
}

.chatbot-bubble.active .chatbot-bubble-close {
  opacity: 1;
  transform: scale(1) rotate(0deg);
}

.chatbot-bubble-pulse {
  position: absolute;
  inset: -4px;
  border-radius: 50%;
  background: rgba(230, 0, 18, 0.3);
  animation: chatbotPulse 2.5s ease-in-out infinite;
  z-index: -1;
}

.chatbot-bubble.active .chatbot-bubble-pulse {
  display: none;
}

@keyframes chatbotPulse {
  0%, 100% { transform: scale(1); opacity: 0.5; }
  50% { transform: scale(1.25); opacity: 0; }
}

/* --- Tooltip Speech Bubble (Terminal Style) --- */
.chatbot-tooltip {
  position: fixed;
  bottom: 40px;
  right: 96px;
  background: rgba(10, 5, 5, 0.95);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(230, 0, 18, 0.3);
  color: #ff3333;
  padding: 14px 18px;
  border-radius: 10px;
  font-size: 0.82rem;
  font-weight: 500;
  font-family: 'Courier New', 'Lucida Console', monospace;
  max-width: 280px;
  line-height: 1.6;
  letter-spacing: 0.02em;
  box-shadow:
    0 12px 40px rgba(0, 0, 0, 0.6),
    0 0 20px rgba(230, 0, 18, 0.1),
    inset 0 0 30px rgba(230, 0, 18, 0.03);
  z-index: 10001;
  cursor: pointer;
  opacity: 0;
  transform: translateX(10px);
  pointer-events: none;
  transition: all 0.4s var(--transition);
  overflow: hidden;
}

.chatbot-tooltip::before {
  content: '>';
  color: rgba(230, 0, 18, 0.5);
  margin-right: 6px;
  font-weight: 700;
}

.chatbot-tooltip::after {
  content: '';
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(
    0deg,
    transparent,
    transparent 2px,
    rgba(230, 0, 18, 0.02) 2px,
    rgba(230, 0, 18, 0.02) 4px
  );
  pointer-events: none;
  z-index: 1;
}

.chatbot-tooltip .cursor-blink {
  display: inline-block;
  width: 8px;
  height: 14px;
  background: #ff3333;
  margin-left: 3px;
  vertical-align: text-bottom;
  animation: cursorBlink 0.8s step-end infinite;
}

@keyframes cursorBlink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0; }
}

.chatbot-tooltip.visible {
  opacity: 1;
  transform: translateX(0);
  pointer-events: all;
}

.chatbot-tooltip:hover {
  border-color: rgba(230, 0, 18, 0.5);
  box-shadow:
    0 12px 40px rgba(0, 0, 0, 0.6),
    0 0 30px rgba(230, 0, 18, 0.2);
}

.chatbot-tooltip-arrow {
  position: absolute;
  right: -6px;
  bottom: 16px;
  width: 12px;
  height: 12px;
  background: rgba(10, 5, 5, 0.95);
  border-right: 1px solid rgba(230, 0, 18, 0.3);
  border-bottom: 1px solid rgba(230, 0, 18, 0.3);
  transform: rotate(-45deg);
  z-index: 0;
}

@media (max-width: 480px) {
  .chatbot-tooltip {
    right: 16px;
    bottom: 80px;
    max-width: calc(100vw - 32px);
  }
  .chatbot-tooltip-arrow {
    display: none;
  }
}

/* --- Panel --- */
.chatbot-panel {
  position: fixed;
  bottom: 100px;
  right: 24px;
  width: 400px;
  max-height: 560px;
  background: rgba(14, 14, 20, 0.96);
  backdrop-filter: blur(24px) saturate(180%);
  -webkit-backdrop-filter: blur(24px) saturate(180%);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 20px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow:
    0 24px 80px rgba(0, 0, 0, 0.6),
    0 0 0 1px rgba(230, 0, 18, 0.1);
  opacity: 0;
  transform: translateY(20px) scale(0.95);
  pointer-events: none;
  transition: all 0.4s var(--transition);
  z-index: 10000;
}

.chatbot-panel.open {
  opacity: 1;
  transform: translateY(0) scale(1);
  pointer-events: all;
}

/* --- Header --- */
.chatbot-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  background: rgba(230, 0, 18, 0.08);
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.chatbot-header-info {
  display: flex;
  align-items: center;
  gap: 12px;
}

.chatbot-avatar {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  background: linear-gradient(135deg, var(--red-primary), var(--red-dark));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  color: white;
  flex-shrink: 0;
  position: relative;
}

.chatbot-avatar-dot {
  position: absolute;
  bottom: -2px;
  right: -2px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: #22c55e;
  border: 2px solid rgba(14, 14, 20, 0.96);
}

.chatbot-header-name {
  font-weight: 700;
  font-size: 0.95rem;
  color: var(--white);
  letter-spacing: -0.01em;
}

.chatbot-header-status {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 0.72rem;
  color: rgba(255, 255, 255, 0.45);
  font-weight: 500;
}

.chatbot-status-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #22c55e;
  animation: pulse 2s ease-in-out infinite;
}

.chatbot-close-btn {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  border: none;
  background: rgba(255, 255, 255, 0.06);
  color: rgba(255, 255, 255, 0.5);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s ease;
}

.chatbot-close-btn:hover {
  background: rgba(255, 255, 255, 0.1);
  color: white;
}

/* --- Messages --- */
.chatbot-messages {
  flex: 1;
  overflow-y: auto;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  min-height: 200px;
  max-height: 300px;
  scrollbar-width: thin;
  scrollbar-color: rgba(255,255,255,0.1) transparent;
}

.chatbot-messages::-webkit-scrollbar {
  width: 4px;
}

.chatbot-messages::-webkit-scrollbar-track {
  background: transparent;
}

.chatbot-messages::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.1);
  border-radius: 4px;
}

.chatbot-message {
  display: flex;
  animation: chatMsgIn 0.3s var(--transition) both;
}

@keyframes chatMsgIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

.chatbot-message.user {
  justify-content: flex-end;
}

.chatbot-message-content {
  max-width: 82%;
  padding: 10px 14px;
  border-radius: 14px;
  font-size: 0.88rem;
  line-height: 1.55;
  color: var(--white);
}

.chatbot-message.bot .chatbot-message-content {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-bottom-left-radius: 4px;
  color: rgba(255, 255, 255, 0.85);
}

.chatbot-message.user .chatbot-message-content {
  background: linear-gradient(135deg, var(--red-primary), var(--red-dark));
  border-bottom-right-radius: 4px;
  color: white;
}

/* --- Typing Indicator --- */
.chatbot-typing {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 14px 18px !important;
}

.typing-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.4);
  animation: typingBounce 1.4s ease-in-out infinite;
}

.typing-dot:nth-child(2) { animation-delay: 0.15s; }
.typing-dot:nth-child(3) { animation-delay: 0.3s; }

@keyframes typingBounce {
  0%, 60%, 100% { transform: translateY(0); opacity: 0.4; }
  30% { transform: translateY(-6px); opacity: 1; }
}

/* --- Quick Actions --- */
.chatbot-quick-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 0 20px 10px;
}

.chatbot-quick-btn {
  padding: 6px 12px;
  border-radius: 20px;
  border: 1px solid rgba(230, 0, 18, 0.25);
  background: rgba(230, 0, 18, 0.06);
  color: var(--red-light);
  font-size: 0.75rem;
  font-weight: 600;
  font-family: var(--font);
  cursor: pointer;
  transition: all 0.3s ease;
  white-space: nowrap;
}

.chatbot-quick-btn:hover {
  background: rgba(230, 0, 18, 0.15);
  border-color: var(--red-primary);
  transform: translateY(-1px);
}

/* --- Input Area --- */
.chatbot-input-area {
  padding: 12px 16px 10px;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.chatbot-input-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 14px;
  padding: 4px 6px 4px 16px;
  transition: border-color 0.3s ease;
}

.chatbot-input-wrap:focus-within {
  border-color: rgba(230, 0, 18, 0.4);
}

.chatbot-input {
  flex: 1;
  background: none;
  border: none;
  outline: none;
  color: var(--white);
  font-size: 0.9rem;
  font-family: var(--font);
  padding: 10px 0;
}

.chatbot-input::placeholder {
  color: rgba(255, 255, 255, 0.3);
}

.chatbot-send-btn {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  border: none;
  background: linear-gradient(135deg, var(--cyan-primary), var(--cyan-dark));
  color: white;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: all 0.3s ease;
}

.chatbot-send-btn:hover:not(:disabled) {
  transform: scale(1.05);
  box-shadow: 0 4px 15px rgba(6, 182, 212, 0.4);
}

.chatbot-send-btn:disabled {
  cursor: not-allowed;
}

.chatbot-disclaimer {
  text-align: center;
  font-size: 0.65rem;
  color: rgba(255, 255, 255, 0.2);
  margin-top: 8px;
  font-weight: 500;
}

/* --- Chatbot Responsive --- */
@media (max-width: 480px) {
  .chatbot-panel {
    right: 0;
    bottom: 0;
    left: 0;
    width: 100%;
    max-height: 100vh;
    max-height: 100dvh;
    border-radius: 20px 20px 0 0;
  }

  .chatbot-panel.open {
    bottom: 0;
  }

  .chatbot-messages {
    max-height: calc(100vh - 250px);
    max-height: calc(100dvh - 250px);
  }

  .chatbot-bubble {
    bottom: 16px;
    right: 16px;
    width: 54px;
    height: 54px;
  }
}
