/* Reset and base styles */
:root {
  --accent: #2563eb;
  --bg: #f8fafc;
  --fg: #18181b;
  --card: #fff;
  --border: #e5e7eb;
  --radius: 16px;
  --shadow: 0 4px 32px 0 rgba(37,99,235,0.08);
  --font: 'Inter', system-ui, sans-serif;
}
html {
  box-sizing: border-box;
  font-size: 16px;
  scroll-behavior: smooth;
}
*, *:before, *:after {
  box-sizing: inherit;
}
body {
  margin: 0;
  padding: 0;
  font-family: var(--font);
  background: var(--bg);
  color: var(--fg);
  min-height: 100vh;
  transition: background 0.3s, color 0.3s;
}

/* Dark mode overrides */
.dark-mode {
  --bg: #18181b;
  --fg: #f8fafc;
  --card: #23232a;
  --border: #27272a;
  --accent: #60a5fa;
}
.dark-mode,
.dark-mode .project-card,
.dark-mode .project-card p,
.dark-mode .project-card h3,
.dark-mode .about-section p,
.dark-mode .experience-section,
.dark-mode .timeline-item ul,
.dark-mode .contact-info p {
  color: #fff !important;
}
.dark-mode .hero-text,
.dark-mode .hero-text h1,
.dark-mode .subtitle,
.dark-mode .desc {
  color: #fff !important;
}

.container {
  max-width: 820px;
  margin: 0 auto;
  padding: 0 1.2rem;
}

/* Header */
.site-header {
  background: var(--card);
  box-shadow: var(--shadow);
  position: sticky;
  top: 0;
  z-index: 100;
}
.nav-flex {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
}
.logo {
  font-weight: 800;
  font-size: 1.35rem;
  letter-spacing: -1px;
  color: var(--accent);
  padding-left: 0.2rem;
  margin-right: auto;
}
.main-nav {
  display: flex;
  gap: 1.7rem;
}
.main-nav a {
  color: var(--fg);
  text-decoration: none;
  font-weight: 500;
  font-size: 1rem;
  padding: 0.2rem 0.7rem;
  border-radius: 8px;
  position: relative;
  transition: color 0.18s;
}
.main-nav a::after {
  content: '';
  display: block;
  position: absolute;
  left: 0;
  bottom: 0.1em;
  width: 100%;
  height: 2px;
  background: var(--accent);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.22s cubic-bezier(0.4,0,0.2,1);
  border-radius: 2px;
}
.main-nav a:hover {
  color: var(--accent);
  background: none;
}
.main-nav a:hover::after {
  transform: scaleX(1);
}

/* Hero Section */
.hero-section {
  padding: 4.2rem 0 2.5rem 0;
  background: var(--card);
  border-radius: 0 0 var(--radius) var(--radius);
  box-shadow: var(--shadow);
  margin-bottom: 2.2rem;
}
.hero-flex {
  display: flex;
  align-items: center;
  gap: 2.2rem;
  flex-wrap: wrap;
}
.hero-text {
  flex: 2;
}
.hero-text h1 {
  font-size: 2.3rem;
  font-weight: 800;
  margin: 0 0 0.5rem 0;
  letter-spacing: -1.5px;
  line-height: 1.1;
}
.hero-text .accent {
  color: var(--accent);
}
.subtitle {
  font-size: 1.1rem;
  color: #4b5563;
  margin-bottom: 1.1rem;
  font-weight: 500;
}
.desc {
  font-size: 1.05rem;
  margin-bottom: 1.7rem;
  color: #444;
  line-height: 1.6;
}
.hero-img {
  flex: 1;
  min-width: 280px;
  display: flex;
  align-items: center;
  margin-left: 100px;
}
.hero-img img {
  width: 280px;
  height: 280px;
  border-radius: 50%;
  object-fit: cover;
  border: 2.5px solid var(--accent);
  box-shadow: 0 2px 12px 0 rgba(37,99,235,0.10);
}

/* Button */
.btn {
  display: inline-block;
  background: var(--accent);
  color: #fff;
  padding: 0.7em 1.7em;
  border: none;
  border-radius: 8px;
  font-weight: 600;
  font-size: 1.05rem;
  cursor: pointer;
  text-decoration: none;
  box-shadow: 0 2px 12px 0 rgba(37,99,235,0.10);
  transition: background 0.18s, box-shadow 0.18s, transform 0.13s;
}
.btn:hover, .btn:focus {
  background: #1d4ed8;
  box-shadow: 0 4px 16px rgba(37,99,235,0.13);
  transform: translateY(-1.5px) scale(1.03);
}
.btn:active {
  transform: scale(0.97);
  box-shadow: 0 1px 4px rgba(37,99,235,0.08);
}

/* Section Headings */
section h2 {
  font-size: 1.45rem;
  font-weight: 800;
  margin-bottom: 1.2rem;
  letter-spacing: -0.5px;
  color: var(--accent);
}

/* About Section */
.about-section {
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  margin-bottom: 2.2rem;
  padding: 2.1rem 0 1.7rem 0;
}
.about-section p {
  font-size: 1.02rem;
  margin-bottom: 1.05rem;
  color: #444;
  line-height: 1.7;
}

/* Experience Section */
.experience-section {
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  margin-bottom: 2.2rem;
  padding: 2.1rem 0 1.7rem 0;
}
.timeline {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}
.timeline-item {
  background: var(--bg);
  border-radius: 10px;
  box-shadow: 0 1px 6px 0 rgba(37,99,235,0.04);
  padding: 1.1rem 1.2rem 1rem 1.2rem;
  border-left: 3.5px solid var(--accent);
  position: relative;
}
.timeline-date {
  font-size: 0.97rem;
  color: var(--accent);
  font-weight: 700;
  margin-bottom: 0.4rem;
  display: block;
}
.timeline-item h3 {
  margin: 0 0 0.5rem 0;
  font-size: 1.08rem;
  font-weight: 700;
}
.timeline-item ul {
  margin: 0;
  padding-left: 1.1em;
  color: #444;
  font-size: 0.99rem;
  line-height: 1.6;
}

/* Projects Section */
.projects-section {
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  margin-bottom: 2.2rem;
  padding: 2.5rem 0 2.5rem 0;
}
.projects-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 2.5rem;
}
.project-card {
  background: var(--bg);
  border-radius: 10px;
  box-shadow: 0 1px 6px 0 rgba(37,99,235,0.04);
  padding: 1.5rem 1.5rem 1rem 1.5rem;
  flex: 1 1 220px;
  min-width: 240px;
  max-width: 330px;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  border: 2px solid transparent;
  transition: box-shadow 0.18s, transform 0.18s, border 0.18s, background 0.18s;
}
.project-card:hover {
  transform: translateY(-6px) scale(1.03);
  box-shadow: 0 6px 24px 0 rgba(37,99,235,0.13);
  border: 2px solid var(--accent);
  background: rgba(37,99,235,0.06);
}
.dark-mode .project-card:hover {
  background: rgba(96,165,250,0.10);
  border: 2px solid var(--accent);
}
.project-card h3 {
  margin: 0 0 0.2rem 0;
  font-size: 1.01rem;
  color: var(--accent);
}
.project-card p {
  margin: 0;
  color: #444;
  font-size: 0.97rem;
  line-height: 1.5;
}
.dark-mode .project-card p {
  color: #f3f4f6;
}

/* Contact Section */
.contact-section {
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  margin-bottom: 2.2rem;
  padding: 2.1rem 0 1.7rem 0;
}
.contact-flex {
  display: flex;
  gap: 2rem;
  flex-wrap: wrap;
  align-items: flex-start;
}
.contact-info {
  flex: 1;
  min-width: 180px;
}
.contact-info h2 {
  margin-top: 0;
}
.contact-info p {
  margin: 0.5em 0;
  color: #444;
  font-size: 0.98rem;
}
.contact-info a {
  color: var(--accent);
  text-decoration: none;
}
.contact-info a:hover {
  text-decoration: underline;
}
.contact-form {
  flex: 1;
  min-width: 180px;
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
}
.contact-form input,
.contact-form textarea {
  padding: 0.6em 0.9em;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 0.98rem;
  font-family: var(--font);
  background: #fff;
  resize: none;
}
.contact-form button {
  align-self: flex-end;
}

/* Footer */
.site-footer {
  background: var(--card);
  border-top: 1px solid var(--border);
  padding: 1.1rem 0;
  color: #888;
  font-size: 0.98rem;
}
.footer-flex {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.1rem;
  flex-wrap: wrap;
}
.footer-links {
  display: flex;
  gap: 1rem;
}
.footer-links a {
  color: var(--accent);
  text-decoration: none;
  font-weight: 600;
  transition: color 0.18s;
}
.footer-links a:hover {
  color: #1d4ed8;
}

/* Section fade-in animation */
section.hidden {
  opacity: 0;
  transform: translateY(32px);
  transition: opacity 0.7s cubic-bezier(.4,0,.2,1), transform 0.7s cubic-bezier(.4,0,.2,1);
  will-change: opacity, transform;
}
section.show {
  opacity: 1;
  transform: none;
}

/* Responsive */
@media (max-width: 900px) {
  .container {
    max-width: 100%;
    padding: 0 0.7rem;
  }
  .hero-flex, .contact-flex {
    flex-direction: column;
    gap: 1.3rem;
  }
  .projects-grid {
    flex-direction: column;
    gap: 1rem;
  }
}
@media (max-width: 600px) {
  .nav-flex {
    flex-direction: column;
    align-items: flex-start;
    height: auto;
    gap: 0.5rem;
    padding: 0.7rem 0;
  }
  .main-nav {
    gap: 0.7rem;
  }
  .logo {
    font-size: 1rem;
  }
  .hero-section {
    padding: 1.7rem 0 1rem 0;
  }
  .hero-img img {
    width: 110px;
    height: 110px;
  }
  .timeline-item, .project-card {
    padding: 0.7rem;
  }
}

.hero-btns {
  display: flex;
  gap: 1rem;
  margin-top: 0.5rem;
}
.secondary-btn {
  background: transparent;
  color: var(--accent);
  border: 2px solid var(--accent);
  font-weight: 600;
  transition: background 0.18s, color 0.18s, border-color 0.18s;
}
.secondary-btn:hover, .secondary-btn:focus {
  background: var(--accent);
  color: #fff;
  border-color: #1d4ed8;
}

#theme-toggle {
  width: 38px;
  height: 38px;
  min-width: 38px;
  min-height: 38px;
  padding: 0;
  font-size: 1.25rem;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, var(--card) 60%, var(--accent) 100%);
  color: var(--accent);
  box-shadow: 0 2px 12px 0 rgba(37,99,235,0.10);
  border: 2px solid var(--accent);
  margin-left: 1rem;
  transition: background 0.22s, color 0.18s, box-shadow 0.18s, border 0.18s, transform 0.15s;
  outline: none;
}
#theme-toggle:hover, #theme-toggle:focus {
  background: linear-gradient(135deg, var(--accent) 60%, var(--card) 100%);
  color: #fff;
  box-shadow: 0 6px 24px rgba(37,99,235,0.18);
  border-color: var(--accent);
  transform: scale(1.08);
}
#theme-toggle:focus {
  box-shadow: 0 0 0 3px rgba(96,165,250,0.35), 0 6px 24px rgba(37,99,235,0.18);
}
.dark-mode #theme-toggle {
  background: linear-gradient(135deg, var(--card) 60%, var(--accent) 100%);
  color: var(--accent);
  border-color: var(--accent);
}
.dark-mode #theme-toggle:hover, .dark-mode #theme-toggle:focus {
  background: linear-gradient(135deg, var(--accent) 60%, var(--card) 100%);
  color: #fff;
  border-color: var(--accent);
}

@media (max-width: 600px) {
  #theme-toggle {
    width: 32px;
    height: 32px;
    min-width: 32px;
    min-height: 32px;
    font-size: 1rem;
    margin-left: 0.5rem;
  }
}

/* Chat Bubble - Enhanced */
.chat-bubble {
  position: fixed;
  right: 2.2rem;
  bottom: 2.2rem;
  background: linear-gradient(135deg, var(--accent) 70%, #60a5fa 100%);
  color: #fff;
  padding: 1em 1em;
  border-radius: 2em 2em 2em 2em;
  box-shadow: 0 8px 32px rgba(37,99,235,0.22);
  font-size: 1.13rem;
  font-weight: 700;
  z-index: 2000;
  cursor: pointer;
  transition: background 0.18s, box-shadow 0.18s, transform 0.13s;
  letter-spacing: 0.01em;
  display: flex;
  align-items: center;
  gap: 0.7em;
  border: none;
}
.chat-bubble::before {
  content: '💬';
  font-size: 1.3em;
  margin-right: 0.5em;
}
.chat-bubble:hover, .chat-bubble:focus {
  background: linear-gradient(135deg, #1d4ed8 70%, #60a5fa 100%);
  box-shadow: 0 12px 40px rgba(37,99,235,0.28);
  transform: translateY(-3px) scale(1.05);
}

/* Chat Overlay - Enhanced */
.chat-overlay {
  position: fixed;
  right: 2.2rem;
  bottom: 4.5rem;
  width: 370px;
  max-width: 98vw;
  height: 470px;
  max-height: 85vh;
  background: var(--card);
  color: var(--fg);
  border-radius: 1.5em 1.5em 1.5em 0.9em;
  box-shadow: 0 12px 48px 0 rgba(37,99,235,0.22);
  display: flex;
  flex-direction: column;
  z-index: 3000;
  overflow: hidden;
  animation: chat-fade-in 0.25s cubic-bezier(.4,0,.2,1);
  border: 1.5px solid var(--accent);
  display: none;
}
@keyframes chat-fade-in {
  from { opacity: 0; transform: translateY(40px) scale(0.98); }
  to { opacity: 1; transform: none; }
}
@media (max-width: 600px) {
  .chat-overlay {
    right: 0.5rem;
    bottom: 0.5rem;
    width: 98vw;
    height: 65vh;
    min-width: unset;
    border-radius: 1.1em 1.1em 1.1em 0.7em;
    padding: 0;
    font-size: 0.98rem;
  }
  .chat-header {
    padding: 0.8em 1em;
    font-size: 1rem;
  }
  .chat-body {
    padding: 0.7em 0.7em 0.5em 0.7em;
    font-size: 0.97rem;
  }
  .chat-input-wrap {
    flex-direction: row;
    padding: 0.7em 0.7em 0.7em 0.7em;
    gap: 0.3em;
  }
  .chat-input {
    font-size: 0.97rem;
    padding: 0.7em 1em;
  }
  .send-icon-btn {
    width: 2.1em;
    height: 2.1em;
    font-size: 1.1em;
  }
  .chat-scroll-bottom-btn {
    right: 1em !important;
    bottom: 7em !important;
    width: 2em !important;
    height: 2em !important;
    font-size: 1.1em !important;
  }
}

/* Chat Header - Enhanced */
.chat-header {
  background: linear-gradient(135deg, var(--accent) 70%, #60a5fa 100%);
  color: #fff;
  padding: 1.1em 1.3em;
  font-weight: 800;
  font-size: 1.13rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1.5px solid var(--border);
  letter-spacing: 0.01em;
  box-shadow: 0 2px 12px 0 rgba(37,99,235,0.10);
}
.close-chat {
  background: rgba(255,255,255,0.13);
  border: none;
  color: #fff;
  font-size: 1.6rem;
  cursor: pointer;
  padding: 0 0.3em;
  border-radius: 50%;
  transition: background 0.18s, color 0.18s;
  outline: none;
}
.close-chat:hover, .close-chat:focus {
  background: rgba(0,0,0,0.10);
  color: #e0e7ef;
}

/* Chat Body - Enhanced */
.chat-body {
  flex: 1;
  background: linear-gradient(120deg, #f8fafc 80%, #e0e7ef 100%);
  padding: 1.3em 1.3em 1.1em 1.3em;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.3em;
  justify-content: flex-end;
  scroll-behavior: smooth;
}
.dark-mode .chat-body {
  background: linear-gradient(120deg, #23232a 80%, #18181b 100%);
}

/* Chat Placeholder - Enhanced */
.chat-placeholder {
  color: var(--fg);
  background: rgba(96,165,250,0.10);
  border-radius: 1.2em 1.2em 1.2em 0.7em;
  padding: 1.1em 1.3em;
  font-size: 1.08rem;
  text-align: center;
  box-shadow: 0 2px 10px 0 rgba(37,99,235,0.09);
  margin-bottom: 0.7em;
  font-weight: 500;
}
.dark-mode .chat-placeholder {
  color: #f3f4f6;
  background: rgba(96,165,250,0.18);
}

/* Chat Messages - Enhanced */
.chat-body div {
  max-width: 85%;
  word-break: break-word;
}
.chat-body .init-msg span,
.chat-body .loading-msg span {
  background: #e0e7ef;
  color: #222;
  font-weight: 500;
}
.dark-mode .chat-body .init-msg span,
.dark-mode .chat-body .loading-msg span {
  background: #23232a;
  color: #f8fafc;
}

/* User Message Bubble */
.chat-body div[style*='text-align: right'] span {
  background: linear-gradient(135deg, var(--accent) 70%, #60a5fa 100%);
  color: #fff;
  font-weight: 600;
  border-bottom-right-radius: 1.5em !important;
  border-top-right-radius: 1.5em !important;
  border-top-left-radius: 1.1em !important;
  border-bottom-left-radius: 0.7em !important;
  box-shadow: 0 2px 8px 0 rgba(37,99,235,0.10);
}

/* Bot Message Bubble */
.chat-body div[style*='text-align: left'] span {
  background: #fff;
  color: var(--fg);
  font-weight: 500;
  border-radius: 1.2em 1.2em 1.2em 0.7em;
  box-shadow: 0 2px 8px 0 rgba(37,99,235,0.07);
}
.dark-mode .chat-body div[style*='text-align: left'] span {
  background: #23232a;
  color: #f8fafc;
}

/* Chat Input - Enhanced */
.chat-input-wrap {
  display: flex;
  align-items: center;
  padding: 1em 1.2em 1em 1.2em;
  background: transparent;
  border-top: 1.5px solid var(--border);
  gap: 0.5em;
  position: relative;
}
.chat-input {
  flex: 1;
  padding: 0.85em 1.2em;
  border: 1.5px solid var(--border);
  border-radius: 1.5em;
  font-size: 1.08rem;
  font-family: var(--font);
  background: #f8fafc;
  color: var(--fg);
  outline: none;
  transition: border 0.18s, box-shadow 0.18s;
  box-shadow: 0 2px 8px 0 rgba(37,99,235,0.06);
  margin-right: 0.2em;
}
.chat-input:focus {
  border: 1.5px solid var(--accent);
  box-shadow: 0 2px 8px 0 rgba(37,99,235,0.13);
}
.dark-mode .chat-input {
  background: #23232a;
  color: #f8fafc;
  border: 1.5px solid #27272a;
}

.send-icon-btn {
  background: linear-gradient(135deg, var(--accent) 70%, #60a5fa 100%);
  border: none;
  border-radius: 50%;
  width: 2.6em;
  height: 2.6em;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-left: 0.1em;
  margin-right: 0.1em;
  cursor: pointer;
  transition: background 0.18s, box-shadow 0.18s, transform 0.13s;
  box-shadow: 0 2px 12px 0 rgba(37,99,235,0.13);
  outline: none;
  position: relative;
}
.send-icon-btn::before {
  content: '';
  position: absolute;
  inset: -4px;
  border-radius: 50%;
  background: linear-gradient(135deg, #60a5fa 0%, #2563eb 100%);
  opacity: 0.18;
  z-index: 0;
}
.send-icon {
  position: relative;
  z-index: 1;
}

/* Chat Send Button - Enhanced */
.chat-input-wrap .btn.primary-btn {
  padding: 0.8em 1.5em;
  font-size: 1.08rem;
  border-radius: 1.5em;
  font-weight: 700;
  background: linear-gradient(135deg, var(--accent) 70%, #60a5fa 100%);
  color: #fff;
  border: none;
  box-shadow: 0 2px 8px 0 rgba(37,99,235,0.10);
  transition: background 0.18s, box-shadow 0.18s, transform 0.13s;
  margin-left: 0.2em;
}
.chat-input-wrap .btn.primary-btn:hover, .chat-input-wrap .btn.primary-btn:focus {
  background: linear-gradient(135deg, #1d4ed8 70%, #60a5fa 100%);
  box-shadow: 0 4px 16px 0 rgba(37,99,235,0.18);
  transform: translateY(-2px) scale(1.04);
}

.project-image-card {
  padding: 0.5rem 0.5rem 1rem 0.5rem;
  align-items: center;
  text-align: center;
}
.project-img {
  width: 100%;
  max-width: 220px;
  height: 140px;
  object-fit: cover;
  border-radius: 10px;
  box-shadow: 0 2px 12px 0 rgba(37,99,235,0.10);
  margin-bottom: 0.7rem;
  transition: transform 0.18s, box-shadow 0.18s;
}
.project-image-card:hover .project-img {
  transform: scale(1.06);
  box-shadow: 0 6px 24px 0 rgba(37,99,235,0.18);
}
.dark-mode .project-img {
  box-shadow: 0 2px 12px 0 rgba(96,165,250,0.13);
}

#chat-overlay {
  display: none;
}

/* Skills Section */
.skills-section {
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  margin-bottom: 2.2rem;
  padding: 2.1rem 0 1.7rem 0;
}
.skills-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 2.2rem 2.5rem;
  justify-content: center;
  align-items: center;
  margin-top: 1.2rem;
}
.skill-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  background: var(--bg);
  border-radius: 10px;
  box-shadow: 0 1px 6px 0 rgba(37,99,235,0.04);
  padding: 1.1rem 1.2rem 1rem 1.2rem;
  min-width: 110px;
  max-width: 130px;
  transition: box-shadow 0.18s, transform 0.18s, background 0.18s;
}
.skill-item:hover {
  transform: translateY(-4px) scale(1.04);
  box-shadow: 0 4px 16px rgba(37,99,235,0.13);
  background: rgba(37,99,235,0.06);
}
.skill-icon {
  width: 48px;
  height: 48px;
  margin-bottom: 0.7rem;
}
.skill-item span {
  font-size: 1.01rem;
  font-weight: 600;
  color: var(--fg);
  text-align: center;
}
@media (max-width: 600px) {
  .skills-grid {
    gap: 1.2rem 1.2rem;
  }
  .skill-item {
    min-width: 80px;
    max-width: 100px;
    padding: 0.7rem 0.5rem 0.7rem 0.5rem;
  }
  .skill-icon {
    width: 36px;
    height: 36px;
  }
  .skill-item span {
    font-size: 0.97rem;
  }
}

/* --- Chatbot Visual Improvements --- */
.chat-overlay {
  background: rgba(255, 255, 255, 0.75);
  border: 1.5px solid rgba(37,99,235,0.18);
  box-shadow: 0 12px 48px 0 rgba(37,99,235,0.22), 0 1.5px 16px 0 rgba(96,165,250,0.10);
}
.dark-mode .chat-overlay {
  background: rgba(30, 34, 44, 0.82);
  border: 1.5px solid rgba(96,165,250,0.18);
}

.chat-bubble {
  background: rgba(37,99,235,0.92);
  box-shadow: 0 8px 32px rgba(37,99,235,0.22), 0 2px 8px rgba(96,165,250,0.10);
  border: 1.5px solid rgba(96,165,250,0.18);
  padding: 1.1em 1.5em;
  border-radius: 2em 2em 2em 2em;
}

.chat-header {
  background: linear-gradient(135deg, var(--accent) 70%, #60a5fa 100%);
  color: #fff;
  padding: 1.1em 1.3em;
  font-weight: 800;
  font-size: 1.13rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1.5px solid var(--border);
  letter-spacing: 0.01em;
  box-shadow: 0 2px 12px 0 rgba(37,99,235,0.10);
  border-top-left-radius: 1.5em;
  border-top-right-radius: 1.5em;
}

/* Message bubbles */
.chat-body div[style*='text-align: right'] span {
  background: linear-gradient(135deg, var(--accent) 70%, #60a5fa 100%);
  color: #fff;
  font-weight: 600;
  border-bottom-right-radius: 1.5em !important;
  border-top-right-radius: 1.5em !important;
  border-top-left-radius: 1.1em !important;
  border-bottom-left-radius: 0.7em !important;
  box-shadow: 0 4px 16px 0 rgba(37,99,235,0.13);
  border: 1.5px solid rgba(37,99,235,0.10);
}
.chat-body div[style*='text-align: left'] span {
  background: rgba(255,255,255,0.85);
  color: var(--fg);
  font-weight: 500;
  border-radius: 1.2em 1.2em 1.2em 0.7em;
  box-shadow: 0 2px 12px 0 rgba(37,99,235,0.07);
  border: 1.5px solid rgba(37,99,235,0.07);
}
.dark-mode .chat-body div[style*='text-align: left'] span {
  background: rgba(35,35,42,0.92);
  color: #f8fafc;
  border: 1.5px solid rgba(96,165,250,0.10);
}

/* Chat input modern look */
.chat-input-wrap {
  background: rgba(255,255,255,0.65);
  border-top: 1.5px solid var(--border);
  box-shadow: 0 -2px 12px 0 rgba(37,99,235,0.06);
  border-bottom-left-radius: 1.5em;
  border-bottom-right-radius: 1.5em;
}
.dark-mode .chat-input-wrap {
  background: rgba(30,34,44,0.92);
  border-top: 1.5px solid #23232a;
}

.chat-input {
  background: rgba(248,250,252,0.95);
  border: 1.5px solid var(--border);
  border-radius: 1.5em;
  font-size: 1.08rem;
  font-family: var(--font);
  color: var(--fg);
  outline: none;
  transition: border 0.18s, box-shadow 0.18s;
  box-shadow: 0 2px 8px 0 rgba(37,99,235,0.06);
}
.dark-mode .chat-input {
  background: rgba(35,35,42,0.92);
  color: #f8fafc;
  border: 1.5px solid #27272a;
}

.send-icon-btn {
  background: linear-gradient(135deg, var(--accent) 70%, #60a5fa 100%);
  border: none;
  border-radius: 50%;
  width: 2.6em;
  height: 2.6em;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-left: 0.1em;
  margin-right: 0.1em;
  cursor: pointer;
  transition: background 0.18s, box-shadow 0.18s, transform 0.13s;
  box-shadow: 0 2px 12px 0 rgba(37,99,235,0.13);
  outline: none;
  position: relative;
}
.send-icon-btn::before {
  content: '';
  position: absolute;
  inset: -4px;
  border-radius: 50%;
  background: linear-gradient(135deg, #60a5fa 0%, #2563eb 100%);
  opacity: 0.18;
  z-index: 0;
}
.send-icon {
  position: relative;
  z-index: 1;
}

/* Chat message improvements */
.chat-body {
  gap: 0.8em;
  padding: 1.6em 1.3em 1.3em 1.3em;
}
.chat-body div {
  margin-bottom: 0.2em;
  margin-top: 0.2em;
  display: flex;
  flex-direction: row;
  align-items: flex-end;
  animation: chat-msg-fade-in 0.22s cubic-bezier(.4,0,.2,1);
}
@keyframes chat-msg-fade-in {
  from { opacity: 0; transform: translateY(16px) scale(0.98); }
  to { opacity: 1; transform: none; }
}
.chat-body div[style*='text-align: right'] {
  justify-content: flex-end;
}
.chat-body div[style*='text-align: left'] {
  justify-content: flex-start;
}
.chat-body div[style*='text-align: right'] span {
  padding: 0.85em 1.3em;
  margin-left: 1.2em;
  font-size: 1.06rem;
  border: 1.5px solid rgba(37,99,235,0.13);
  box-shadow: 0 4px 16px 0 rgba(37,99,235,0.13);
}
.chat-body div[style*='text-align: left'] span {
  padding: 0.85em 1.3em;
  margin-right: 1.2em;
  font-size: 1.06rem;
  border: 1.5px solid rgba(37,99,235,0.07);
  box-shadow: 0 2px 12px 0 rgba(37,99,235,0.07);
}
/* Add a subtle border to both bubbles for clarity */
.chat-body div[style*='text-align: right'] span, .chat-body div[style*='text-align: left'] span {
  border-width: 1.5px;
  border-style: solid;
}

.chat-input-wrap .chat-input {
  width: 80%;
}
