/* ============================================================
   DESIGN SYSTEM – Dark Futuristic Portfolio
   ============================================================ */

:root {
  --bg-primary: #07080c;
  --bg-secondary: #0d0f16;
  --bg-card: rgba(10, 12, 22, 0.88);
  --text-primary: #e8eaf0;
  --text-secondary: #8a90a4;
  --text-muted: #555b72;
  --accent: #00d4ff;
  --accent-alt: #7b61ff;
  --accent-glow: rgba(0, 212, 255, 0.25);
  --accent-gradient: linear-gradient(135deg, #00d4ff 0%, #7b61ff 100%);
  --border: rgba(255, 255, 255, 0.06);
  --border-hover: rgba(0, 212, 255, 0.3);
  --font-body: "Inter", -apple-system, BlinkMacSystemFont, sans-serif;
  --font-mono: "JetBrains Mono", "Fira Code", monospace;
  --section-padding: clamp(80px, 10vw, 140px);
  --container-max: 1200px;
  --ease-out-expo: cubic-bezier(0.16, 1, 0.3, 1);
  --transition-fast: 200ms var(--ease-out-expo);
  --transition-med: 400ms var(--ease-out-expo);
  --transition-slow: 800ms var(--ease-out-expo);
}

/* RESET */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; scrollbar-width: thin; scrollbar-color: var(--accent) var(--bg-secondary); }
body { font-family: var(--font-body); background: var(--bg-primary); color: var(--text-primary); line-height: 1.7; overflow-x: hidden; -webkit-font-smoothing: antialiased; }
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: var(--bg-secondary); }
::-webkit-scrollbar-thumb { background: var(--accent); border-radius: 3px; }
::selection { background: var(--accent); color: var(--bg-primary); }
a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
.container { max-width: var(--container-max); margin: 0 auto; padding: 0 clamp(20px, 4vw, 48px); }

/* ============================================================
   SCROLL PROGRESS BAR
   ============================================================ */
.scroll-progress {
  position: fixed;
  top: 0;
  left: 0;
  height: 3px;
  width: 0%;
  background: var(--accent-gradient);
  z-index: 10000;
  transition: width 0.05s linear;
  box-shadow: 0 0 10px var(--accent-glow), 0 0 20px var(--accent-glow);
}

/* ============================================================
   FIXED BACKGROUND CANVAS
   ============================================================ */
.scroll-canvas {
  position: fixed; top: 0; left: 0; width: 100%; height: 100%;
  z-index: 0; pointer-events: none;
  will-change: transform;
}

.page-content { position: relative; z-index: 1; }

/* ============================================================
   NAVBAR
   ============================================================ */
.navbar {
  position: fixed; top: 0; left: 0; right: 0; z-index: 1000;
  padding: 16px 0;
  transition: background var(--transition-med), padding var(--transition-med);
}
.navbar.scrolled {
  background: rgba(7, 8, 12, 0.82);
  backdrop-filter: blur(20px) saturate(1.4);
  -webkit-backdrop-filter: blur(20px) saturate(1.4);
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
}
.nav-container {
  max-width: var(--container-max); margin: 0 auto;
  padding: 0 clamp(20px, 4vw, 48px);
  display: flex; align-items: center; justify-content: space-between;
}
.nav-logo { font-size: 1.5rem; font-weight: 800; letter-spacing: -0.02em; }
.logo-dot { color: var(--accent); }
.nav-links { display: flex; list-style: none; gap: 8px; }
.nav-link {
  padding: 8px 18px; font-size: 0.85rem; font-weight: 500;
  color: var(--text-secondary); border-radius: 8px;
  transition: all var(--transition-fast); position: relative;
  display: inline-block; /* needed for magnetic transform */
}
.nav-link:hover { color: var(--text-primary); background: rgba(255, 255, 255, 0.04); }
.nav-link--cta { background: var(--accent-gradient); color: var(--bg-primary) !important; font-weight: 600; }
.nav-link--cta:hover { box-shadow: 0 0 24px var(--accent-glow); transform: translateY(-1px); }
.nav-toggle { display: none; flex-direction: column; gap: 5px; background: none; border: none; cursor: pointer; padding: 4px; }
.nav-toggle span { width: 24px; height: 2px; background: var(--text-primary); border-radius: 2px; transition: all var(--transition-fast); }

/* ============================================================
   HERO SECTION
   ============================================================ */
.hero-section { position: relative; width: 100%; height: 100vh; overflow: hidden; background: transparent; }
.physics-canvas { position: absolute; top: 0; left: 0; width: 100%; height: 100%; z-index: 2; pointer-events: none; will-change: transform; }

.hero-overlay {
  position: absolute; top: 0; left: 0; width: 100%; height: 100%;
  z-index: 3; display: flex; flex-direction: column;
  justify-content: center; align-items: center; text-align: center;
  pointer-events: none;
  background: radial-gradient(ellipse at center, transparent 30%, rgba(7, 8, 12, 0.35) 100%);
  transition: opacity 0.3s ease;
}
.hero-content { pointer-events: auto; }

/* Terminal Typed Intro */
.terminal-line {
  font-family: var(--font-mono); font-size: clamp(0.85rem, 1.3vw, 1rem);
  color: var(--accent); margin-bottom: 16px;
  display: flex; align-items: center; justify-content: center; gap: 8px;
  opacity: 0; animation: heroFadeUp 0.6s var(--ease-out-expo) 0.3s forwards;
}
.terminal-prompt { color: #28c840; font-weight: 600; }
.terminal-cursor {
  color: var(--accent); font-weight: 300;
  animation: blink 0.8s step-end infinite;
}
@keyframes blink { 50% { opacity: 0; } }

.hero-name {
  font-size: clamp(2.8rem, 7vw, 5.5rem); font-weight: 900;
  letter-spacing: -0.03em; line-height: 1.05; margin-bottom: 16px;
  background: linear-gradient(135deg, #ffffff 0%, #b0b8d0 60%, var(--accent) 100%);
  -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text;
  opacity: 0; transform: translateY(30px);
  animation: heroFadeUp 1s var(--ease-out-expo) 1.8s forwards;
}
.hero-title {
  font-size: clamp(0.95rem, 1.8vw, 1.25rem); color: var(--text-secondary); font-weight: 400;
  margin-bottom: 40px; opacity: 0; transform: translateY(20px);
  animation: heroFadeUp 0.8s var(--ease-out-expo) 2.2s forwards;
}
.hero-sep { color: var(--accent); margin: 0 6px; }
.hero-cta-group {
  display: flex; gap: 16px; justify-content: center;
  opacity: 0; transform: translateY(20px);
  animation: heroFadeUp 0.8s var(--ease-out-expo) 2.5s forwards;
}

.scroll-hint {
  position: absolute; bottom: 40px;
  display: flex; flex-direction: column; align-items: center; gap: 8px;
  opacity: 0; animation: heroFadeUp 0.8s var(--ease-out-expo) 3s forwards;
  pointer-events: auto; transition: opacity 0.4s ease;
}
.scroll-hint span { font-size: 0.7rem; text-transform: uppercase; letter-spacing: 0.2em; color: var(--text-muted); }
.scroll-arrow {
  width: 20px; height: 20px;
  border-right: 2px solid var(--accent); border-bottom: 2px solid var(--accent);
  transform: rotate(45deg); animation: scrollBounce 2s ease-in-out infinite;
}
@keyframes scrollBounce {
  0%, 100% { transform: translateY(0) rotate(45deg); opacity: 0.4; }
  50% { transform: translateY(8px) rotate(45deg); opacity: 1; }
}
@keyframes heroFadeUp { to { opacity: 1; transform: translateY(0); } }

/* ============================================================
   PRELOADER – SVG Circle
   ============================================================ */
.loading-overlay {
  position: absolute; inset: 0; z-index: 100;
  background: var(--bg-primary);
  display: flex; align-items: center; justify-content: center;
  transition: opacity 0.8s var(--ease-out-expo), transform 0.8s var(--ease-out-expo);
}
.loading-overlay.hidden { opacity: 0; transform: scale(1.05); pointer-events: none; }

.loader { text-align: center; position: relative; }
.loader-svg { width: 120px; height: 120px; transform: rotate(-90deg); }
.loader-track {
  fill: none; stroke: rgba(255,255,255,0.06); stroke-width: 3;
}
.loader-circle {
  fill: none; stroke: url(#loaderGrad); stroke-width: 3;
  stroke-linecap: round;
  stroke-dasharray: 251.2; /* 2 * PI * 40 */
  stroke-dashoffset: 251.2;
  transition: stroke-dashoffset 0.3s ease;
  filter: drop-shadow(0 0 6px var(--accent));
}
.loader-percent {
  position: absolute; top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  font-size: 1.5rem; font-weight: 700; color: var(--accent);
  font-family: var(--font-mono);
}
.loader-label {
  font-size: 0.8rem; color: var(--text-muted); margin-top: 20px;
  letter-spacing: 0.15em; text-transform: uppercase;
  animation: pulse 1.5s ease-in-out infinite;
}
@keyframes pulse { 0%, 100% { opacity: 0.5; } 50% { opacity: 1; } }

/* ============================================================
   BUTTONS
   ============================================================ */
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 14px 32px; font-family: var(--font-body); font-size: 0.9rem;
  font-weight: 600; border-radius: 12px; cursor: pointer;
  transition: all var(--transition-fast); text-decoration: none;
}
.btn-primary { 
  background: var(--btn-bg, var(--accent-gradient)); 
  color: var(--btn-color, var(--bg-primary)); 
  border: var(--btn-border, none);
  box-shadow: 0 4px 24px var(--accent-glow); 
}
.btn-primary:hover { 
  box-shadow: 0 8px 40px rgba(0, 212, 255, 0.35); 
  transform: translateY(-2px); 
}
.btn-outline { 
  background: var(--btn-bg, transparent); 
  color: var(--btn-color, var(--text-primary)); 
  border: var(--btn-border, 1px solid var(--border)); 
  backdrop-filter: blur(10px); 
}
.btn-outline:hover { 
  border-color: var(--btn-border-hover, var(--accent)); 
  background: var(--btn-bg-hover, rgba(0, 212, 255, 0.05)); 
  transform: translateY(-2px); 
}

/* ============================================================
   SECTIONS
   ============================================================ */
.section {
  padding: var(--section-padding) 0;
  position: relative; z-index: 10; background: transparent;
}

.section-header { margin-bottom: 64px; }
.section-tag {
  font-family: var(--font-mono); font-size: 0.75rem; color: var(--accent);
  text-shadow: 0 0 20px rgba(0, 212, 255, 0.5), 0 2px 8px rgba(0,0,0,0.8);
  letter-spacing: 0.1em; text-transform: uppercase; display: block; margin-bottom: 12px;
}
.section-title {
  font-size: clamp(2rem, 4vw, 3rem); font-weight: 800; letter-spacing: -0.02em;
  margin-bottom: 16px;
  text-shadow: 0 2px 16px rgba(0,0,0,0.9), 0 0 40px rgba(0,0,0,0.5);
}
.section-line { width: 60px; height: 3px; background: var(--accent-gradient); border-radius: 2px; }

/* Split-text letter animation */
.split-text .char {
  display: inline-block;
  opacity: 0;
  transform: translateY(40px) rotateX(-40deg);
  transition: opacity 0.5s var(--ease-out-expo), transform 0.5s var(--ease-out-expo);
}
.split-text.animated .char {
  opacity: 1;
  transform: translateY(0) rotateX(0);
}

/* ============================================================
   REVEAL ANIMATIONS
   ============================================================ */
.reveal {
  opacity: 0; transform: translateY(40px);
  transition: opacity 0.8s var(--ease-out-expo), transform 0.8s var(--ease-out-expo);
}
.reveal.visible { opacity: 1; transform: translateY(0); }

/* ============================================================
   ABOUT SECTION
   ============================================================ */
.about-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 64px; align-items: start; }

.about-card {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: 16px; padding: 32px; box-shadow: 0 20px 60px rgba(0, 0, 0, 0.4);
}
.about-lead {
  font-size: 1.2rem; font-weight: 500; color: var(--text-primary);
  margin-bottom: 16px; text-shadow: 0 2px 12px rgba(0,0,0,0.9); line-height: 1.6;
}
.about-text p { color: var(--text-secondary); margin-bottom: 16px; text-shadow: 0 2px 10px rgba(0,0,0,0.9); }
.about-text strong { color: var(--accent); }

.about-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; margin-top: 36px; padding-top: 36px; }
.stat-item { text-align: center; }
.stat-number { font-size: 2.2rem; font-weight: 800; color: var(--accent); line-height: 1; text-shadow: 0 0 20px rgba(0, 212, 255, 0.5), 0 2px 12px rgba(0,0,0,0.9); }
.stat-suffix { font-size: 1.4rem; font-weight: 700; color: var(--accent); }
.stat-label { display: block; font-size: 0.75rem; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.08em; margin-top: 4px; text-shadow: 0 2px 10px rgba(0,0,0,0.9); }

/* Code Window */
.code-window { background: var(--bg-card); border: 1px solid var(--border); border-radius: 16px; overflow: hidden; box-shadow: 0 20px 60px rgba(0, 0, 0, 0.4); }
.code-header { display: flex; align-items: center; gap: 8px; padding: 14px 20px; background: rgba(255, 255, 255, 0.02); border-bottom: 1px solid var(--border); }
.code-dot { width: 12px; height: 12px; border-radius: 50%; }
.code-dot--red { background: #ff5f57; }
.code-dot--yellow { background: #febc2e; }
.code-dot--green { background: #28c840; }
.code-title { font-family: var(--font-mono); font-size: 0.75rem; color: var(--text-muted); margin-left: 8px; }
.code-body { padding: 24px; font-family: var(--font-mono); font-size: 0.82rem; line-height: 1.8; color: var(--text-secondary); overflow-x: auto; }
.code-key { color: #7b61ff; }
.code-str { color: #28c840; }

/* ============================================================
   EXPERIENCE – TIMELINE
   ============================================================ */
.timeline { position: relative; padding-left: 48px; }
.timeline-line { position: absolute; left: 18px; top: 0; bottom: 0; width: 2px; background: linear-gradient(to bottom, var(--accent), var(--accent-alt), transparent); }
.timeline-item { position: relative; padding-bottom: 48px; }
.timeline-marker { position: absolute; left: -48px; top: 4px; }

/* Timeline Glow Pulse */
.timeline-dot {
  width: 14px; height: 14px; border-radius: 50%;
  background: var(--accent); border: 3px solid var(--bg-primary);
  box-shadow: 0 0 20px var(--accent-glow), 0 0 40px var(--accent-glow);
  animation: glowPulse 2.5s ease-in-out infinite;
}
@keyframes glowPulse {
  0%, 100% { box-shadow: 0 0 12px var(--accent-glow), 0 0 24px var(--accent-glow); transform: scale(1); }
  50% { box-shadow: 0 0 24px rgba(0,212,255,0.5), 0 0 48px rgba(0,212,255,0.3), 0 0 72px rgba(0,212,255,0.15); transform: scale(1.3); }
}

.timeline-content { background: var(--bg-card); border: 1px solid var(--border); border-radius: 16px; padding: 32px; transition: border-color var(--transition-fast); }
.timeline-content:hover { border-color: var(--border-hover); }
.timeline-header { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 8px; flex-wrap: wrap; gap: 8px; }
.timeline-role { font-size: 1.3rem; font-weight: 700; }
.timeline-date { font-family: var(--font-mono); font-size: 0.8rem; color: var(--accent); background: rgba(0, 212, 255, 0.08); padding: 4px 12px; border-radius: 6px; white-space: nowrap; }
.timeline-company { font-size: 1rem; font-weight: 500; color: var(--text-secondary); margin-bottom: 20px; }
.timeline-highlights { list-style: none; margin-bottom: 20px; }
.timeline-highlights li { position: relative; padding-left: 20px; margin-bottom: 10px; color: var(--text-secondary); font-size: 0.92rem; }
.timeline-highlights li::before { content: "▹"; position: absolute; left: 0; color: var(--accent); font-size: 0.85rem; }
.timeline-tags { display: flex; flex-wrap: wrap; gap: 8px; }
.tag { font-family: var(--font-mono); font-size: 0.72rem; padding: 4px 12px; border-radius: 6px; background: rgba(0, 212, 255, 0.06); color: var(--accent); border: 1px solid rgba(0, 212, 255, 0.12); }

/* ============================================================
   PROJECTS – HOVER CARDS
   ============================================================ */
.projects-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 24px; }
.project-card {
  position: relative; background: var(--bg-card); border: 1px solid var(--border);
  border-radius: 20px; padding: 36px; overflow: hidden;
  transition: all var(--transition-med); cursor: default;
}
.project-card:hover { border-color: var(--border-hover); transform: translateY(-4px); box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3); }
.project-card-glow { position: absolute; top: -50%; left: -50%; width: 200%; height: 200%; opacity: 0; transition: opacity var(--transition-med); pointer-events: none; }
.project-card:hover .project-card-glow { opacity: 1; }
.project-icon { font-size: 2rem; margin-bottom: 16px; }
.project-title { font-size: 1.15rem; font-weight: 700; margin-bottom: 12px; }
.project-desc { color: var(--text-secondary); font-size: 0.9rem; margin-bottom: 20px; line-height: 1.7; }
.project-tags { display: flex; flex-wrap: wrap; gap: 8px; }
.project-tags span { font-family: var(--font-mono); font-size: 0.7rem; padding: 3px 10px; border-radius: 4px; background: rgba(123, 97, 255, 0.08); color: var(--accent-alt); border: 1px solid rgba(123, 97, 255, 0.15); }

/* ============================================================
   CERTIFICATIONS
   ============================================================ */
.cert-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; }
.cert-badge {
  background: var(--bg-card); border: 1px solid var(--border); border-radius: 16px;
  padding: 32px 24px; text-align: center; transition: all var(--transition-med); cursor: default;
}
.cert-badge:hover { border-color: var(--border-hover); transform: translateY(-4px); box-shadow: 0 12px 40px rgba(0, 0, 0, 0.25), 0 0 30px var(--accent-glow); }
.cert-icon { font-size: 2.2rem; margin-bottom: 16px; }
.cert-name { display: block; font-size: 1rem; font-weight: 700; margin-bottom: 4px; }
.cert-issuer { font-size: 0.78rem; color: var(--text-muted); }

/* ============================================================
   CONTACT
   ============================================================ */
.contact-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 64px; align-items: start; }
.contact-lead { font-size: 1.1rem; color: var(--text-secondary); margin-bottom: 32px; text-shadow: 0 2px 10px rgba(0,0,0,0.9); line-height: 1.7; }
.contact-email {
  display: inline-flex; align-items: center; gap: 10px; font-size: 1.1rem; font-weight: 600;
  color: var(--accent); padding: 16px 24px; border: 1px solid rgba(0, 212, 255, 0.2);
  border-radius: 12px; background: rgba(0, 212, 255, 0.04); margin-bottom: 24px;
  transition: all var(--transition-fast);
}
.contact-email:hover { background: rgba(0, 212, 255, 0.1); border-color: var(--accent); box-shadow: 0 0 30px var(--accent-glow); }
.email-icon { font-size: 1.2rem; }
.btn-download { display: inline-flex; margin-top: 8px; }

.contact-form { display: flex; flex-direction: column; gap: 20px; }
.form-group { position: relative; }
.form-group input, .form-group textarea {
  width: 100%; padding: 16px 20px; font-family: var(--font-body); font-size: 0.92rem;
  color: var(--text-primary); background: var(--bg-card); border: 1px solid var(--border);
  border-radius: 12px; outline: none;
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast); resize: vertical;
}
.form-group input:focus, .form-group textarea:focus { border-color: var(--accent); box-shadow: 0 0 20px var(--accent-glow); }
.form-group label { position: absolute; top: -8px; left: 16px; font-size: 0.7rem; color: var(--text-muted); background: var(--bg-primary); padding: 0 6px; opacity: 0; transition: opacity var(--transition-fast); pointer-events: none; }
.form-group input:focus + label, .form-group textarea:focus + label,
.form-group input:not(:placeholder-shown) + label, .form-group textarea:not(:placeholder-shown) + label { opacity: 1; }
.btn-submit { align-self: flex-start; border: none; }
.btn-arrow { transition: transform var(--transition-fast); }
.btn-submit:hover .btn-arrow { transform: translateX(4px); }

/* Form states */
.btn-submit.sending .btn-text,
.btn-submit.sending .btn-arrow { display: none; }
.btn-submit.sending .btn-loading { display: inline !important; }
.btn-submit.success .btn-text,
.btn-submit.success .btn-arrow { display: none; }
.btn-submit.success .btn-loading { display: none !important; }
.btn-submit.success .btn-success { display: inline !important; }

/* ============================================================
   FOOTER
   ============================================================ */
.footer { position: relative; z-index: 10; background: rgba(10, 12, 22, 0.85); border-top: 1px solid var(--border); padding: 32px 0; text-align: center; }
.footer-text { font-size: 0.85rem; color: var(--text-muted); }

/* ============================================================
   SMOOTH PAGE TRANSITIONS
   ============================================================ */
.page-content {
  position: relative; z-index: 1;
  animation: pageIn 0.6s var(--ease-out-expo) forwards;
}
@keyframes pageIn { from { opacity: 0; transform: translateY(20px); } to { opacity: 1; transform: translateY(0); } }

.section-transition-out {
  animation: sectionOut 0.4s var(--ease-out-expo) forwards;
}
@keyframes sectionOut { to { opacity: 0; transform: translateY(-15px); } }

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 900px) {
  .nav-links {
    position: fixed; top: 0; right: -100%; width: 280px; height: 100vh;
    background: rgba(7, 8, 12, 0.96); backdrop-filter: blur(20px);
    flex-direction: column; padding: 100px 32px 32px; gap: 4px;
    transition: right var(--transition-med); border-left: 1px solid var(--border);
  }
  .nav-links.open { right: 0; }
  .nav-toggle { display: flex; z-index: 1001; }
  .nav-toggle.active span:nth-child(1) { transform: rotate(45deg) translate(5px, 5px); }
  .nav-toggle.active span:nth-child(2) { opacity: 0; }
  .nav-toggle.active span:nth-child(3) { transform: rotate(-45deg) translate(5px, -5px); }
  .about-grid, .contact-grid { grid-template-columns: 1fr; gap: 40px; }
  .projects-grid { grid-template-columns: 1fr; }
  .cert-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 600px) {
  .cert-grid { grid-template-columns: 1fr; }
  .hero-cta-group { flex-direction: column; align-items: center; }
  .timeline { padding-left: 32px; }
  .timeline-line { left: 10px; }
  .timeline-marker { left: -32px; }
  .timeline-dot { width: 10px; height: 10px; }
  .timeline-header { flex-direction: column; }
}
/* ============================================================
   CHAT WIDGET
   ============================================================ */
.chat-widget {
  position: fixed;
  bottom: 30px;
  right: 30px;
  z-index: 2000;
  font-family: var(--font-body);
}

.chat-toggle {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 24px;
  background: var(--accent);
  background: linear-gradient(135deg, var(--accent) 0%, #7b61ff 100%);
  border: none;
  border-radius: 50px;
  color: white;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 10px 25px rgba(0, 212, 255, 0.3);
  transition: all var(--transition-med);
}

.chat-toggle:hover {
  transform: translateY(-5px);
  box-shadow: 0 15px 30px rgba(0, 212, 255, 0.4);
}

.chat-icon {
  width: 24px;
  height: 24px;
}

.chat-window {
  position: absolute;
  bottom: 80px;
  right: 0;
  width: 380px;
  height: 500px;
  background: rgba(15, 17, 26, 0.95);
  backdrop-filter: blur(20px);
  border: 1px solid var(--border);
  border-radius: 20px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5), 0 0 20px rgba(0, 212, 255, 0.1);
  transform: translateY(20px) scale(0.95);
  opacity: 0;
  pointer-events: none;
  transition: all 0.4s var(--ease-out-expo);
}

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

.chat-header {
  padding: 20px;
  background: rgba(255, 255, 255, 0.03);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

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

.chat-avatar {
  width: 40px;
  height: 40px;
  background: var(--accent);
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 0.8rem;
  color: #0a0c16;
}

.chat-header h3 {
  font-size: 0.95rem;
  margin: 0;
  color: var(--text-primary);
}

.chat-header p {
  font-size: 0.75rem;
  margin: 0;
  color: var(--text-muted);
}

.chat-close {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 1.5rem;
  cursor: pointer;
  padding: 5px;
  transition: color var(--transition-fast);
}

.chat-close:hover {
  color: var(--text-primary);
}

.chat-messages {
  flex: 1;
  padding: 20px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 16px;
  scroll-behavior: smooth;
}

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

.chat-messages::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 10px;
}

.message {
  max-width: 85%;
  padding: 12px 16px;
  border-radius: 15px;
  font-size: 0.9rem;
  line-height: 1.5;
  position: relative;
}

.message.bot {
  align-self: flex-start;
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-primary);
  border-bottom-left-radius: 4px;
  border: 1px solid var(--border);
}

.message.user {
  align-self: flex-end;
  background: var(--accent);
  color: #0a0c16;
  border-bottom-right-radius: 4px;
  font-weight: 500;
}

.message p {
  margin: 0;
}

.typing-indicator {
  display: flex;
  gap: 4px;
  padding: 12px 16px;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 15px;
  width: fit-content;
  border: 1px solid var(--border);
}

.typing-dot {
  width: 6px;
  height: 6px;
  background: var(--text-muted);
  border-radius: 50%;
  animation: typing 1.4s infinite ease-in-out;
}

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

@keyframes typing {
  0%, 60%, 100% { transform: translateY(0); }
  30% { transform: translateY(-4px); }
}

.chat-input-area {
  padding: 15px 20px;
  background: rgba(0, 0, 0, 0.2);
  border-top: 1px solid var(--border);
}

#chat-form {
  display: flex;
  gap: 10px;
}

#chat-input {
  flex: 1;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 10px 15px;
  color: var(--text-primary);
  font-family: var(--font-body);
  font-size: 0.9rem;
  outline: none;
  transition: border-color var(--transition-fast);
}

#chat-input:focus {
  border-color: var(--accent);
}

#chat-send {
  background: var(--accent);
  border: none;
  border-radius: 10px;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #0a0c16;
  cursor: pointer;
  transition: transform var(--transition-fast);
}

#chat-send:hover {
  transform: scale(1.05);
}

#chat-send svg {
  width: 18px;
  height: 18px;
}

@media (max-width: 600px) {
  .chat-widget {
    bottom: 20px;
    right: 20px;
  }
  .chat-window {
    width: calc(100vw - 40px);
    height: 450px;
    bottom: 70px;
  }
  .chat-toggle-text {
    display: none;
  }
  .chat-toggle {
    padding: 15px;
    border-radius: 50%;
  }
}
