/* Smooth Scrolling & Hardware GPU Performance Tuning */
html {
  scroll-behavior: smooth;
  -webkit-overflow-scrolling: touch;
  text-rendering: optimizeSpeed;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Hardware GPU Acceleration to Eliminate Render Stutter */
header, .project-card, #three-container, #ai-chat-modal, .hero-avatar-levitate {
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  will-change: transform;
  transform: translateZ(0);
  -webkit-transform: translateZ(0);
}

img {
  content-visibility: auto;
}

:root {
  --bg-dark: #030712;
  --bg-card: rgba(15, 23, 42, 0.7);
  --primary: #00f0ff;
  --secondary: #8a2be2;
  --text-main: #f8fafc;
  --text-muted: #94a3b8;
}

/* Custom Scrollbars */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

::-webkit-scrollbar-track {
  background: #030712;
}

::-webkit-scrollbar-thumb {
  background: rgba(0, 240, 255, 0.4);
  border-radius: 9999px;
}

::-webkit-scrollbar-thumb:hover {
  background: rgba(0, 240, 255, 0.8);
}

/* Featured Project Cards Styling & Guaranteed Visibility */
.project-card {
  background: rgba(15, 23, 42, 0.8) !important;
  border: 1px solid rgba(255, 255, 255, 0.12) !important;
  border-radius: 1rem !important;
  overflow: hidden !important;
  cursor: pointer !important;
  transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275), border-color 0.3s ease, box-shadow 0.3s ease !important;
  backdrop-filter: blur(12px) !important;
  display: flex !important;
  flex-direction: column !important;
  justify-content: space-between !important;
  opacity: 1 !important; /* Prevents GSAP scroll trigger opacity bugs from hiding cards */
  visibility: visible !important;
}

.project-card:hover {
  transform: translateY(-8px) scale(1.02) !important;
  border-color: rgba(0, 240, 255, 0.6) !important;
  box-shadow: 0 12px 35px rgba(0, 240, 255, 0.3) !important;
}

/* Anti-Gravity Floating Levitation Animation for Profile Picture */
.hero-avatar-levitate {
  animation: floatLevitate 5s ease-in-out infinite alternate;
}

@keyframes floatLevitate {
  0% {
    transform: translateY(0px) rotate(0deg);
    filter: drop-shadow(0 0 25px rgba(0, 240, 255, 0.4));
  }
  50% {
    transform: translateY(-18px) rotate(1.5deg);
    filter: drop-shadow(0 0 45px rgba(138, 43, 226, 0.6));
  }
  100% {
    transform: translateY(0px) rotate(0deg);
    filter: drop-shadow(0 0 25px rgba(0, 240, 255, 0.4));
  }
}

/* Mouse-Following Cute AI Bot Companion */
#ai-companion {
  position: fixed;
  top: 50%;
  left: 50%;
  width: 60px;
  height: 60px;
  z-index: 9999;
  pointer-events: none; /* CRITICAL: Allows clicks to pass through to cards, buttons, and close icons */
  user-select: none;
  transition: opacity 0.3s ease;
}

#ai-companion.hidden-bot {
  opacity: 0 !important;
  pointer-events: none !important;
}

#ai-companion.avoid-mode {
  opacity: 0.35 !important;
  transform: scale(0.8) !important;
  transition: opacity 0.35s ease, transform 0.35s ease;
}

.ai-glow {
  position: absolute;
  inset: -8px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(0, 240, 255, 0.5) 0%, rgba(138, 43, 226, 0.2) 60%, transparent 100%);
  filter: blur(8px);
  animation: companionPulse 2.5s ease-in-out infinite alternate;
  pointer-events: none;
}

@keyframes companionPulse {
  0% { transform: scale(0.9); opacity: 0.6; }
  100% { transform: scale(1.15); opacity: 0.95; }
}

/* Robot Head Container */
.ai-face {
  position: relative;
  width: 56px;
  height: 46px;
  margin: 8px auto 0;
  background: #050b14;
  border: 2.5px solid #00f0ff;
  border-radius: 18px;
  box-shadow: 0 0 15px rgba(0, 240, 255, 0.6), inset 0 0 10px rgba(0, 240, 255, 0.3);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 2;
  pointer-events: auto; /* Clickable head capsule! */
  cursor: pointer;
  transition: transform 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275), box-shadow 0.2s ease;
}

.ai-face:hover {
  transform: scale(1.15);
  box-shadow: 0 0 25px rgba(0, 240, 255, 1), inset 0 0 15px rgba(0, 240, 255, 0.6);
}

/* Floating Click Me Badge */
.ai-click-badge {
  position: absolute;
  top: -26px;
  left: 50%;
  transform: translateX(-50%);
  background: linear-gradient(135deg, #00f0ff, #8a2be2);
  color: #030712;
  font-weight: 800;
  font-size: 9.5px;
  font-family: 'JetBrains Mono', monospace;
  padding: 2px 8px;
  border-radius: 9999px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  box-shadow: 0 0 15px rgba(0, 240, 255, 0.8);
  animation: clickBadgePulse 1.5s ease-in-out infinite alternate;
  white-space: nowrap;
  pointer-events: none;
  z-index: 12;
}

@keyframes clickBadgePulse {
  0% { transform: translateX(-50%) scale(0.95); box-shadow: 0 0 10px rgba(0, 240, 255, 0.6); }
  100% { transform: translateX(-50%) scale(1.1); box-shadow: 0 0 22px rgba(138, 43, 226, 0.9); }
}

/* Robot Feet for Walking Animation */
.ai-feet {
  position: absolute;
  bottom: -9px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 12px;
  opacity: 0;
  pointer-events: none;
  z-index: 1;
  transition: opacity 0.3s ease, bottom 0.3s ease;
}

.ai-foot {
  width: 10px;
  height: 9px;
  background: #00f0ff;
  border-radius: 3px 3px 5px 5px;
  box-shadow: 0 0 8px #00f0ff;
}

/* Walking State - Feet Extend & Step */
#ai-companion.walking .ai-feet {
  opacity: 1;
  bottom: -11px;
}

#ai-companion.walking .ai-foot.left {
  animation: robotStepLeft 0.22s infinite alternate ease-in-out;
}

#ai-companion.walking .ai-foot.right {
  animation: robotStepRight 0.22s infinite alternate ease-in-out 0.11s;
}

@keyframes robotStepLeft {
  0% { transform: translateY(0) rotate(0deg); }
  100% { transform: translateY(-7px) rotate(-18deg); }
}

@keyframes robotStepRight {
  0% { transform: translateY(0) rotate(0deg); }
  100% { transform: translateY(-7px) rotate(18deg); }
}

/* Robot Ears / Headphones on sides */
.ai-ears {
  position: absolute;
  top: 18px;
  left: -2px;
  right: -2px;
  height: 24px;
  pointer-events: none;
  z-index: 1;
}

.ai-ears::before, .ai-ears::after {
  content: '';
  position: absolute;
  width: 7px;
  height: 22px;
  background: #00f0ff;
  border-radius: 4px;
  box-shadow: 0 0 10px #00f0ff;
}

.ai-ears::before {
  left: 0;
}

.ai-ears::after {
  right: 0;
}

/* Robot Antenna on top with glowing red dot */
.ai-antenna {
  position: absolute;
  top: -10px;
  left: 50%;
  transform: translateX(-50%);
  width: 2px;
  height: 10px;
  background: #00f0ff;
  box-shadow: 0 0 5px #00f0ff;
  z-index: 1;
}

.ai-antenna::before {
  content: '';
  position: absolute;
  top: -6px;
  left: 50%;
  transform: translateX(-50%);
  width: 7px;
  height: 7px;
  background: #ff0055;
  border-radius: 50%;
  box-shadow: 0 0 10px #ff0055, 0 0 15px #ff0055;
  animation: antennaBlink 1.5s infinite alternate;
}

@keyframes antennaBlink {
  0% { opacity: 0.4; transform: translateX(-50%) scale(0.8); }
  100% { opacity: 1; transform: translateX(-50%) scale(1.2); }
}

/* Robot Eyes */
.ai-eye-container {
  display: flex;
  gap: 12px;
  margin-top: 2px;
}

.ai-eye {
  width: 8px;
  height: 8px;
  background: #00f0ff;
  border-radius: 50%;
  box-shadow: 0 0 8px #00f0ff, 0 0 12px #00f0ff;
  animation: eyeBlink 4s infinite;
}

@keyframes eyeBlink {
  0%, 96%, 100% { transform: scaleY(1); }
  98% { transform: scaleY(0.1); }
}

/* Robot Mouth */
.ai-mouth {
  width: 16px;
  height: 6px;
  border-bottom: 2px solid #00f0ff;
  border-radius: 0 0 8px 8px;
  margin-top: 4px;
  box-shadow: 0 2px 5px rgba(0, 240, 255, 0.5);
  transition: all 0.2s ease;
}

.ai-face.happy .ai-mouth {
  height: 8px;
  border-bottom: 3.5px solid #00f0ff;
  border-radius: 0 0 10px 10px;
}

.ai-face.surprised .ai-mouth {
  width: 8px;
  height: 8px;
  border: 2px solid #00f0ff;
  border-radius: 50%;
}

/* Floating Message Tooltip */
.ai-message {
  position: absolute;
  bottom: 68px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(3, 7, 18, 0.92);
  border: 1px solid rgba(0, 240, 255, 0.5);
  color: #00f0ff;
  padding: 6px 12px;
  border-radius: 12px;
  font-size: 11px;
  font-family: 'Outfit', sans-serif;
  font-weight: 500;
  white-space: nowrap;
  box-shadow: 0 0 20px rgba(0, 240, 255, 0.3);
  backdrop-filter: blur(10px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease, transform 0.3s ease;
  z-index: 10;
}

.ai-message::after {
  content: '';
  position: absolute;
  bottom: -5px;
  left: 50%;
  transform: translateX(-50%);
  border-width: 5px 5px 0;
  border-style: solid;
  border-color: rgba(0, 240, 255, 0.5) transparent;
  display: block;
  width: 0;
}

.ai-message.visible {
  opacity: 1;
  transform: translateX(-50%) translateY(-4px);
}

/* Project Card Styles */
.project-card {
  position: relative;
  background: var(--bg-card);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 1rem;
  overflow: hidden;
  backdrop-filter: blur(12px);
  transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
  cursor: pointer;
}

.project-card:hover {
  border-color: rgba(0, 240, 255, 0.5);
  box-shadow: 0 0 30px rgba(0, 240, 255, 0.2);
  transform: translateY(-4px);
}

.project-card .card-image {
  position: relative;
  width: 100%;
  height: 200px;
  overflow: hidden;
}

.project-card .card-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

.project-card:hover .card-image img {
  transform: scale(1.08);
}

.project-card .card-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(3, 7, 18, 0.95), transparent);
  opacity: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity 0.3s ease;
}

.project-card:hover .card-overlay {
  opacity: 1;
}

.click-hint {
  padding: 0.5rem 1rem;
  border-radius: 9999px;
  background: rgba(0, 240, 255, 0.15);
  border: 1px solid rgba(0, 240, 255, 0.4);
  color: #00f0ff;
  font-size: 0.75rem;
  font-family: 'JetBrains Mono', monospace;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.project-card .card-content {
  padding: 1.25rem;
}

.project-card .category {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.7rem;
  color: #00f0ff;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.project-card h3 {
  font-size: 1.15rem;
  font-weight: 700;
  color: #f8fafc;
  margin: 0.35rem 0 0.5rem;
  line-height: 1.3;
}

.project-card p {
  font-size: 0.825rem;
  color: #94a3b8;
  line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.project-card .tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin-top: 1rem;
}

.project-card .tags span {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.65rem;
  padding: 0.2rem 0.5rem;
  border-radius: 0.375rem;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: #cbd5e1;
}

/* Modals */
.modal {
  position: fixed;
  inset: 0;
  background: rgba(3, 7, 18, 0.85);
  backdrop-filter: blur(16px);
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.modal.active {
  opacity: 1;
  pointer-events: auto;
}

.modal-content, .private-modal-content {
  background: rgba(3, 7, 18, 0.96);
  border: 1px solid rgba(0, 240, 255, 0.4);
  border-radius: 1.5rem;
  width: 100%;
  max-width: 720px;
  max-height: 88vh;
  overflow-y: auto;
  position: relative;
  box-shadow: 0 0 60px rgba(0, 240, 255, 0.2), 0 0 90px rgba(0, 0, 0, 0.9);
  backdrop-filter: blur(20px);
}

.modal-close {
  position: absolute;
  top: 1.25rem;
  right: 1.25rem;
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 9999px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: #fff;
  font-size: 1.25rem;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 20;
  transition: all 0.25s ease;
}

.modal-close:hover {
  background: #ef4444;
  border-color: #ef4444;
  transform: rotate(90deg);
}

.modal-hero {
  position: relative;
  height: 220px;
  overflow: hidden;
}

.modal-hero img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.modal-hero-content {
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, #0f172a 15%, transparent);
  display: flex;
  flex-col: column;
  justify-content: flex-end;
  padding: 1.5rem;
}

.modal-hero-content h2 {
  font-size: 1.4rem;
  font-weight: 800;
  color: #fff;
}

.modal-summary {
  font-size: 0.85rem;
  color: #94a3b8;
  margin-top: 0.25rem;
}

.modal-details {
  padding: 1.5rem;
}

.features-list h3 {
  font-size: 0.9rem;
  font-family: 'JetBrains Mono', monospace;
  color: #00f0ff;
  text-transform: uppercase;
  margin-bottom: 0.75rem;
}

.features-list ul {
  list-style: none;
  space-y: 0.5rem;
}

.features-list li {
  font-size: 0.85rem;
  color: #cbd5e1;
  margin-bottom: 0.5rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.features-list li i {
  color: #00f0ff;
  font-size: 0.75rem;
}

.modal-actions {
  display: flex;
  gap: 0.75rem;
  margin-top: 1.5rem;
}

.modal-actions .btn {
  padding: 0.6rem 1.2rem;
  border-radius: 0.75rem;
  font-size: 0.8rem;
  font-weight: 600;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  transition: all 0.2s ease;
}

.modal-actions .btn.primary {
  background: linear-gradient(to right, #00f0ff, #3b82f6);
  color: #030712;
}

.modal-actions .btn.secondary {
  background: rgba(255, 255, 255, 0.1);
  color: #e2e8f0;
  border: 1px solid rgba(255, 255, 255, 0.2);
}

/* Private Repo Modal Styling */
.private-modal-body {
  padding: 2rem;
  text-align: center;
}

.private-icon {
  width: 3.5rem;
  height: 3.5rem;
  border-radius: 9999px;
  background: rgba(239, 68, 68, 0.15);
  border: 1px solid rgba(239, 68, 68, 0.3);
  color: #ef4444;
  font-size: 1.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 1rem;
}

.private-modal-body h3 {
  font-size: 1.25rem;
  font-weight: 700;
  color: #fff;
  margin-bottom: 0.5rem;
}

.private-modal-body p {
  font-size: 0.85rem;
  color: #94a3b8;
  line-height: 1.6;
}

.private-note {
  margin-top: 0.5rem;
  font-[0.8rem];
  color: #64748b;
}

.private-actions {
  display: flex;
  justify-content: center;
  gap: 0.75rem;
  margin-top: 1.5rem;
}

/* Toast Notification Styles */
#toast-container {
  position: fixed;
  bottom: 1.5rem;
  left: 1.5rem;
  z-index: 120;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  max-width: 360px;
}

.toast {
  padding: 1rem 1.25rem;
  border-radius: 0.75rem;
  background: #0f172a;
  border: 1px solid rgba(0, 240, 255, 0.3);
  color: #fff;
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.8);
  opacity: 0;
  transform: translateY(20px);
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.toast.show {
  opacity: 1;
  transform: translateY(0);
}

.toast.success {
  border-color: rgba(34, 197, 94, 0.4);
}

.toast.success .toast-icon {
  color: #22c55e;
}

.toast.error {
  border-color: rgba(239, 68, 68, 0.4);
}

.toast.error .toast-icon {
  color: #ef4444;
}

.toast-content h4 {
  font-size: 0.85rem;
  font-weight: 700;
}

.toast-content p {
  font-size: 0.75rem;
  color: #94a3b8;
  margin-top: 0.2rem;
}

/* 3D Ring Perspective Carousel Styling for Certificates Section */
#certificates-carousel-container {
  perspective: 1200px;
  -webkit-perspective: 1200px;
  transform-style: preserve-3d;
  position: relative;
}

#certificates-track {
  perspective: 1000px;
  transform-style: preserve-3d;
  scroll-behavior: smooth;
  padding: 1.5rem 0.5rem;
}

/* Certificate 3D Ring Card Styling */
.cert-card {
  position: relative;
  transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1), border-color 0.3s ease, box-shadow 0.4s ease, opacity 0.4s ease;
  transform-style: preserve-3d;
  will-change: transform, opacity;
  background: rgba(15, 23, 42, 0.85) !important;
  border: 1px solid rgba(251, 191, 36, 0.25) !important;
  backdrop-filter: blur(12px) !important;
}

.cert-card:hover {
  transform: translateY(-10px) scale(1.04) translateZ(30px) !important;
  border-color: rgba(251, 191, 36, 0.8) !important;
  box-shadow: 0 15px 40px rgba(251, 191, 36, 0.35), 0 0 25px rgba(0, 240, 255, 0.2) !important;
  z-index: 20;
}

/* Ambient 3D Glowing Ring Background Decoration */
.cert-ring-glow {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 95%;
  height: 220px;
  background: radial-gradient(ellipse at center, rgba(251, 191, 36, 0.15) 0%, rgba(138, 43, 226, 0.1) 50%, transparent 75%);
  border-radius: 50%;
  filter: blur(40px);
  pointer-events: none;
  z-index: 0;
  animation: ringGlowPulse 4s ease-in-out infinite alternate;
}

@keyframes ringGlowPulse {
  0% { transform: translate(-50%, -50%) scale(0.95); opacity: 0.5; }
  100% { transform: translate(-50%, -50%) scale(1.1); opacity: 0.85; }
}

/* ==========================================
   Executive Premium Light Mode Theme System
   ========================================== */
html:not(.dark) body {
  background-color: #f8fafc !important;
  background-image: 
    radial-gradient(at 15% 15%, rgba(14, 165, 233, 0.08) 0px, transparent 50%),
    radial-gradient(at 85% 25%, rgba(168, 85, 247, 0.08) 0px, transparent 50%),
    radial-gradient(at 50% 75%, rgba(59, 130, 246, 0.06) 0px, transparent 50%);
  background-attachment: fixed;
  color: #0f172a;
}

/* Header Container Glass in Light Mode */
html:not(.dark) #nav-header-container {
  background: rgba(255, 255, 255, 0.85) !important;
  border: 1px solid rgba(203, 213, 225, 0.85) !important;
  box-shadow: 0 4px 25px rgba(15, 23, 42, 0.06) !important;
  backdrop-filter: blur(16px) !important;
}

/* Featured Project Cards in Light Mode */
html:not(.dark) .project-card {
  background: #ffffff !important;
  border: 1px solid rgba(226, 232, 240, 0.9) !important;
  box-shadow: 0 10px 30px rgba(15, 23, 42, 0.05), 0 1px 3px rgba(0, 0, 0, 0.04) !important;
}

html:not(.dark) .project-card:hover {
  border-color: rgba(6, 182, 212, 0.6) !important;
  box-shadow: 0 20px 40px rgba(6, 182, 212, 0.18), 0 4px 12px rgba(0, 0, 0, 0.05) !important;
}

html:not(.dark) .project-card .card-image {
  background: #f1f5f9 !important;
  border-bottom: 1px solid rgba(226, 232, 240, 0.8) !important;
}

html:not(.dark) .project-card .card-overlay {
  background: linear-gradient(to top, rgba(255, 255, 255, 0.95), transparent) !important;
}

html:not(.dark) .click-hint {
  background: rgba(6, 182, 212, 0.1) !important;
  border: 1px solid rgba(6, 182, 212, 0.4) !important;
  color: #0284c7 !important;
}

html:not(.dark) .project-card h3 {
  color: #0f172a !important;
}

html:not(.dark) .project-card p {
  color: #334155 !important;
}

html:not(.dark) .project-card .tags span {
  background: #f1f5f9 !important;
  border-color: #cbd5e1 !important;
  color: #334155 !important;
}

/* Certificate Cards in Light Mode */
html:not(.dark) .cert-card {
  background: #ffffff !important;
  border: 1px solid rgba(251, 191, 36, 0.35) !important;
  box-shadow: 0 10px 30px rgba(15, 23, 42, 0.05) !important;
}

html:not(.dark) .cert-card:hover {
  border-color: rgba(217, 119, 6, 0.75) !important;
  box-shadow: 0 20px 45px rgba(217, 119, 6, 0.18) !important;
}

/* Modals & Popups in Light Mode */
html:not(.dark) .modal {
  background: rgba(15, 23, 42, 0.4) !important;
  backdrop-filter: blur(12px) !important;
}

html:not(.dark) .modal-content,
html:not(.dark) .private-modal-content {
  background: #ffffff !important;
  border: 1px solid rgba(6, 182, 212, 0.4) !important;
  box-shadow: 0 25px 70px rgba(15, 23, 42, 0.15) !important;
  color: #0f172a !important;
}

html:not(.dark) .modal-close {
  background: rgba(15, 23, 42, 0.06) !important;
  border: 1px solid rgba(15, 23, 42, 0.15) !important;
  color: #0f172a !important;
}

html:not(.dark) .modal-close:hover {
  background: #ef4444 !important;
  color: #ffffff !important;
}

/* AI Chat Drawer in Light Mode */
html:not(.dark) #ai-chat-modal {
  background: rgba(255, 255, 255, 0.96) !important;
  border: 1px solid rgba(6, 182, 212, 0.4) !important;
  box-shadow: 0 20px 50px rgba(15, 23, 42, 0.15) !important;
}

html:not(.dark) #ai-chat-modal .p-4.border-b {
  background: linear-gradient(to right, #f8fafc, #f1f5f9) !important;
  border-bottom: 1px solid rgba(226, 232, 240, 0.8) !important;
}

html:not(.dark) #ai-chat-modal h4 {
  color: #0f172a !important;
}

html:not(.dark) #chat-messages {
  background: #f8fafc !important;
}

html:not(.dark) #chat-input-form {
  background: #ffffff !important;
  border-top: 1px solid rgba(226, 232, 240, 0.8) !important;
}

html:not(.dark) #chat-user-input {
  color: #0f172a !important;
}

/* Interactive Companion Robot in Light Mode */
html:not(.dark) .ai-face {
  background: #ffffff !important;
  border-color: #0284c7 !important;
  box-shadow: 0 0 15px rgba(2, 132, 199, 0.35), inset 0 0 10px rgba(2, 132, 199, 0.1) !important;
}

html:not(.dark) .ai-message {
  background: #ffffff !important;
  border-color: rgba(2, 132, 199, 0.4) !important;
  color: #0284c7 !important;
  box-shadow: 0 4px 20px rgba(15, 23, 42, 0.1) !important;
}

/* Scrollbars in Light Mode */
html:not(.dark) ::-webkit-scrollbar-track {
  background: #f1f5f9;
}

html:not(.dark) ::-webkit-scrollbar-thumb {
  background: rgba(2, 132, 199, 0.35);
}

html:not(.dark) ::-webkit-scrollbar-thumb:hover {
  background: rgba(2, 132, 199, 0.7);
}

/* --- Section Interactive Micro-Animations & Hover Elevations --- */
#about .grid-cols-2 > div,
#about .grid-cols-3 > div,
#contactForm,
#contact .lg\:col-span-5 > div,
#research .max-w-4xl > div {
  transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.4s ease, border-color 0.4s ease;
}

#about .grid-cols-2 > div:hover {
  transform: translateY(-5px);
  border-color: rgba(0, 240, 255, 0.5);
  box-shadow: 0 15px 35px rgba(0, 240, 255, 0.15);
}

#about .grid-cols-3 > div:hover {
  transform: translateY(-4px) scale(1.03);
  border-color: rgba(138, 43, 226, 0.4);
}

#contactForm:hover,
#contact .lg\:col-span-5 > div:hover {
  box-shadow: 0 15px 40px rgba(0, 240, 255, 0.12);
}

.nav-link {
  position: relative;
}

.nav-link::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  width: 0%;
  height: 2px;
  background: linear-gradient(90deg, #00f0ff, #8a2be2);
  transition: width 0.3s ease;
  border-radius: 2px;
}

.nav-link:hover::after {
  width: 100%;
}