/* ==========================================================================
   1. Variables & Theme
   ========================================================================== */
:root {
  /* Colors */
  --primary-color: #10b981;
  --primary-dark: #059669;
  --secondary-color: #14b8a6;
  --accent-color: #06b6d4;
  --success-color: #10b981;
  
  /* Backgrounds */
  --bg-body: #f8fafc;
  --bg-card: #ffffff;
  --bg-nav: rgba(255, 255, 255, 0.95);
  --bg-dark: #1e293b;
  --bg-darker: #0f172a;
  
  /* Text */
  --text-main: #334155;
  --text-muted: #64748b;
  --text-light: #f8fafc;
  --text-heading: #0f172a;
  
  /* Borders */
  --border-color: #e2e8f0;
  --border-radius: 12px;
  
  /* Shadows */
  --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.05);
  --shadow-lg: 0 10px 25px rgba(0, 0, 0, 0.1);
  
  /* Transitions */
  --transition-fast: 0.2s ease;
  --transition-normal: 0.3s ease;
  --transition-slow: 0.6s ease;
}

[data-theme="dark"] {
  /* Colors */
  --primary-color: #34d399;
  --primary-dark: #10b981;
  --secondary-color: #2dd4bf;
  
  /* Backgrounds */
  --bg-body: #0f172a;
  --bg-card: #1e293b;
  --bg-nav: rgba(15, 23, 42, 0.95);
  --bg-dark: #020617;
  --bg-darker: #000000;
  
  /* Text */
  --text-main: #cbd5e1;
  --text-muted: #94a3b8;
  --text-light: #f1f5f9;
  --text-heading: #f8fafc;
  
  /* Borders */
  --border-color: #334155;
}

/* ==========================================================================
   2. Reset & Base Styles
   ========================================================================== */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  color: var(--text-main);
  background-color: var(--bg-body);
  line-height: 1.6;
  overflow-x: hidden;
  transition: background-color var(--transition-normal), color var(--transition-normal);
}

a {
  text-decoration: none;
  color: inherit;
  transition: color var(--transition-fast);
}

ul {
  list-style: none;
}

img {
  max-width: 100%;
  height: auto;
}

/* ==========================================================================
   3. Layout & Utilities
   ========================================================================== */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 2rem;
}

.section {
  padding: 5rem 0;
  opacity: 0;
  transform: translateY(20px);
  transition: opacity var(--transition-slow), transform var(--transition-slow);
}

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

.section-alt {
  background-color: var(--bg-card);
}

.section-title {
  font-size: 2.5rem;
  font-weight: 700;
  text-align: center;
  margin-bottom: 3rem;
  color: var(--text-heading);
  position: relative;
  padding-bottom: 1rem;
}

.section-title::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 60px;
  height: 4px;
  background: linear-gradient(90deg, var(--primary-color), var(--secondary-color));
  border-radius: 2px;
}

/* ==========================================================================
   4. Components
   ========================================================================== */

/* --- Navigation --- */
.navbar {
  position: fixed;
  top: 0;
  width: 100%;
  background: var(--bg-nav);
  backdrop-filter: blur(10px);
  box-shadow: var(--shadow-sm);
  z-index: 1000;
  transition: all var(--transition-normal);
}

.navbar .container {
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 1rem 2rem;
  position: relative;
}

.nav-menu {
  display: flex;
  gap: 2rem;
}

.nav-menu a {
  color: var(--text-main);
  font-weight: 500;
  position: relative;
}

.nav-menu a:hover,
.nav-menu a.active {
  color: var(--primary-color);
}

.nav-menu a::after {
  content: '';
  position: absolute;
  bottom: -5px;
  left: 0;
  width: 0;
  height: 2px;
  background-color: var(--primary-color);
  transition: width var(--transition-normal);
}

.nav-menu a:hover::after,
.nav-menu a.active::after {
  width: 100%;
}

.hamburger {
  display: none;
  flex-direction: column;
  cursor: pointer;
  gap: 5px;
  position: absolute;
  left: 2rem; /* Position left on mobile */
}

.hamburger span {
  width: 25px;
  height: 3px;
  background-color: var(--text-main);
  transition: all var(--transition-normal);
}

/* --- Theme Toggle --- */
.theme-toggle {
  background: none;
  border: none;
  color: var(--text-main);
  font-size: 1.2rem;
  cursor: pointer;
  padding: 0.5rem;
  transition: color var(--transition-normal);
  position: absolute;
  right: 2rem;
  top: 50%;
  transform: translateY(-50%);
}

.theme-toggle:hover {
  color: var(--primary-color);
}

/* --- Buttons --- */
.btn {
  display: inline-block;
  padding: 0.875rem 2rem;
  border-radius: 8px;
  font-weight: 600;
  border: 2px solid transparent;
  transition: all var(--transition-normal);
}

.btn-primary {
  background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
  color: white;
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
  background: linear-gradient(135deg, var(--primary-dark), var(--primary-color));
}

.btn-secondary {
  background-color: transparent;
  color: var(--primary-color);
  border-color: var(--primary-color);
}

.btn-secondary:hover {
  background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
  color: white;
  border-color: transparent;
  transform: translateY(-2px);
}

/* --- Scroll to Top --- */
.scroll-top {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  background: var(--primary-color);
  color: white;
  width: 45px;
  height: 45px;
  border-radius: 50%;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  box-shadow: var(--shadow-md);
  opacity: 0;
  visibility: hidden;
  transform: translateY(20px);
  transition: all var(--transition-normal);
  z-index: 999;
}

.scroll-top.visible {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.scroll-top:hover {
  background: var(--primary-dark);
  transform: translateY(-5px);
}

/* ==========================================================================
   5. Sections
   ========================================================================== */

/* --- Hero Section --- */
.hero {
  min-height: 100vh;
  display: flex;
  align-items: center;
  background: linear-gradient(135deg, var(--bg-darker) 0%, var(--bg-dark) 50%, #1a3a3a 100%);
  color: white;
  padding-top: 80px;
  position: relative;
  overflow: hidden;
}

.hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background: 
    radial-gradient(circle at 20% 50%, rgba(16, 185, 129, 0.1) 0%, transparent 50%),
    radial-gradient(circle at 80% 80%, rgba(20, 184, 166, 0.1) 0%, transparent 50%);
  animation: float 20s linear infinite;
}

@keyframes float {
  0% { transform: translateY(0); }
  100% { transform: translateY(-100px); }
}

.hero .container {
  position: relative;
  z-index: 1;
  text-align: center;
}

.hero-title {
  font-size: 3.5rem;
  font-weight: 800;
  margin-bottom: 1rem;
  animation: fadeInUp 0.8s ease;
}

.hero-subtitle {
  font-size: 1.5rem;
  margin-bottom: 2rem;
  opacity: 0.9;
  animation: fadeInUp 0.8s ease 0.2s both;
}

.hero-cta {
  display: flex;
  gap: 1rem;
  justify-content: center;
  animation: fadeInUp 0.8s ease 0.4s both;
}

.typing-text {
  color: var(--primary-color);
  position: relative;
}

.typing-text::after {
  content: '|';
  position: absolute;
  right: -8px;
  color: white;
  animation: blink 0.7s infinite;
}

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

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

/* --- About Section (Redesigned) --- */
.about-card {
  background: var(--bg-card);
  border-radius: var(--border-radius);
  padding: 3rem;
  box-shadow: var(--shadow-lg);
  max-width: 900px;
  margin: 0 auto;
  border-left: 5px solid var(--primary-color);
  position: relative;
  overflow: hidden;
}

.about-card::before {
  content: '"';
  position: absolute;
  top: 1rem;
  right: 2rem;
  font-size: 8rem;
  color: var(--primary-color);
  opacity: 0.05;
  font-family: serif;
  line-height: 1;
}

.about-content {
  font-size: 1.15rem;
  line-height: 1.8;
  color: var(--text-main);
  text-align: left;
}

.about-content p {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.8s ease 0.3s, transform 0.8s ease 0.3s;
}

.section.visible .about-content p {
  opacity: 1;
  transform: translateY(0);
}

/* --- Skills Section --- */
.skills-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 2rem;
}

.skill-category {
  background: var(--bg-card);
  padding: 2rem;
  border-radius: var(--border-radius);
  box-shadow: var(--shadow-lg);
  transition: transform var(--transition-normal), box-shadow var(--transition-normal);
}

.skill-category:hover {
  transform: translateY(-5px);
  box-shadow: 0 15px 30px rgba(0, 0, 0, 0.15);
}

.skill-category h3 {
  font-size: 1.25rem;
  color: var(--primary-color);
  margin-bottom: 1rem;
  font-weight: 600;
}

.skill-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.tag {
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.1), rgba(20, 184, 166, 0.1));
  color: var(--primary-dark);
  padding: 0.5rem 1rem;
  border-radius: 20px;
  font-size: 0.875rem;
  font-weight: 500;
  transition: all var(--transition-fast);
  border: 1px solid rgba(16, 185, 129, 0.2);
}

[data-theme="dark"] .tag {
  background: rgba(16, 185, 129, 0.1);
  color: var(--primary-color);
  border-color: transparent;
}

.tag:hover {
  transform: scale(1.05);
  background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
  color: white;
  border-color: transparent;
  box-shadow: var(--shadow-sm);
}

/* --- Timeline (Experience) --- */
.timeline {
  position: relative;
  max-width: 900px;
  margin: 0 auto;
}

.timeline::before {
  content: '';
  position: absolute;
  left: 20px;
  top: 0;
  bottom: 0;
  width: 2px;
  background: var(--border-color);
}

.timeline-item {
  position: relative;
  margin-bottom: 3rem;
  padding-left: 60px;
}

.timeline-marker {
  position: absolute;
  left: 11px;
  top: 5px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--primary-color);
  border: 3px solid var(--bg-body);
  box-shadow: 0 0 0 3px var(--border-color);
}

.timeline-content {
  background: var(--bg-card);
  padding: 2rem;
  border-radius: var(--border-radius);
  box-shadow: var(--shadow-lg);
  border-left: 5px solid var(--primary-color);
  transition: transform var(--transition-normal), box-shadow var(--transition-normal);
}

.timeline-content:hover {
  transform: translateX(5px);
  box-shadow: 0 15px 30px rgba(0, 0, 0, 0.15);
}

.timeline-content h3 {
  color: var(--text-heading);
  font-size: 1.5rem;
  margin-bottom: 0.5rem;
}

.company-info {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  margin-bottom: 1rem;
  font-size: 0.95rem;
}

.company {
  color: var(--primary-color);
  font-weight: 600;
}

.duration {
  color: var(--text-muted);
}

.employment-type {
  background: var(--bg-body);
  padding: 0.25rem 0.75rem;
  border-radius: 12px;
  font-size: 0.85rem;
  color: var(--text-muted);
  border: 1px solid var(--border-color);
}

.accomplishments {
  list-style: none;
  margin-top: 1rem;
}

.accomplishments li {
  padding-left: 1.5rem;
  margin-bottom: 0.75rem;
  position: relative;
  line-height: 1.6;
}

.accomplishments li::before {
  content: '▹';
  position: absolute;
  left: 0;
  color: var(--primary-color);
  font-weight: bold;
}

/* --- Education --- */
.education-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 2rem;
  max-width: 900px;
  margin: 0 auto;
}

.education-item {
  background: var(--bg-card);
  padding: 2rem;
  border-radius: var(--border-radius);
  border-left: 5px solid var(--primary-color);
  box-shadow: var(--shadow-lg);
  transition: transform var(--transition-normal), box-shadow var(--transition-normal);
}

.education-item:hover {
  transform: translateY(-5px);
  box-shadow: 0 15px 30px rgba(0, 0, 0, 0.15);
}

.education-item h3 {
  color: var(--text-heading);
  font-size: 1.25rem;
  margin-bottom: 0.5rem;
}

.institution {
  color: var(--primary-color);
  font-weight: 600;
  margin-bottom: 0.25rem;
}

/* --- Certifications --- */
.certifications-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 2rem;
  max-width: 900px;
  margin: 0 auto;
}

.cert-item {
  background: var(--bg-card);
  color: var(--text-main);
  padding: 2rem;
  border-radius: var(--border-radius);
  transition: transform var(--transition-normal), box-shadow var(--transition-normal);
  border-left: 5px solid var(--primary-color);
  box-shadow: var(--shadow-lg);
}

.cert-item:hover {
  transform: translateY(-5px);
  box-shadow: 0 15px 30px rgba(0, 0, 0, 0.15);
}

.cert-item h3 {
  font-size: 1.25rem;
  margin-bottom: 0.75rem;
}

.issuer {
  font-weight: 600;
  opacity: 0.9;
  margin-bottom: 0.25rem;
}

.cert-duration {
  opacity: 0.8;
  font-size: 0.95rem;
}

/* --- Projects --- */
.projects-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 2rem;
}

.project-item {
  background: var(--bg-card);
  padding: 3rem 2rem;
  border-radius: var(--border-radius);
  box-shadow: var(--shadow-lg);
  border-left: 5px solid var(--primary-color);
  text-align: center;
  transition: transform var(--transition-normal), box-shadow var(--transition-normal);
}

.project-item:hover {
  transform: translateY(-5px);
  box-shadow: 0 15px 30px rgba(0, 0, 0, 0.15);
}

.project-placeholder {
  margin-bottom: 1.5rem;
  color: var(--primary-color);
  opacity: 0.3;
}

.project-item h3 {
  color: var(--text-heading);
  font-size: 1.5rem;
  margin-bottom: 1rem;
}

.project-item p {
  color: var(--text-muted);
}

/* --- Contact --- */
.contact-content {
  max-width: 1000px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 3rem;
  align-items: start;
}

/* --- Contact Actions (Ask Yogi) --- */
.contact-actions {
  display: flex;
  justify-content: center;
  margin-bottom: 0; /* Remove bottom margin as it's now side-by-side */
  height: 100%;
}

.action-card {
  background: var(--bg-card);
  padding: 2rem;
  border-radius: var(--border-radius);
  box-shadow: var(--shadow-lg);
  text-align: center;
  transition: transform var(--transition-normal), box-shadow var(--transition-normal);
  border: 1px solid var(--border-color);
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  color: var(--text-main);
  position: relative;
  overflow: hidden;
  width: 100%;
  height: 100%; /* Match height of contact info if possible */
}

.action-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 15px 30px rgba(0, 0, 0, 0.15);
  border-color: var(--primary-color);
}

.action-avatar-container {
  width: 80px; /* Smaller avatar */
  height: 80px;
  border-radius: 50%;
  padding: 3px;
  background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
  margin-bottom: 1rem;
  transition: transform var(--transition-normal);
}

.action-avatar {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
  border: 3px solid var(--bg-card);
}

.action-card:hover .action-avatar-container {
  transform: scale(1.1);
  box-shadow: 0 0 20px rgba(16, 185, 129, 0.4);
}

.action-card h3 {
  font-size: 1.3rem; /* Slightly smaller font */
  margin-bottom: 0.5rem;
  color: var(--text-heading);
}

.action-card p {
  font-size: 0.95rem;
  color: var(--text-muted);
  margin-bottom: 1rem;
  line-height: 1.5;
}

.action-link {
  margin-top: auto;
  font-weight: 600;
  color: var(--primary-color);
  display: flex;
  align-items: center;
  gap: 0.5rem;
  transition: gap var(--transition-fast);
  font-size: 1rem;
}

.action-card:hover .action-link {
  gap: 0.8rem;
}

.contact-info {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.contact-item {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1.5rem;
  background: var(--bg-card);
  border-radius: var(--border-radius);
  box-shadow: var(--shadow-sm);
  transition: transform var(--transition-normal), box-shadow var(--transition-normal);
}

.contact-item:hover {
  transform: translateX(5px);
  box-shadow: var(--shadow-lg);
}

.contact-item svg {
  color: var(--primary-color);
  flex-shrink: 0;
}

.contact-item a {
  color: var(--text-main);
  font-weight: 500;
}

.contact-item a:hover {
  color: var(--primary-color);
}

/* --- Footer --- */
.footer {
  background: linear-gradient(135deg, var(--bg-darker), var(--bg-dark));
  color: white;
  text-align: center;
  padding: 2rem 0;
  border-top: 1px solid rgba(16, 185, 129, 0.2);
}

.footer p {
  opacity: 0.8;
}

/* ==========================================================================
   6. Responsive Design
   ========================================================================== */
@media (max-width: 768px) {
  .hamburger {
    display: flex;
  }

  .nav-menu {
    position: fixed;
    left: -100%;
    top: 70px;
    flex-direction: column;
    background-color: var(--bg-card);
    width: 100%;
    text-align: center;
    transition: left var(--transition-normal);
    box-shadow: var(--shadow-lg);
    padding: 2rem 0;
  }

  .nav-menu.active {
    left: 0;
  }

  .navbar .container {
    justify-content: center; /* Keep centered, hamburger is absolute left */
  }

  .hero-title {
    font-size: 2.5rem;
  }

  .hero-subtitle {
    font-size: 1.25rem;
  }

  .hero-cta {
    flex-direction: column;
    align-items: center;
  }

  .section-title {
    font-size: 2rem;
  }

  .timeline::before {
    left: 10px;
  }

  .timeline-item {
    padding-left: 45px;
  }

  .timeline-marker {
    left: 1px;
  }

  .company-info {
    flex-direction: column;
    gap: 0.5rem;
  }

  .skills-grid,
  .education-grid,
  .certifications-grid,
  .projects-grid {
    grid-template-columns: 1fr;
  }
  
  .about-card {
    padding: 2rem;
  }
  
  .about-card::before {
    font-size: 6rem;
    top: 0.5rem;
    right: 1rem;
  }

  /* Contact Section Responsive */
  .contact-content {
    grid-template-columns: 1fr;
    gap: 2rem;
  }
  
  .contact-actions {
    margin-bottom: 2rem;
  }
}

@media (max-width: 480px) {
  .container {
    padding: 0 1rem;
  }

  .navbar .container {
    padding: 1rem;
  }

  .hero-title {
    font-size: 2rem;
  }

  .section {
    padding: 3rem 0;
  }
}

/* --- Chat Widget --- */
.chat-widget-btn {
  position: fixed;
  bottom: 20px;
  right: 20px;
  width: 60px;
  height: 60px;
  background-color: var(--primary-color);
  color: #fff;
  border: none;
  border-radius: 50%;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  z-index: 1000;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.chat-widget-btn:hover {
  transform: scale(1.1);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.4);
}

.chat-window {
  position: fixed;
  bottom: 90px;
  right: 20px;
  width: 350px;
  height: 500px;
  background-color: var(--bg-card);
  border-radius: 12px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  z-index: 1000;
  opacity: 0;
  transform: translateY(20px);
  pointer-events: none;
  transition: opacity 0.3s ease, transform 0.3s ease;
  border: 1px solid var(--border-color);
}

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

.chat-header {
  background-color: var(--primary-color);
  color: #fff;
  padding: 15px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.chat-header h3 {
  margin: 0;
  font-size: 1.1rem;
  display: flex;
  align-items: center;
  gap: 8px;
}

.chat-close-btn {
  background: none;
  border: none;
  color: #fff;
  font-size: 1.2rem;
  cursor: pointer;
  padding: 0;
  opacity: 0.8;
  transition: opacity 0.2s;
}

.chat-close-btn:hover {
  opacity: 1;
}

.chat-messages {
  flex: 1;
  padding: 15px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 12px;
  background-color: var(--bg-body);
}

.message {
  max-width: 80%;
  padding: 10px 14px;
  border-radius: 12px;
  font-size: 0.95rem;
  line-height: 1.4;
  position: relative;
  word-wrap: break-word;
}

.message.bot {
  align-self: flex-start;
  background-color: var(--bg-card);
  border: 1px solid var(--border-color);
  color: var(--text-primary);
  border-bottom-left-radius: 2px;
}

.message.user {
  align-self: flex-end;
  background-color: var(--primary-color);
  color: #fff;
  border-bottom-right-radius: 2px;
}

.chat-input-area {
  padding: 15px;
  background-color: var(--bg-card);
  border-top: 1px solid var(--border-color);
  display: flex;
  gap: 10px;
}

.chat-input {
  flex: 1;
  padding: 10px;
  border: 1px solid var(--border-color);
  border-radius: 20px;
  background-color: var(--bg-body);
  color: var(--text-primary);
  outline: none;
  transition: border-color 0.3s;
}

.chat-input:focus {
  border-color: var(--primary-color);
}

.chat-send-btn {
  background-color: var(--primary-color);
  color: #fff;
  border: none;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background-color 0.3s;
}

.chat-send-btn:hover {
  background-color: var(--primary-hover);
}

/* Enhanced Typing Indicator */
.typing-indicator {
  display: flex;
  align-items: flex-end;
  gap: 10px;
  align-self: flex-start;
  animation: slideIn 0.3s ease-out;
}
.typing-bubble {
  background-color: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 18px;
  border-bottom-left-radius: 4px;
  padding: 14px 18px;
  box-shadow: var(--shadow-sm);
  position: relative;
}

.typing-dots {
  display: flex;
  gap: 6px;
  align-items: center;
}

.typing-dot {
  width: 8px;
  height: 8px;
  background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
  border-radius: 50%;
  animation: wave 1.4s ease-in-out infinite;
  box-shadow: 0 0 8px rgba(16, 185, 129, 0.3);
}

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

@keyframes wave {
  0%, 60%, 100% {
    transform: translateY(0) scale(1);
    opacity: 0.7;
  }
  30% {
    transform: translateY(-10px) scale(1.2);
    opacity: 1;
  }
}

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

@keyframes pulse {
  0%, 100% {
    box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.4);
  }
  50% {
    box-shadow: 0 0 0 4px rgba(16, 185, 129, 0);
  }
}

/* Mobile Responsiveness for Chat */
@media (max-width: 480px) {
  .chat-window {
    width: 100%;
    height: 100%;
    bottom: 0;
    right: 0;
    border-radius: 0;
  }
  
  .chat-widget-btn {
    bottom: 15px;
    right: 15px;
  }
}

/* --- Chat Branding --- */
.chat-branding {
  display: flex;
  align-items: center;
  gap: 10px;
}

.chat-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background-color: #fff;
  padding: 2px;
}
/* Chat Widget Avatar Icon */
.chat-avatar-icon {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
  display: block;
}

.chat-widget-btn {
  padding: 0;
  overflow: visible; /* Allow tooltip to be seen */
  border: 2px solid white;
  box-shadow: var(--shadow-lg);
  animation: pulse-border 2s infinite;
  position: fixed; /* Ensure it's fixed */
  bottom: 2rem;
  right: 2rem;
  width: 60px;
  height: 60px;
  border-radius: 50%;
  cursor: pointer;
  z-index: 1000;
  transition: transform var(--transition-normal);
}

.chat-widget-btn:hover {
  transform: scale(1.1);
  animation: none; /* Stop pulse on hover */
}

/* Tooltip / Speech Bubble */
.chat-widget-btn::before {
  content: 'Chat with me!';
  position: absolute;
  right: 75px; /* Position to the left of the button */
  top: 50%;
  transform: translateY(-50%);
  background-color: var(--bg-card);
  color: var(--text-main);
  padding: 0.5rem 1rem;
  border-radius: 8px;
  font-size: 0.9rem;
  font-weight: 600;
  white-space: nowrap;
  box-shadow: var(--shadow-md);
  opacity: 0;
  visibility: hidden;
  transition: all var(--transition-normal);
  pointer-events: none;
}

.chat-widget-btn::after {
  content: '';
  position: absolute;
  right: 70px; /* Triangle pointer */
  top: 50%;
  transform: translateY(-50%);
  border-width: 6px;
  border-style: solid;
  border-color: transparent transparent transparent var(--bg-card);
  opacity: 0;
  visibility: hidden;
  transition: all var(--transition-normal);
}

/* Show tooltip on load (animation) and hover */
.chat-widget-btn:hover::before,
.chat-widget-btn:hover::after {
  opacity: 1;
  visibility: visible;
  right: 80px; /* Slide in effect */
}

/* Optional: Make tooltip visible initially for a few seconds */
@keyframes show-tooltip {
  0%, 100% { opacity: 1; visibility: visible; right: 80px; }
  90% { opacity: 1; visibility: visible; right: 80px; }
}

/* Pulse Animation */
@keyframes pulse-border {
  0% {
    box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7);
  }
  70% {
    box-shadow: 0 0 0 15px rgba(16, 185, 129, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(16, 185, 129, 0);
  }
}
