/* =============================================
   ROOT VARIABLES & RESET
   ============================================= */
:root {
  --bg-primary: #050d1a;
  --bg-secondary: #0a1628;
  --bg-card: #0d1f3c;
  --bg-card-hover: #112347;
  --accent-cyan: #00d4ff;
  --accent-blue: #0066ff;
  --accent-glow: rgba(0, 212, 255, 0.25);
  --text-primary: #e8f4fd;
  --text-secondary: #8ab4d4;
  --text-muted: #4a7a9b;
  --border-color: rgba(0, 212, 255, 0.15);
  --border-glow: rgba(0, 212, 255, 0.4);
  --shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
  --shadow-glow: 0 0 20px rgba(0, 212, 255, 0.2);
  --gradient-main: linear-gradient(135deg, #050d1a 0%, #0a1628 50%, #0d2044 100%);
  --gradient-accent: linear-gradient(135deg, #00d4ff, #0066ff);
  --gradient-card: linear-gradient(135deg, #0d1f3c, #112347);
  --font-main: 'Segoe UI', system-ui, -apple-system, sans-serif;
  --transition: all 0.3s ease;
  --radius: 12px;
  --radius-lg: 20px;
}

*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }

html { scroll-behavior: smooth; font-size: 16px; }

body {
  font-family: var(--font-main);
  background: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.7;
  overflow-x: hidden;
}

a { color: var(--accent-cyan); text-decoration: none; transition: var(--transition); }
a:hover { color: #fff; }
ul { list-style: none; }
img { max-width: 100%; display: block; }
button { cursor: pointer; font-family: var(--font-main); }

/* =============================================
   UTILITY
   ============================================= */
.container { max-width: 1200px; margin: 0 auto; padding: 0 24px; }
.accent { color: var(--accent-cyan); }
.section { padding: 100px 0; position: relative; }
.section-header { text-align: center; margin-bottom: 64px; }
.section-title { font-size: clamp(2rem, 4vw, 2.8rem); font-weight: 800; letter-spacing: -0.5px; }
.section-line {
  width: 80px; height: 4px; margin: 16px auto 0;
  background: var(--gradient-accent);
  border-radius: 2px;
  position: relative;
}
.section-line::after {
  content: ''; position: absolute;
  left: 50%; transform: translateX(-50%) translateY(8px);
  width: 40px; height: 4px;
  background: var(--gradient-accent);
  border-radius: 2px;
  opacity: 0.5;
}

/* =============================================
   LOADING SCREEN
   ============================================= */
#loading-screen {
  position: fixed; inset: 0;
  background: var(--bg-primary);
  z-index: 9999;
  display: flex; align-items: center; justify-content: center;
  transition: opacity 0.5s ease, visibility 0.5s ease;
}
#loading-screen.hidden { opacity: 0; visibility: hidden; }
.loader-inner { text-align: center; }
.loader-logo {
  font-size: 3.5rem; font-weight: 900;
  background: var(--gradient-accent);
  -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text;
  animation: pulse 1.5s ease-in-out infinite;
  margin-bottom: 24px;
}
.loader-bar {
  width: 200px; height: 4px;
  background: var(--bg-card);
  border-radius: 2px; overflow: hidden;
  margin: 0 auto 16px;
}
.loader-fill {
  height: 100%; width: 0;
  background: var(--gradient-accent);
  border-radius: 2px;
  animation: loadBar 1.8s ease forwards;
}
.loader-text { color: var(--text-secondary); font-size: 0.9rem; }
@keyframes loadBar { to { width: 100%; } }
@keyframes pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.7; transform: scale(0.96); }
}

/* =============================================
   SCROLL PROGRESS BAR
   ============================================= */
#scroll-progress {
  position: fixed; top: 0; left: 0; height: 3px; width: 0;
  background: var(--gradient-accent);
  z-index: 9998; transition: width 0.1s linear;
  box-shadow: 0 0 8px var(--accent-cyan);
}

/* =============================================
   PARTICLE CANVAS
   ============================================= */
#particle-canvas {
  position: fixed; inset: 0;
  pointer-events: none; z-index: 1;
  opacity: 0.6;
}

/* =============================================
   VIDEO BACKGROUND
   ============================================= */
#video-bg-wrapper {
  position: absolute;
  inset: 0;
  z-index: 0;
  overflow: hidden;
}
#video-bg {
  position: absolute;
  top: 50%;
  left: 50%;
  min-width: 100%;
  min-height: 100%;
  width: auto;
  height: auto;
  transform: translate(-50%, -50%);
  object-fit: cover;
}
#video-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    180deg,
    rgba(5, 13, 26, 0.55) 0%,
    rgba(5, 13, 26, 0.7) 50%,
    rgba(5, 13, 26, 0.85) 100%
  );
  pointer-events: none;
}

/* =============================================
   NAVBAR
   ============================================= */
#navbar {
  position: fixed; top: 0; left: 0; right: 0;
  z-index: 1000;
  padding: 16px 0;
  transition: var(--transition);
}
#navbar.scrolled {
  background: rgba(5, 13, 26, 0.9);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border-color);
  padding: 10px 0;
  box-shadow: var(--shadow);
}
.nav-container {
  max-width: 1200px; margin: 0 auto; padding: 0 24px;
  display: flex; align-items: center; justify-content: space-between;
}
.nav-logo {
  font-size: 1.5rem; font-weight: 900;
  color: var(--text-primary);
  letter-spacing: -0.5px;
}
.nav-logo span { color: var(--accent-cyan); }
.nav-links { display: flex; gap: 8px; align-items: center; }
.nav-link {
  color: var(--text-secondary);
  font-size: 0.9rem; font-weight: 500;
  padding: 8px 14px; border-radius: 8px;
  transition: var(--transition); position: relative;
}
.nav-link:hover, .nav-link.active {
  color: var(--accent-cyan);
  background: rgba(0, 212, 255, 0.08);
}
.nav-link.active::after {
  content: ''; position: absolute;
  bottom: 4px; left: 50%; transform: translateX(-50%);
  width: 4px; height: 4px; background: var(--accent-cyan);
  border-radius: 50%;
}
.nav-toggle {
  display: none; flex-direction: column; gap: 5px;
  background: none; border: none; padding: 4px;
}
.nav-toggle span {
  display: block; width: 24px; height: 2px;
  background: var(--text-primary); border-radius: 2px;
  transition: var(--transition);
}
.nav-toggle.active span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-toggle.active span:nth-child(2) { opacity: 0; }
.nav-toggle.active span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* =============================================
   HERO SECTION
   ============================================= */
.hero {
  min-height: 100vh;
  display: flex; align-items: center; justify-content: center;
  padding: 120px 24px 80px;
  position: relative; z-index: 1;
  overflow: hidden;
}
.hero-content {
  max-width: 1100px; margin: 0 auto;
  display: grid; grid-template-columns: 1fr 1.4fr;
  gap: 64px; align-items: center;
}
.hero-image-wrapper { display: flex; justify-content: center; }
.hero-avatar {
  position: relative;
  width: 280px; height: 280px;
}
.avatar-placeholder {
  width: 280px; height: 280px; border-radius: 50%;
  background: var(--gradient-card);
  border: 3px solid var(--border-glow);
  display: flex; align-items: center; justify-content: center;
  font-size: 5rem; font-weight: 900;
  background: linear-gradient(135deg, #0d1f3c, #1a3a6e);
  color: var(--accent-cyan);
  box-shadow: var(--shadow-glow), var(--shadow);
  position: relative; z-index: 2;
  text-shadow: 0 0 30px var(--accent-cyan);
}
.avatar-ring {
  position: absolute; border-radius: 50%;
  border: 1px solid var(--accent-cyan);
  top: 50%; left: 50%; transform: translate(-50%, -50%);
  animation: ringPulse 3s ease-in-out infinite;
}
.ring1 { width: 320px; height: 320px; opacity: 0.3; animation-delay: 0s; }
.ring2 { width: 360px; height: 360px; opacity: 0.15; animation-delay: 1.5s; }
@keyframes ringPulse {
  0%, 100% { transform: translate(-50%, -50%) scale(1); opacity: 0.3; }
  50% { transform: translate(-50%, -50%) scale(1.05); opacity: 0.1; }
}
.hero-greeting { color: var(--accent-cyan); font-size: 1rem; font-weight: 600; letter-spacing: 3px; text-transform: uppercase; margin-bottom: 8px; }
.hero-name { font-size: clamp(2.2rem, 5vw, 3.8rem); font-weight: 900; line-height: 1.1; margin-bottom: 20px; letter-spacing: -1px; }
.hero-typing-wrapper { font-size: 1.25rem; color: var(--text-secondary); margin-bottom: 20px; min-height: 32px; }
.typing-text { color: var(--accent-cyan); font-weight: 600; }
.typing-cursor { color: var(--accent-cyan); animation: blink 0.8s step-end infinite; }
@keyframes blink { 0%, 100% { opacity: 1; } 50% { opacity: 0; } }
.hero-tagline { font-size: 1rem; color: var(--text-secondary); border-left: 3px solid var(--accent-cyan); padding-left: 16px; margin-bottom: 20px; font-style: italic; }
.hero-location { color: var(--text-muted); font-size: 0.9rem; margin-bottom: 32px; }
.hero-location .icon-loc { color: var(--accent-cyan); margin-right: 6px; }
.hero-buttons { display: flex; gap: 16px; flex-wrap: wrap; }
.scroll-indicator {
  position: absolute; bottom: 32px; left: 50%; transform: translateX(-50%);
  display: flex; flex-direction: column; align-items: center; gap: 8px;
}
.scroll-dot {
  width: 8px; height: 8px; background: var(--accent-cyan);
  border-radius: 50%; animation: scrollBounce 2s ease-in-out infinite;
}
@keyframes scrollBounce { 0%, 100% { transform: translateY(0); opacity: 1; } 50% { transform: translateY(10px); opacity: 0.4; } }

/* =============================================
   BUTTONS
   ============================================= */
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 14px 28px; border-radius: 50px;
  font-size: 0.95rem; font-weight: 600;
  transition: var(--transition); border: 2px solid transparent;
  white-space: nowrap;
}
.btn-primary {
  background: var(--gradient-accent);
  color: #fff;
  box-shadow: 0 4px 20px rgba(0, 102, 255, 0.4);
}
.btn-primary:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 30px rgba(0, 102, 255, 0.6);
  color: #fff;
}
.btn-outline {
  background: transparent;
  color: var(--accent-cyan);
  border-color: var(--accent-cyan);
}
.btn-outline:hover {
  background: var(--accent-cyan);
  color: var(--bg-primary);
  transform: translateY(-3px);
  box-shadow: 0 8px 30px rgba(0, 212, 255, 0.4);
}
.btn-sm { padding: 8px 20px; font-size: 0.85rem; }
.btn-full { width: 100%; justify-content: center; }

/* =============================================
   ABOUT SECTION
   ============================================= */
.about { background: var(--bg-secondary); position: relative; z-index: 1; }
.about::before {
  content: ''; position: absolute; inset: 0;
  background: radial-gradient(ellipse at 20% 50%, rgba(0,102,255,0.06) 0%, transparent 60%);
  pointer-events: none;
}
.about-grid { display: grid; grid-template-columns: 1.2fr 0.8fr; gap: 64px; align-items: start; }
.about-text p { color: var(--text-secondary); margin-bottom: 20px; font-size: 1.05rem; }
.about-text strong { color: var(--accent-cyan); }
.about-info-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-top: 32px; }
.about-info-item {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius); padding: 14px 16px;
  transition: var(--transition);
}
.about-info-item:hover { border-color: var(--accent-cyan); transform: translateY(-2px); }
.info-label { display: block; font-size: 0.75rem; color: var(--text-muted); text-transform: uppercase; letter-spacing: 1px; margin-bottom: 4px; }
.info-value { font-size: 0.9rem; color: var(--text-primary); font-weight: 500; }
.info-value a { color: var(--accent-cyan); }
.info-value a:hover { color: #fff; }
.about-stats { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg); padding: 32px 20px;
  text-align: center; transition: var(--transition);
  position: relative; overflow: hidden;
}
.stat-card::before {
  content: ''; position: absolute; inset: 0;
  background: var(--gradient-accent); opacity: 0;
  transition: var(--transition);
}
.stat-card:hover { border-color: var(--accent-cyan); transform: translateY(-5px); box-shadow: var(--shadow-glow); }
.stat-card:hover::before { opacity: 0.05; }
.stat-num {
  font-size: 3rem; font-weight: 900; line-height: 1;
  background: var(--gradient-accent);
  -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text;
  display: inline-block;
}
.stat-plus { display: inline-block; font-size: 2rem; font-weight: 900; color: var(--accent-cyan); vertical-align: top; margin-top: 4px; }
.stat-label { color: var(--text-secondary); font-size: 0.85rem; margin-top: 8px; }

/* =============================================
   EXPERIENCE SECTION
   ============================================= */
.experience { position: relative; z-index: 1; }
.timeline { position: relative; padding-left: 40px; }
.timeline::before {
  content: ''; position: absolute; left: 16px; top: 0; bottom: 0;
  width: 2px; background: linear-gradient(to bottom, var(--accent-cyan), var(--accent-blue), transparent);
}
.timeline-item { position: relative; margin-bottom: 40px; }
.timeline-dot {
  position: absolute; left: -32px; top: 24px;
  width: 14px; height: 14px; border-radius: 50%;
  background: var(--accent-cyan);
  border: 3px solid var(--bg-primary);
  box-shadow: 0 0 12px var(--accent-cyan);
}
.timeline-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg); padding: 28px 32px;
  transition: var(--transition);
}
.timeline-card:hover { border-color: var(--accent-cyan); transform: translateX(8px); box-shadow: var(--shadow-glow); }
.timeline-header { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 12px; gap: 16px; flex-wrap: wrap; }
.timeline-company { font-size: 1.2rem; font-weight: 700; color: var(--text-primary); }
.timeline-sub { font-size: 0.85rem; color: var(--text-muted); margin-top: 2px; }
.timeline-badge {
  padding: 4px 12px; border-radius: 20px; font-size: 0.75rem; font-weight: 600;
  white-space: nowrap;
}
.timeline-badge.current { background: rgba(0,212,255,0.15); color: var(--accent-cyan); border: 1px solid rgba(0,212,255,0.3); }
.timeline-badge.internship { background: rgba(0,102,255,0.15); color: #6699ff; border: 1px solid rgba(0,102,255,0.3); }
.timeline-position { color: var(--accent-cyan); font-weight: 600; font-size: 1rem; margin-bottom: 6px; }
.timeline-period { color: var(--text-muted); font-size: 0.85rem; margin-bottom: 16px; }
.timeline-desc li { color: var(--text-secondary); font-size: 0.9rem; padding: 4px 0 4px 16px; position: relative; }
.timeline-desc li::before { content: '▹'; position: absolute; left: 0; color: var(--accent-cyan); }

/* =============================================
   SKILLS SECTION
   ============================================= */
.skills { background: var(--bg-secondary); position: relative; z-index: 1; }
.skills-grid { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 40px; }
.skills-cat { font-size: 1rem; font-weight: 700; color: var(--accent-cyan); margin-bottom: 24px; letter-spacing: 0.5px; }
.skill-item { margin-bottom: 20px; }
.skill-info { display: flex; justify-content: space-between; margin-bottom: 8px; font-size: 0.9rem; color: var(--text-secondary); }
.skill-bar { height: 8px; background: var(--bg-card); border-radius: 4px; overflow: hidden; border: 1px solid var(--border-color); }
.skill-fill {
  height: 100%; width: 0;
  background: var(--gradient-accent);
  border-radius: 4px;
  transition: width 1.5s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative; overflow: hidden;
}
.skill-fill::after {
  content: ''; position: absolute; inset: 0;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.3), transparent);
  animation: shimmer 2s ease infinite;
}
@keyframes shimmer { 0% { transform: translateX(-100%); } 100% { transform: translateX(100%); } }
.skill-badges { display: flex; flex-wrap: wrap; gap: 10px; }
.badge {
  padding: 8px 16px; border-radius: 20px;
  background: var(--bg-card); border: 1px solid var(--border-color);
  color: var(--text-secondary); font-size: 0.85rem;
  transition: var(--transition);
}
.badge:hover { border-color: var(--accent-cyan); color: var(--accent-cyan); transform: translateY(-2px); }

/* =============================================
   PORTFOLIO SECTION
   ============================================= */
.portfolio { position: relative; z-index: 1; }
.portfolio-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); gap: 28px; justify-items: center; }
.portfolio-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  overflow: hidden; transition: var(--transition);
  width: 100%; max-width: 480px;
  position: relative;
}
.portfolio-card::before {
  content: ''; position: absolute; top: 0; left: 0; right: 0; height: 3px;
  background: var(--gradient-accent);
  transform: scaleX(0); transform-origin: left;
  transition: transform 0.4s ease;
}
.portfolio-card:hover { border-color: var(--accent-cyan); transform: translateY(-8px); box-shadow: var(--shadow-glow), var(--shadow); }
.portfolio-card:hover::before { transform: scaleX(1); }
.portfolio-icon {
  font-size: 4rem; padding: 40px 32px 24px;
  background: linear-gradient(135deg, #0a1628, #0d2044);
  text-align: center;
  border-bottom: 1px solid var(--border-color);
}
.portfolio-card-body { padding: 28px 32px; }
.portfolio-tags { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 16px; }
.tag {
  padding: 4px 12px; border-radius: 20px; font-size: 0.75rem; font-weight: 600;
  background: rgba(0,212,255,0.1); color: var(--accent-cyan);
  border: 1px solid rgba(0,212,255,0.25);
}
.portfolio-title { font-size: 1.2rem; font-weight: 700; color: var(--text-primary); margin-bottom: 12px; }
.portfolio-desc { color: var(--text-secondary); font-size: 0.9rem; line-height: 1.7; margin-bottom: 24px; }
.portfolio-footer { display: flex; gap: 12px; }

/* Project Modal */
.modal-overlay {
  position: fixed; inset: 0; z-index: 2000;
  background: rgba(0,0,0,0.8);
  backdrop-filter: blur(8px);
  display: flex; align-items: center; justify-content: center;
  padding: 24px;
  opacity: 0; visibility: hidden; transition: var(--transition);
}
.modal-overlay.active { opacity: 1; visibility: visible; }
.modal-box {
  background: var(--bg-secondary);
  border: 1px solid var(--border-glow);
  border-radius: var(--radius-lg);
  padding: 48px 40px; max-width: 560px; width: 100%;
  position: relative; box-shadow: var(--shadow-glow), var(--shadow);
  transform: scale(0.9); transition: transform 0.3s ease;
}
.modal-overlay.active .modal-box { transform: scale(1); }
.modal-close {
  position: absolute; top: 16px; right: 20px;
  background: none; border: none;
  color: var(--text-muted); font-size: 1.8rem;
  transition: var(--transition);
}
.modal-close:hover { color: var(--accent-cyan); }
.modal-icon { font-size: 3rem; margin-bottom: 20px; }
.modal-title { font-size: 1.5rem; font-weight: 800; margin-bottom: 16px; }
.modal-tags { display: flex; gap: 8px; margin-bottom: 20px; flex-wrap: wrap; }
.modal-desc { color: var(--text-secondary); margin-bottom: 20px; line-height: 1.8; }
.modal-list { list-style: none; color: var(--text-secondary); }
.modal-list li { padding: 6px 0 6px 20px; position: relative; font-size: 0.9rem; }
.modal-list li::before { content: '▹'; position: absolute; left: 0; color: var(--accent-cyan); }

/* =============================================
   CERTIFICATIONS SECTION
   ============================================= */
.certifications { background: var(--bg-secondary); position: relative; z-index: 1; }
.cert-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 24px; }
.cert-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg); padding: 32px 24px;
  text-align: center; transition: var(--transition);
  position: relative; overflow: hidden;
}
.cert-card::after {
  content: ''; position: absolute; inset: 0;
  background: var(--gradient-accent); opacity: 0;
  transition: var(--transition);
}
.cert-card:hover { border-color: var(--accent-cyan); transform: translateY(-6px); box-shadow: var(--shadow-glow); }
.cert-card:hover::after { opacity: 0.04; }
.cert-icon { font-size: 2.5rem; margin-bottom: 16px; display: block; }
.cert-name { color: var(--text-secondary); font-size: 0.9rem; line-height: 1.5; margin-bottom: 16px; font-weight: 500; }
.cert-badge {
  display: inline-block;
  padding: 4px 14px; border-radius: 20px; font-size: 0.75rem; font-weight: 700;
  background: var(--gradient-accent); color: #fff;
}

/* =============================================
   CONTACT SECTION
   ============================================= */
.contact { position: relative; z-index: 1; }
.contact-grid { display: grid; grid-template-columns: 1fr 1.2fr; gap: 64px; align-items: start; }
.contact-info h3 { font-size: 1.5rem; font-weight: 800; margin-bottom: 16px; }
.contact-info > p { color: var(--text-secondary); margin-bottom: 32px; line-height: 1.7; }
.contact-items { display: flex; flex-direction: column; gap: 16px; }
.contact-item {
  display: flex; gap: 16px; align-items: center;
  background: var(--bg-card); border: 1px solid var(--border-color);
  border-radius: var(--radius); padding: 16px 20px;
  color: var(--text-primary); transition: var(--transition);
}
.contact-item:hover { border-color: var(--accent-cyan); transform: translateX(6px); box-shadow: var(--shadow-glow); color: var(--text-primary); }
.contact-item-icon {
  width: 44px; height: 44px; border-radius: 10px;
  background: rgba(0,212,255,0.1); border: 1px solid rgba(0,212,255,0.2);
  display: flex; align-items: center; justify-content: center; font-size: 1.2rem;
  flex-shrink: 0;
}
.contact-item-label { font-size: 0.75rem; color: var(--text-muted); text-transform: uppercase; letter-spacing: 1px; }
.contact-item-value { font-size: 0.9rem; color: var(--accent-cyan); font-weight: 500; margin-top: 2px; }
.contact-form-wrapper {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg); padding: 40px;
}
.form-group { margin-bottom: 20px; }
.form-group label { display: block; font-size: 0.85rem; color: var(--text-secondary); margin-bottom: 8px; font-weight: 500; }
.form-group input, .form-group textarea {
  width: 100%; background: var(--bg-primary);
  border: 1px solid var(--border-color); border-radius: var(--radius);
  padding: 12px 16px; color: var(--text-primary);
  font-family: var(--font-main); font-size: 0.9rem;
  transition: var(--transition); resize: vertical;
}
.form-group input:focus, .form-group textarea:focus {
  outline: none; border-color: var(--accent-cyan);
  box-shadow: 0 0 0 3px rgba(0,212,255,0.1);
}
.form-group input::placeholder, .form-group textarea::placeholder { color: var(--text-muted); }
.form-status { margin-top: 16px; padding: 12px 16px; border-radius: var(--radius); font-size: 0.9rem; display: none; }
.form-status.success { background: rgba(0,212,100,0.15); border: 1px solid rgba(0,212,100,0.3); color: #00d464; display: block; }
.form-status.error { background: rgba(255,50,50,0.15); border: 1px solid rgba(255,50,50,0.3); color: #ff5555; display: block; }

/* =============================================
   FOOTER
   ============================================= */
.footer {
  background: var(--bg-secondary);
  border-top: 1px solid var(--border-color);
  padding: 60px 0 0; position: relative; z-index: 1;
}
.footer-top { display: grid; grid-template-columns: 1.5fr 1fr 1fr 1fr; gap: 40px; padding-bottom: 48px; }
.footer-brand p { color: var(--text-muted); font-size: 0.9rem; margin-top: 12px; line-height: 1.6; }
.footer-logo { font-size: 1.4rem; }
.footer-links-col h4, .footer-social-col h4 { color: var(--text-primary); font-size: 0.9rem; font-weight: 700; margin-bottom: 16px; letter-spacing: 0.5px; }
.footer-links-col ul li a { color: var(--text-muted); font-size: 0.85rem; display: block; padding: 4px 0; transition: var(--transition); }
.footer-links-col ul li a:hover { color: var(--accent-cyan); padding-left: 6px; }
.social-icons { display: flex; gap: 12px; }
.social-icon {
  width: 40px; height: 40px; border-radius: 10px;
  background: var(--bg-card); border: 1px solid var(--border-color);
  display: flex; align-items: center; justify-content: center;
  font-size: 1.1rem; color: var(--text-secondary);
  transition: var(--transition);
}
.social-icon:hover { border-color: var(--accent-cyan); color: var(--accent-cyan); transform: translateY(-3px); box-shadow: var(--shadow-glow); }
.footer-bottom {
  border-top: 1px solid var(--border-color);
  padding: 24px 0;
  display: flex; justify-content: space-between; align-items: center;
  flex-wrap: wrap; gap: 12px;
}
.footer-bottom p { color: var(--text-muted); font-size: 0.85rem; }

/* =============================================
   BACK TO TOP
   ============================================= */
#back-to-top {
  position: fixed; bottom: 32px; right: 32px; z-index: 999;
  width: 48px; height: 48px; border-radius: 12px;
  background: var(--gradient-accent); color: #fff;
  border: none; font-size: 1.5rem;
  box-shadow: var(--shadow), 0 0 20px rgba(0,102,255,0.4);
  opacity: 0; visibility: hidden; transition: var(--transition);
  transform: translateY(10px);
}
#back-to-top.visible { opacity: 1; visibility: visible; transform: translateY(0); }
#back-to-top:hover { transform: translateY(-4px); box-shadow: var(--shadow), 0 0 30px rgba(0,102,255,0.6); }

/* =============================================
   AOS ANIMATIONS (Custom, no library)
   ============================================= */
[data-aos] {
  opacity: 0;
  transition: opacity 0.7s ease, transform 0.7s ease;
}
[data-aos="fade-up"] { transform: translateY(40px); }
[data-aos="fade-down"] { transform: translateY(-40px); }
[data-aos="fade-right"] { transform: translateX(-40px); }
[data-aos="fade-left"] { transform: translateX(40px); }
[data-aos="zoom-in"] { transform: scale(0.85); }
[data-aos].aos-animate {
  opacity: 1;
  transform: translate(0, 0) scale(1);
}
[data-aos-delay="100"] { transition-delay: 0.1s; }
[data-aos-delay="200"] { transition-delay: 0.2s; }
[data-aos-delay="300"] { transition-delay: 0.3s; }
[data-aos-delay="400"] { transition-delay: 0.4s; }

/* =============================================
   RESPONSIVE
   ============================================= */
@media (max-width: 1024px) {
  .hero-content { grid-template-columns: 1fr; text-align: center; gap: 40px; }
  .hero-image-wrapper { order: -1; }
  .hero-buttons { justify-content: center; }
  .hero-tagline { border-left: none; padding-left: 0; border-top: 3px solid var(--accent-cyan); padding-top: 16px; }
  .about-grid { grid-template-columns: 1fr; }
  .skills-grid { grid-template-columns: 1fr 1fr; }
  .footer-top { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 768px) {
  .section { padding: 72px 0; }
  .nav-links {
    position: fixed; top: 0; right: -100%; height: 100vh; width: 75%;
    max-width: 320px; background: rgba(5,13,26,0.98);
    backdrop-filter: blur(20px); flex-direction: column;
    justify-content: center; padding: 40px 32px;
    transition: right 0.4s ease;
    border-left: 1px solid var(--border-color);
    gap: 4px;
  }
  .nav-links.open { right: 0; }
  .nav-link { font-size: 1.1rem; padding: 14px 20px; }
  .nav-toggle { display: flex; }
  .hero-avatar { width: 220px; height: 220px; }
  .avatar-placeholder { width: 220px; height: 220px; font-size: 4rem; }
  .ring1 { width: 260px; height: 260px; }
  .ring2 { width: 300px; height: 300px; }
  .about-info-grid { grid-template-columns: 1fr; }
  .about-stats { grid-template-columns: 1fr 1fr; }
  .skills-grid { grid-template-columns: 1fr; }
  .contact-grid { grid-template-columns: 1fr; }
  .footer-top { grid-template-columns: 1fr 1fr; }
  .footer-bottom { flex-direction: column; text-align: center; }
  .timeline { padding-left: 28px; }
  .timeline-dot { left: -22px; }
  .timeline-card { padding: 20px 24px; }
}

@media (max-width: 480px) {
  .hero { padding: 100px 20px 60px; }
  .hero-buttons { flex-direction: column; align-items: center; }
  .hero-buttons .btn { width: 100%; justify-content: center; }
  .cert-grid { grid-template-columns: 1fr 1fr; }
  .footer-top { grid-template-columns: 1fr; }
  .contact-form-wrapper { padding: 24px 20px; }
  .modal-box { padding: 32px 24px; }
  .about-stats { grid-template-columns: 1fr 1fr; }
  .stat-card { padding: 24px 12px; }
}

/* Scrollbar styling */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: var(--bg-primary); }
::-webkit-scrollbar-thumb { background: var(--accent-blue); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--accent-cyan); }

/* Selection */
::selection { background: rgba(0,212,255,0.25); color: #fff; }

/* =============================================
   PORTFOLIO — AI CARD SPECIAL STYLES
   ============================================= */
.portfolio-card--ai {
  background: linear-gradient(135deg, #0a1628 0%, #0d2044 50%, #0f1e3a 100%);
  border-color: rgba(0, 212, 255, 0.25);
  position: relative; overflow: hidden;
}
.portfolio-card--ai::after {
  content: '';
  position: absolute; inset: 0;
  background: radial-gradient(ellipse at 70% 20%, rgba(0,212,255,0.08) 0%, transparent 60%),
              radial-gradient(ellipse at 30% 80%, rgba(0,102,255,0.06) 0%, transparent 50%);
  pointer-events: none;
}
.portfolio-card--ai:hover {
  border-color: var(--accent-cyan);
  box-shadow: 0 0 40px rgba(0, 212, 255, 0.2), 0 20px 60px rgba(0,0,0,0.5);
}

/* AI Icon animated */
.ai-icon-wrapper {
  background: linear-gradient(135deg, #050d1a, #0a1f40);
  position: relative; overflow: visible;
  display: flex; align-items: center; justify-content: center;
}
.ai-brain-anim {
  font-size: 3.8rem; position: relative;
  filter: drop-shadow(0 0 16px rgba(0,212,255,0.6));
  animation: aiFloat 3s ease-in-out infinite;
}
@keyframes aiFloat {
  0%, 100% { transform: translateY(0) scale(1); filter: drop-shadow(0 0 16px rgba(0,212,255,0.6)); }
  50% { transform: translateY(-6px) scale(1.05); filter: drop-shadow(0 0 28px rgba(0,212,255,0.9)); }
}
.ai-dot {
  position: absolute; border-radius: 50%;
  background: var(--accent-cyan); box-shadow: 0 0 8px var(--accent-cyan);
  animation: dotOrbit 4s linear infinite;
}
.d1 { width: 6px; height: 6px; top: -4px; left: 50%; animation-delay: 0s; }
.d2 { width: 5px; height: 5px; top: 50%; right: -4px; animation-delay: 0.8s; }
.d3 { width: 4px; height: 4px; bottom: -2px; left: 30%; animation-delay: 1.6s; }
.d4 { width: 5px; height: 5px; top: 20%; left: -4px; animation-delay: 2.4s; }
.d5 { width: 4px; height: 4px; bottom: 20%; right: 10%; animation-delay: 3.2s; }
@keyframes dotOrbit {
  0%, 100% { opacity: 0.3; transform: scale(0.8); }
  50% { opacity: 1; transform: scale(1.3); }
}

.ai-live-badge {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 0.72rem; font-weight: 700; letter-spacing: 1px;
  color: #00ff88; text-transform: uppercase; margin-bottom: 8px;
}
.ai-live-badge::before {
  content: ''; width: 6px; height: 6px; background: #00ff88;
  border-radius: 50%; display: inline-block;
  box-shadow: 0 0 6px #00ff88;
  animation: livePulse 1.5s ease-in-out infinite;
}
@keyframes livePulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.3; } }

.tag--ai {
  background: rgba(0,212,255,0.12);
  color: var(--accent-cyan);
  border-color: rgba(0,212,255,0.3);
}

/* Mini Stats inside card */
.portfolio-stats-mini {
  display: flex; gap: 16px; margin: 16px 0 20px;
  padding: 14px 16px;
  background: rgba(0,212,255,0.05);
  border: 1px solid rgba(0,212,255,0.1);
  border-radius: var(--radius);
}
.ps-item { text-align: center; flex: 1; }
.ps-val {
  display: block; font-size: 1.1rem; font-weight: 800;
  background: var(--gradient-accent);
  -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text;
}
.ps-lbl { font-size: 0.72rem; color: var(--text-muted); margin-top: 2px; }

/* =============================================
   AI MODAL
   ============================================= */
.modal-overlay--ai .modal-box--ai {
  max-width: 620px;
  background: linear-gradient(135deg, #080f1e, #0a1832, #0d2044);
  border-color: rgba(0,212,255,0.3);
  box-shadow: 0 0 60px rgba(0,212,255,0.15), var(--shadow);
}
.modal-ai-header {
  display: flex; gap: 20px; align-items: flex-start; margin-bottom: 20px;
}
.modal-ai-icon-wrap {
  font-size: 2.8rem; flex-shrink: 0;
  filter: drop-shadow(0 0 12px rgba(0,212,255,0.7));
  animation: aiFloat 3s ease-in-out infinite;
}
.modal-ai-badge {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 0.72rem; font-weight: 700; letter-spacing: 1px;
  color: #00ff88; text-transform: uppercase; margin-bottom: 6px;
}
.modal-feature-grid {
  display: grid; grid-template-columns: 1fr 1fr;
  gap: 14px; margin: 20px 0;
}
.mf-item {
  display: flex; gap: 12px; align-items: flex-start;
  background: rgba(0,212,255,0.05);
  border: 1px solid rgba(0,212,255,0.1);
  border-radius: var(--radius); padding: 14px;
}
.mf-icon { font-size: 1.4rem; flex-shrink: 0; }
.mf-item strong { display: block; font-size: 0.85rem; color: var(--text-primary); margin-bottom: 4px; }
.mf-item p { font-size: 0.78rem; color: var(--text-muted); line-height: 1.5; margin: 0; }
.modal-tech-stack { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 4px; }
.tech-pill {
  padding: 5px 14px; border-radius: 20px; font-size: 0.78rem; font-weight: 600;
  background: rgba(0,102,255,0.15); color: #6699ff;
  border: 1px solid rgba(0,102,255,0.3);
}

/* =============================================
   AI CHATBOT DEMO
   ============================================= */
.modal-overlay--demo { align-items: flex-end; padding: 0; }
@media (min-width: 600px) { .modal-overlay--demo { align-items: center; padding: 24px; } }

.demo-box {
  width: 100%; max-width: 480px;
  background: linear-gradient(160deg, #06101f, #0a1830);
  border: 1px solid rgba(0,212,255,0.25);
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  display: flex; flex-direction: column;
  height: 88vh; max-height: 620px;
  box-shadow: 0 -8px 40px rgba(0,212,255,0.15);
  overflow: hidden;
  transform: translateY(40px); opacity: 0;
  transition: transform 0.4s cubic-bezier(0.34,1.56,0.64,1), opacity 0.3s ease;
}
@media (min-width: 600px) {
  .demo-box {
    border-radius: var(--radius-lg);
    box-shadow: 0 0 60px rgba(0,212,255,0.15), var(--shadow);
  }
}
.modal-overlay--demo.active .demo-box { transform: translateY(0); opacity: 1; }

.demo-header {
  padding: 16px 20px;
  background: rgba(0,212,255,0.06);
  border-bottom: 1px solid rgba(0,212,255,0.12);
  display: flex; justify-content: space-between; align-items: center;
  flex-shrink: 0;
}
.demo-header-left { display: flex; gap: 12px; align-items: center; }
.demo-avatar-dot {
  width: 40px; height: 40px; border-radius: 50%;
  background: var(--gradient-accent);
  display: flex; align-items: center; justify-content: center;
  font-size: 1.3rem; flex-shrink: 0;
  box-shadow: 0 0 16px rgba(0,212,255,0.5);
  position: relative;
}
.demo-avatar-dot::after {
  content: '🤖'; position: absolute; font-size: 1.3rem;
}
.demo-avatar-dot::before {
  content: ''; position: absolute; top: 0; right: 0;
  width: 11px; height: 11px; background: #00ff88;
  border-radius: 50%; border: 2px solid #06101f;
  z-index: 1;
  animation: livePulse 1.5s ease-in-out infinite;
}
.demo-title { font-size: 0.95rem; font-weight: 700; }
.demo-subtitle { font-size: 0.72rem; color: #00ff88; }

.demo-chat {
  flex: 1; overflow-y: auto; padding: 20px 16px;
  display: flex; flex-direction: column; gap: 14px;
  scroll-behavior: smooth;
}
.demo-chat::-webkit-scrollbar { width: 4px; }
.demo-chat::-webkit-scrollbar-thumb { background: var(--accent-blue); border-radius: 2px; }

.chat-msg { display: flex; gap: 8px; align-items: flex-end; max-width: 85%; }
.chat-msg.user { flex-direction: row-reverse; align-self: flex-end; }
.chat-msg.bot { align-self: flex-start; }

.chat-bubble {
  padding: 10px 14px; border-radius: 16px;
  font-size: 0.88rem; line-height: 1.6;
  animation: bubblePop 0.3s cubic-bezier(0.34,1.56,0.64,1) both;
}
@keyframes bubblePop {
  from { transform: scale(0.8); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}
.chat-msg.bot .chat-bubble {
  background: rgba(0,212,255,0.1);
  border: 1px solid rgba(0,212,255,0.2);
  color: var(--text-primary);
  border-bottom-left-radius: 4px;
}
.chat-msg.user .chat-bubble {
  background: var(--gradient-accent);
  color: #fff; border-bottom-right-radius: 4px;
}
.chat-time { font-size: 0.65rem; color: var(--text-muted); white-space: nowrap; align-self: flex-end; padding-bottom: 2px; }

.typing-indicator {
  display: flex; gap: 4px; padding: 12px 16px;
  background: rgba(0,212,255,0.08);
  border: 1px solid rgba(0,212,255,0.15);
  border-radius: 16px; border-bottom-left-radius: 4px;
  align-self: flex-start;
}
.typing-indicator span {
  width: 7px; height: 7px; background: var(--accent-cyan);
  border-radius: 50; animation: typingBounce 1.2s ease-in-out infinite;
}
.typing-indicator span:nth-child(2) { animation-delay: 0.2s; }
.typing-indicator span:nth-child(3) { animation-delay: 0.4s; }
@keyframes typingBounce {
  0%, 60%, 100% { transform: translateY(0); opacity: 0.4; }
  30% { transform: translateY(-6px); opacity: 1; }
}

.demo-suggestions {
  padding: 8px 16px; display: flex; gap: 8px;
  flex-wrap: wrap; border-top: 1px solid rgba(0,212,255,0.08);
  flex-shrink: 0;
}
.demo-suggestion-btn {
  padding: 6px 12px; border-radius: 20px; font-size: 0.78rem;
  background: rgba(0,212,255,0.08); border: 1px solid rgba(0,212,255,0.2);
  color: var(--accent-cyan); cursor: pointer; transition: var(--transition);
  font-family: var(--font-main);
}
.demo-suggestion-btn:hover {
  background: rgba(0,212,255,0.18); transform: translateY(-2px);
}

.demo-input-row {
  display: flex; gap: 10px; padding: 12px 16px;
  border-top: 1px solid rgba(0,212,255,0.12);
  background: rgba(0,0,0,0.2); flex-shrink: 0;
}
#demo-input {
  flex: 1; background: rgba(0,212,255,0.05);
  border: 1px solid rgba(0,212,255,0.2);
  border-radius: 24px; padding: 10px 18px;
  color: var(--text-primary); font-size: 0.88rem;
  font-family: var(--font-main); outline: none; transition: var(--transition);
}
#demo-input:focus { border-color: var(--accent-cyan); box-shadow: 0 0 0 3px rgba(0,212,255,0.1); }
#demo-input::placeholder { color: var(--text-muted); }
.demo-send-btn {
  width: 42px; height: 42px; border-radius: 50%;
  background: var(--gradient-accent); border: none;
  color: #fff; font-size: 1.1rem;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0; transition: var(--transition);
  box-shadow: 0 0 16px rgba(0,102,255,0.4);
}
.demo-send-btn:hover { transform: scale(1.1) rotate(-10deg); box-shadow: 0 0 24px rgba(0,102,255,0.6); }

@media (max-width: 480px) {
  .modal-feature-grid { grid-template-columns: 1fr; }
}

/* =============================================
   AI CHAT SECTION (#ai-chat)
   ============================================= */
.ai-chat-section {
  background: var(--bg-secondary);
  position: relative;
  z-index: 1;
}
.ai-chat-section::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at 80% 20%, rgba(0, 212, 255, 0.05) 0%, transparent 60%);
  pointer-events: none;
}
.ai-chat-container {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 24px;
  background: rgba(13, 31, 60, 0.45);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  box-shadow: var(--shadow);
  overflow: hidden;
  height: 600px;
}
.ai-chat-sidebar {
  background: rgba(5, 13, 26, 0.5);
  border-right: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
}
.sidebar-header {
  padding: 20px;
  border-bottom: 1px solid var(--border-color);
}
.sidebar-header h4 {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--accent-cyan);
}
.sidebar-body {
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 20px;
  overflow-y: auto;
  flex: 1;
}
.settings-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.settings-group label {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-secondary);
}
.ai-select, .ai-input {
  background: rgba(13, 31, 60, 0.6);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  color: var(--text-primary);
  padding: 10px 12px;
  font-size: 0.88rem;
  outline: none;
  font-family: var(--font-main);
  transition: var(--transition);
}
.ai-select:focus, .ai-input:focus {
  border-color: var(--accent-cyan);
  box-shadow: 0 0 10px rgba(0, 212, 255, 0.15);
}
.settings-help {
  font-size: 0.72rem;
  color: var(--text-muted);
  line-height: 1.4;
}

/* Chat Workspace */
.ai-chat-workspace {
  display: flex;
  flex-direction: column;
  height: 100%;
}
.workspace-header {
  padding: 16px 24px;
  background: rgba(5, 13, 26, 0.3);
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
}
.status-indicator {
  display: flex;
  align-items: center;
  gap: 12px;
}
.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
}
.status-dot.online {
  background: #00ff66;
  box-shadow: 0 0 8px #00ff66;
}
.status-dot.loading {
  background: #ffcc00;
  box-shadow: 0 0 8px #ffcc00;
  animation: pulse 1s infinite alternate;
}
.status-name {
  display: block;
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text-primary);
}
.status-desc {
  display: block;
  font-size: 0.75rem;
  color: var(--text-muted);
}
.workspace-messages {
  flex: 1;
  overflow-y: auto;
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 18px;
  scroll-behavior: smooth;
}

/* Workspace Messages Scrollbar */
.workspace-messages::-webkit-scrollbar, .sidebar-body::-webkit-scrollbar {
  width: 6px;
}
.workspace-messages::-webkit-scrollbar-track, .sidebar-body::-webkit-scrollbar-track {
  background: transparent;
}
.workspace-messages::-webkit-scrollbar-thumb, .sidebar-body::-webkit-scrollbar-thumb {
  background: rgba(0, 212, 255, 0.15);
  border-radius: 3px;
}
.workspace-messages::-webkit-scrollbar-thumb:hover, .sidebar-body::-webkit-scrollbar-thumb:hover {
  background: var(--accent-cyan);
}

.workspace-suggestions {
  padding: 8px 24px;
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.ai-suggestion-btn {
  padding: 8px 14px;
  border-radius: 20px;
  font-size: 0.8rem;
  background: rgba(0, 212, 255, 0.05);
  border: 1px solid rgba(0, 212, 255, 0.15);
  color: var(--text-secondary);
  cursor: pointer;
  transition: var(--transition);
  font-family: var(--font-main);
}
.ai-suggestion-btn:hover {
  background: rgba(0, 212, 255, 0.12);
  border-color: var(--accent-cyan);
  color: var(--accent-cyan);
  transform: translateY(-1px);
}

.workspace-input-area {
  padding: 16px 24px 24px;
  border-top: 1px solid var(--border-color);
  background: rgba(5, 13, 26, 0.4);
  display: flex;
  gap: 12px;
  align-items: flex-end;
}
#ai-user-input {
  flex: 1;
  background: rgba(13, 31, 60, 0.6);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 12px 16px;
  color: var(--text-primary);
  font-size: 0.95rem;
  font-family: var(--font-main);
  outline: none;
  resize: none;
  max-height: 120px;
  min-height: 48px;
  transition: var(--transition);
}
#ai-user-input:focus {
  border-color: var(--accent-cyan);
  box-shadow: 0 0 10px rgba(0, 212, 255, 0.1);
}
.workspace-input-area .send-btn {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  background: var(--gradient-accent);
  border: none;
  color: #fff;
  font-size: 1.15rem;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: var(--transition);
  box-shadow: 0 4px 16px rgba(0, 102, 255, 0.35);
  flex-shrink: 0;
}
.workspace-input-area .send-btn:hover {
  transform: scale(1.05);
  box-shadow: 0 6px 22px rgba(0, 102, 255, 0.55);
}

/* Chat bubble stylings */
.ai-msg {
  display: flex;
  flex-direction: column;
  max-width: 80%;
  animation: bubblePop 0.35s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}
.ai-msg.user {
  align-self: flex-end;
}
.ai-msg.bot {
  align-self: flex-start;
}
.ai-bubble {
  padding: 14px 18px;
  border-radius: 16px;
  font-size: 0.92rem;
  line-height: 1.6;
}
.ai-msg.bot .ai-bubble {
  background: rgba(13, 31, 60, 0.7);
  border: 1px solid var(--border-color);
  color: var(--text-primary);
  border-bottom-left-radius: 4px;
}
.ai-msg.user .ai-bubble {
  background: var(--gradient-accent);
  color: #fff;
  border-bottom-right-radius: 4px;
  box-shadow: 0 4px 12px rgba(0, 102, 255, 0.2);
}
.ai-msg-time {
  font-size: 0.7rem;
  color: var(--text-muted);
  margin-top: 4px;
  align-self: flex-end;
}
.ai-msg.bot .ai-msg-time {
  align-self: flex-start;
}

/* Markdown parsing rendering styles */
.ai-bubble p {
  margin-bottom: 12px;
}
.ai-bubble p:last-child {
  margin-bottom: 0;
}
.ai-bubble ul, .ai-bubble ol {
  margin-left: 20px;
  margin-bottom: 12px;
  list-style-type: disc;
}
.ai-bubble ol {
  list-style-type: decimal;
}
.ai-bubble li {
  margin-bottom: 6px;
}
.ai-bubble strong {
  color: var(--accent-cyan);
  font-weight: 600;
}
.ai-msg.user .ai-bubble strong {
  color: #fff;
  text-decoration: underline;
}
.ai-bubble pre {
  background: rgba(5, 13, 26, 0.8);
  border: 1px solid rgba(0, 212, 255, 0.15);
  border-radius: 8px;
  padding: 12px;
  overflow-x: auto;
  margin: 12px 0;
}
.ai-bubble code {
  font-family: Consolas, Monaco, 'Andale Mono', 'Ubuntu Mono', monospace;
  font-size: 0.85rem;
  background: rgba(0, 0, 0, 0.3);
  padding: 2px 6px;
  border-radius: 4px;
  color: var(--accent-cyan);
}
.ai-msg.user .ai-bubble code {
  color: #fff;
  background: rgba(255, 255, 255, 0.2);
}
.ai-bubble pre code {
  background: transparent;
  padding: 0;
  color: var(--text-primary);
  display: block;
}

/* Workspace typing indicator inside chat section */
.workspace-typing {
  display: flex;
  gap: 4px;
  padding: 14px 18px;
  background: rgba(13, 31, 60, 0.7);
  border: 1px solid var(--border-color);
  border-radius: 16px;
  border-bottom-left-radius: 4px;
  align-self: flex-start;
}
.workspace-typing span {
  width: 8px;
  height: 8px;
  background: var(--accent-cyan);
  border-radius: 50%;
  animation: typingBounce 1.2s ease-in-out infinite;
}
.workspace-typing span:nth-child(2) { animation-delay: 0.2s; }
.workspace-typing span:nth-child(3) { animation-delay: 0.4s; }

/* Responsive Grid for AI Chat */
@media (max-width: 992px) {
  .ai-chat-container {
    grid-template-columns: 1fr;
    height: 700px;
  }
  .ai-chat-sidebar {
    border-right: none;
    border-bottom: 1px solid var(--border-color);
    max-height: 200px;
  }
}
@media (max-width: 576px) {
  .ai-chat-container {
    height: 550px;
  }
  .ai-chat-sidebar {
    max-height: 160px;
  }
  .ai-msg {
    max-width: 90%;
  }
}
