/* Global CSS Variables */
:root {
  /* Institutional Colors */
  --primary-blue: #0A84CF;
  --accent-red: #E4000A;
  --highlight-yellow: #F9F400;
  --bg-white: #FFFFFF;
  --text-black: #000000;
  
  /* Derived Colors for UI */
  --bg-light: #F8FAFC;
  --text-gray: #475569;
  --glass-bg: rgba(255, 255, 255, 0.9);
  --shadow-sm: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
  --shadow-md: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
  
  /* Typography */
  --font-family: 'Inter', sans-serif;
  
  /* Transitions */
  --transition-fast: 0.2s ease;
  --transition-normal: 0.3s ease;
}

/* Reset & Defaults */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-family);
  background-color: var(--bg-light);
  color: var(--text-black);
  line-height: 1.6;
  overflow-x: hidden;
}

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

ul {
  list-style: none;
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 2rem;
}

.section-padding {
  padding: 5rem 0;
}

/* Typography Elements */
.section-title {
  font-size: 2.5rem;
  font-weight: 800;
  margin-bottom: 2rem;
  position: relative;
  display: inline-block;
}

.section-title::after {
  content: '';
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  bottom: -0.5rem;
  width: 50px;
  height: 4px;
  background-color: var(--primary-blue);
  border-radius: 2px;
}

.text-center {
  text-align: center;
  display: block;
  width: 100%;
}
.text-center::after {
  left: 50%;
  transform: translateX(-50%);
}
.small-title {
  font-size: 1.8rem;
}
.small-title::after {
  width: 35px;
}

/* Navbar */
.navbar {
  position: fixed;
  top: 0;
  width: 100%;
  background: var(--glass-bg);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  z-index: 10000; /* Increased to ensure it's always on top */
  box-shadow: var(--shadow-sm);
  transition: all var(--transition-normal);
}

.nav-container {
  max-width: 1600px;
  margin: 0 auto;
  padding: 1rem 1rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.logo-link {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 1.8rem;
  font-weight: 800;
  color: var(--primary-blue);
  margin-left: -15px;
}

.nav-logo-img {
  height: 85px;
  width: auto;
  object-fit: contain;
}

.logo-link:hover {
  color: var(--accent-red);
}

.nav-links {
  display: flex;
  gap: 1.5rem;
  list-style: none;
  align-items: stretch; /* Modified to allow items to fill height */
  white-space: nowrap;
}

.nav-item {
  font-weight: 600;
  font-size: 0.95rem;
  padding: 0 0.5rem;
  min-height: 80px;
  position: relative;
  display: flex;
  align-items: center;
  height: 100%;
  color: var(--text-black);
  cursor: pointer;
}

.nav-item::after {
  content: '';
  position: absolute;
  left: 0;
  bottom: 0;
  width: 0%;
  height: 3px;
  background-color: var(--accent-red);
  transition: width var(--transition-fast);
}

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

/* Dropdown */
.dropdown {
  position: relative;
}

.dropdown-arrow {
  display: inline-block;
  margin-left: 6px;
  font-size: 0.85em;
  transition: transform var(--transition-fast);
}

.dropdown:hover .dropdown-arrow {
  transform: rotate(180deg);
}

.dropdown-menu {
  position: absolute;
  top: 100%; /* Now perfectly flush with the nav-item bounding box */
  left: -20px;
  background: var(--bg-white);
  min-width: 250px;
  box-shadow: 0 15px 35px rgba(0,0,0,0.2);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.2s ease, visibility 0.2s ease; /* Removed transform to prevent hit-area jumps */
  border-radius: 12px;
  padding: 0.8rem 0;
  z-index: 10001; /* Higher than navbar */
  pointer-events: none; /* Ignore while invisible */
}

.dropdown:hover .dropdown-menu {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

.nav-subitem {
  display: block;
  padding: 0.75rem 1.5rem;
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--text-gray);
}

.nav-subitem:hover {
  background-color: var(--bg-light);
  color: var(--primary-blue);
  padding-left: 2rem; /* micro interaction */
}

.lang-toggle {
  display: flex;
  align-items: center;
  height: 100%;
}

/* Language Toggle */
#lang-btn {
  background: transparent;
  color: var(--text-black);
  border: 2px solid #ddd;
  padding: 0.5rem 1rem;
  border-radius: 25px;
  cursor: pointer;
  font-weight: 800;
  font-size: 1.05rem;
  transition: all var(--transition-fast);
  display: flex;
  align-items: center;
  gap: 8px;
}

#lang-btn:hover {
  background: var(--bg-light);
  color: var(--primary-blue);
  border-color: var(--primary-blue);
}

/* Sections - SPA Simulation */
.page-section {
  display: none;
  opacity: 0;
  animation: fadeIn 0.4s ease forwards;
  min-height: calc(100vh - 80px);
  padding-top: 80px; /* Offset for fixed navbar */
}

.page-section.active-section {
  display: block;
}

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

/* Hero Section */
.hero {
  position: relative;
  height: 70vh;
  min-height: 500px;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  background: linear-gradient(135deg, var(--bg-white) 0%, var(--bg-light) 100%);
  padding: 2rem;
  overflow: hidden;
}

/* Placeholder for generated background */
.hero::before {
  display: none;
}

.hero-carousel {
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  z-index: 0;
  background: var(--bg-light);
}

.carousel-img {
  position: absolute;
  top: 0; left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 30%;
  opacity: 0;
  transition: opacity 1.5s ease-in-out;
}

.carousel-img.active {
  opacity: 1;
}

.hero-overlay {
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  background: linear-gradient(to bottom, rgba(0,0,0,0.4), rgba(0,0,0,0.75));
  z-index: 1;
}

.hero-content {
  position: relative;
  z-index: 2;
  max-width: 800px;
}

.hero h1 {
  font-size: 3.5rem;
  font-weight: 800;
  color: var(--bg-white);
  margin-bottom: 1rem;
  line-height: 1.1;
  text-shadow: 0 4px 10px rgba(0, 0, 0, 0.5);
}

.hero p {
  font-size: 1.25rem;
  color: var(--bg-white);
  margin-bottom: 2rem;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.5);
}

/* Buttons */
.btn {
  display: inline-block;
  padding: 0.8rem 2rem;
  border-radius: 30px;
  font-weight: 600;
  border: none;
  cursor: pointer;
  transition: transform var(--transition-fast), box-shadow var(--transition-fast);
}

.btn-primary {
  background-color: var(--primary-blue);
  color: var(--bg-white);
  box-shadow: 0 4px 15px rgba(10, 132, 207, 0.4);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(10, 132, 207, 0.6);
  color: var(--bg-white);
}

/* Footer */
.footer {
  background-color: var(--primary-blue);
  color: var(--bg-white);
  padding: 1.5rem 0 0.5rem;
}

.footer-content {
  display: flex;
  justify-content: space-between;
  align-items: stretch;
  flex-wrap: wrap;
  gap: 1rem;
  margin-bottom: 0.5rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.2);
  padding-bottom: 0.5rem;
}

.footer-col {
  flex: 1;
  min-width: 250px;
  text-align: center;
  position: relative;
}

.footer-col h4 {
  font-size: 1.3rem;
  margin-bottom: 0.8rem;
  color: var(--highlight-yellow);
  letter-spacing: 1px;
}

.footer-link {
  color: var(--bg-white);
  text-decoration: none;
  display: block;
  margin-bottom: 0.5rem;
  font-size: 1.1rem;
  transition: color var(--transition-fast);
  position: relative;
  z-index: 10005; /* Ensures it's above chatbot (9999) when scrolled to bottom */
}

.footer-link:hover {
  color: var(--highlight-yellow);
}

.footer-center {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.2rem;
  pointer-events: none; /* Crucial: ensures the column box itself doesn't block neighbors */
}

.footer-social {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 1.8rem;
  position: relative;
  z-index: 10;
  pointer-events: auto; /* Re-enable for icons */
}

.footer-logo-img {
  height: 250px;
  max-width: 100%;
  width: auto;
  object-fit: contain;
  opacity: 0.95;
  margin-top: -30px;
  margin-bottom: -40px;
  pointer-events: auto; /* Re-enable for the image itself */
}

.social-icon {
  color: var(--bg-white);
  transition: transform var(--transition-fast), color var(--transition-fast);
  display: inline-block;
}

.social-icon:hover {
  color: var(--highlight-yellow);
  transform: translateY(-3px) scale(1.15);
}

.footer-bottom {
  text-align: center;
  font-size: 0.95rem;
  opacity: 0.85;
}

@media (max-width: 768px) {
  .footer-content {
    flex-direction: column;
    text-align: center;
  }
  .footer-col[style] {
    text-align: center !important;
  }
}

/* Responsive */
@media (max-width: 768px) {
  .nav-links {
    position: absolute;
    top: 100%;
    left: 0;
    width: 100%;
    background: var(--bg-white);
    flex-direction: column;
    align-items: center;
    padding: 2rem 0;
    gap: 1.5rem;
    box-shadow: var(--shadow-md);
    clip-path: circle(0% at top right);
    transition: all var(--transition-normal);
    display: flex;
  }
  .nav-links.nav-active {
    clip-path: circle(150% at top right);
  }
  .dropdown-menu {
    position: static;
    opacity: 1;
    visibility: visible;
    box-shadow: none;
    transform: none;
    display: none;
    background: transparent;
    text-align: center;
  }
  .dropdown.active .dropdown-menu {
    display: block;
  }
  .hamburger {
    display: flex;
    flex-direction: column;
    gap: 5px;
    cursor: pointer;
  }
  .hamburger span {
    width: 25px;
    height: 3px;
    background-color: var(--text-black);
    border-radius: 3px;
    transition: all 0.3s ease;
  }
  .hamburger.toggle span:nth-child(1) {
    transform: rotate(-45deg) translate(-5px, 6px);
  }
  .hamburger.toggle span:nth-child(2) {
    opacity: 0;
  }
  .hamburger.toggle span:nth-child(3) {
    transform: rotate(45deg) translate(-5px, -6px);
  }
  .hero h1 {
    font-size: 2.5rem;
  }
}

/* Why Choose Us Section */
.why-choose-us-section, .split-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 3rem;
  align-items: center;
}

@media (max-width: 768px) {
  .why-choose-us-section, .split-grid {
    grid-template-columns: 1fr;
    gap: 2rem;
  }
}

.image-placeholder {
  width: 100%;
  height: 360px;
  background: linear-gradient(135deg, var(--bg-light) 0%, #E6F3FF 100%);
  border: 4px dashed var(--primary-blue);
  border-radius: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  color: var(--primary-blue);
  font-weight: 600;
  box-shadow: var(--shadow-sm);
  transition: transform var(--transition-normal);
}

.image-placeholder:hover {
  transform: scale(1.02);
}

.why-text-wrapper .section-title {
  margin-bottom: 2rem;
}

.why-desc {
  font-size: 1.3rem;
  color: var(--text-gray);
  line-height: 1.8;
}

.director-img-wrap {
  float: right;
  width: 28%;
  min-width: 260px;
  margin-left: 3.5rem;
  margin-bottom: 2rem;
  text-align: center;
}

.history-img-wrap {
  float: right;
  width: 45%;
  height: 350px;
  margin-left: 2.5rem;
  margin-bottom: 1.5rem;
  border-radius: 15px;
}

@media (max-width: 768px) {
  .history-img-wrap {
    float: none;
    width: 100%;
    margin-left: 0;
    margin-bottom: 2rem;
  }
}

@media (max-width: 768px) {
  .director-img-wrap {
    float: none;
    width: 100%;
    margin-left: 0;
    margin-bottom: 2rem;
  }
}

.inicial-content {
  display: flex;
  align-items: flex-start;
  gap: 3.5rem;
}

.inicial-img-wrap {
  flex: 0 0 35%;
  min-width: 280px;
}

.inicial-text {
  flex: 1;
  min-width: 0; /* Prevents overflow pushing */
}

@media (max-width: 768px) {
  .inicial-content {
    flex-direction: column;
    gap: 2rem;
  }
  .inicial-img-wrap {
    flex: 0 0 100%;
    width: 100%;
  }
}

/* Alianzas & Certificaciones */
.logo-marquee {
  overflow: hidden;
  width: 100%;
  padding: 3rem 0;
  position: relative;
  background: var(--bg-white);
  border-radius: 20px;
  box-shadow: var(--shadow-sm);
  margin-top: 1rem;
}

.logo-marquee::before, .logo-marquee::after {
  content: '';
  position: absolute;
  top: 0; width: 120px; height: 100%;
  z-index: 2;
}

.logo-marquee::before {
  left: 0;
  background: linear-gradient(to right, var(--bg-white) 0%, transparent 100%);
}

.logo-marquee::after {
  right: 0;
  background: linear-gradient(to left, var(--bg-white) 0%, transparent 100%);
}

.marquee-track {
  display: flex;
  gap: 5rem;
  width: max-content;
  animation: scroll 40s linear infinite;
  align-items: center;
}

.marquee-track img {
  height: 90px;
  width: auto;
  object-fit: contain;
  opacity: 0.85;
  transition: all var(--transition-normal);
}

.marquee-track img:hover {
  opacity: 1;
  transform: scale(1.05);
}

@keyframes scroll {
  0% { transform: translateX(0); }
  100% { transform: translateX(calc(-50% - 2.5rem)); }
}

/* Oferta Academica Preview */
.bg-light {
  background-color: var(--bg-light);
  border-radius: 20px;
  margin-top: 3rem;
  margin-bottom: 2rem;
}

.oferta-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 2rem;
  margin-top: 3rem;
}

@media (max-width: 768px) {
  .oferta-grid {
    grid-template-columns: 1fr;
  }
}

.oferta-card {
  text-decoration: none;
  background: var(--bg-white);
  border-radius: 15px;
  padding: 1.5rem;
  text-align: center;
  box-shadow: var(--shadow-sm);
  transition: transform var(--transition-normal), box-shadow var(--transition-normal);
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.oferta-card:hover {
  transform: translateY(-5px);
  box-shadow: var(--shadow-md);
}

.oferta-img-placeholder {
  width: 100%;
  height: 250px;
  background: linear-gradient(135deg, #e2e2e2 0%, #f0f0f0 100%);
  border: 3px dashed #cccccc;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #888;
  font-size: 1.2rem;
  font-weight: 600;
  transition: border-color var(--transition-normal);
}

.oferta-card:hover .oferta-img-placeholder {
  border-color: var(--primary-blue);
  color: var(--primary-blue);
}

.oferta-card-title {
  font-size: 1.8rem;
  color: var(--text-black);
  margin: 0;
  transition: color var(--transition-fast);
}

.oferta-card:hover .oferta-card-title {
  color: var(--primary-blue);
}

/* Specific Section Styles */
.grid-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 2rem;
  margin-top: 2rem;
}

.card {
  background: var(--bg-white);
  padding: 2.5rem 2rem;
  border-radius: 20px;
  box-shadow: var(--shadow-sm);
  transition: transform var(--transition-normal), box-shadow var(--transition-normal);
  border-top: 6px solid var(--accent-red);
}

.card:hover {
  transform: translateY(-8px);
  box-shadow: var(--shadow-md);
}

.card-blue { border-top-color: var(--primary-blue); }
.card-yellow { border-top-color: var(--highlight-yellow); }
.card-red { border-top-color: var(--accent-red); }
.border-blue { border-top-color: var(--primary-blue);; border-left: 1px solid #EEE; border-right: 1px solid #EEE; border-bottom: 1px solid #EEE;}

.card-icon {
  font-size: 3.5rem;
  margin-bottom: 1rem;
}

.card h3 {
  font-size: 1.5rem;
  margin-bottom: 0.5rem;
  color: var(--text-black);
}

.card p {
  color: var(--text-gray);
  line-height: 1.6;
}

/* Contact Info */
.contact-list {
  font-size: 1.1rem;
  line-height: 2.5;
}

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

/* Campus Map */
.map-container {
  width: 100%;
  height: 400px;
  background: linear-gradient(135deg, var(--bg-light) 0%, #E6F3FF 100%);
  border-radius: 20px;
  overflow: hidden;
  margin-top: 2rem;
  border: 4px solid var(--primary-blue);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--primary-blue);
  box-shadow: var(--shadow-sm);
}

/* Staff Grid */
.staff-card {
  text-align: center;
  padding: 3rem 2rem;
}

.staff-img {
  width: 130px;
  height: 130px;
  border-radius: 50%;
  margin: 0 auto 1.5rem auto;
  border: 5px solid var(--bg-white);
  box-shadow: 0 4px 15px rgba(0,0,0,0.1);
  transition: transform var(--transition-normal);
}

.staff-card:hover .staff-img {
  transform: scale(1.05);
}

/* Photo Marquee */
.photo-marquee-container {
  overflow: hidden;
  width: 100%;
  padding: 3.5rem 0 0 0;
  position: relative;
  background: var(--bg-white);
}

.photo-marquee-track {
  display: flex;
  width: max-content;
  animation: photoScroll 35s linear infinite;
  gap: 1.5rem;
}

.photo-marquee-track:hover {
  animation-play-state: paused;
}

.photo-marquee-track img {
  height: 360px;
  width: auto;
  border-radius: 12px;
  box-shadow: var(--shadow-sm);
  object-fit: cover;
}

@media (max-width: 768px) {
  .photo-marquee-track img {
    height: 250px;
  }
}

@keyframes photoScroll {
  0% { transform: translateX(0); }
  100% { transform: translateX(calc(-50% - 0.75rem)); }
}

@media (max-width: 768px) {
  .quote-content {
    flex-direction: column-reverse;
    text-align: center;
    padding: 2rem !important;
  }
  .quote-content blockquote {
    text-align: left;
  }
  .quote-img-wrap {
    margin-bottom: 2rem;
  }
  .dir-signature {
    text-align: left;
    padding-left: 0 !important;
  }
}

/* Chatbot Widget */
.chatbot-widget {
  position: fixed;
  bottom: 1.2rem; /* Reduced from 2rem to give more space at top */
  right: 1.5rem;
  z-index: 9999;
  display: flex;
  flex-direction: column-reverse;
  align-items: flex-end;
  pointer-events: none;
}

.chatbot-toggle {
  width: 80px; /* Increased from 68px */
  height: 80px;
  background-color: var(--primary-blue);
  color: white;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  cursor: pointer;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
  transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  overflow: visible; /* Changed to visible to prevent badge clipping */
  position: relative;
  border: 4px solid white;
  pointer-events: auto;
  z-index: 10001;
}

.chatbot-toggle:hover {
  width: auto;
  min-width: 320px; /* Balanced for 80px base */
  max-width: 320px;
  border-radius: 40px;
  justify-content: flex-start;
  background-color: var(--accent-red);
}

.chat-toggle-icon-container {
  width: 80px;
  height: 80px;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  flex-shrink: 0;
  transition: all 0.3s ease;
}

.mini-chat-icon {
  position: absolute;
  top: 5px; /* Moved to top-right to be clearly 'outside' the main center branding */
  right: 5px;
  width: 24px;
  height: 24px;
  background: var(--accent-red);
  color: white;
  border-radius: 50%;
  padding: 4px;
  z-index: 10;
  box-shadow: 0 2px 8px rgba(0,0,0,0.4);
  border: 2px solid white;
}

.chatbot-toggle-text {
  font-size: 1.1rem;
  font-weight: 700;
  white-space: nowrap;
  opacity: 0;
  max-width: 0; /* Prevents text from pushing the icon when collapsed */
  transition: all 0.3s ease;
  padding-right: 0;
  overflow: hidden;
}

.chatbot-toggle:hover .chatbot-toggle-text {
  opacity: 1;
  max-width: 220px;
  padding-right: 1.8rem;
  padding-left: 0.5rem;
}

.chatbot-window {
  width: 350px; /* Increased for better text fitting */
  max-width: 90vw;
  max-height: 65vh; 
  background-color: white;
  border-radius: 18px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
  overflow: hidden;
  margin-bottom: 0.6rem;
  transform-origin: bottom right;
  transition: transform 0.3s ease, opacity 0.3s ease;
  pointer-events: auto;
  display: flex;
  flex-direction: column;
}

.chatbot-window.hidden {
  transform: scale(0);
  opacity: 0;
  pointer-events: none;
}

.chatbot-header {
  background: linear-gradient(135deg, var(--primary-blue) 0%, #065e94 100%);
  color: white;
  padding: 0.8rem 1rem; /* Slightly reduced padding */
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.chatbot-close {
  background: none;
  border: none;
  color: white;
  font-size: 1.5rem;
  cursor: pointer;
  line-height: 1;
}

.chatbot-messages {
  padding: 1.2rem 1rem; /* Reduced padding */
  flex: 1;
  overflow-y: auto;
  background-color: #f9f9f9;
  display: flex;
  flex-direction: column;
  min-height: 120px;
}

.chat-bubble {
  background-color: white;
  padding: 0.8rem 1.2rem;
  box-shadow: 0 2px 8px rgba(0,0,0,0.06);
  margin-bottom: 0.8rem;
  font-size: 0.95rem;
  color: var(--text-black);
  line-height: 1.5;
  width: fit-content;
  max-width: 100%;
  word-wrap: break-word;
  overflow-wrap: break-word; /* Essential for preventing overflow */
  border-radius: 15px 15px 15px 0;
  display: block; /* Stable block formatting */
  animation: fadeIn 0.3s ease;
  position: relative;
}

.bot-bubble {
  align-self: flex-start;
  border: 1px solid #eee;
}

.user-bubble {
  background-color: var(--primary-blue);
  color: white;
  border-radius: 15px 15px 0 15px;
  align-self: flex-end;
  box-shadow: 0 4px 12px rgba(10,132,207,0.15);
}

.bot-message-row {
  display: flex;
  align-items: flex-end;
  gap: 10px;
  margin-bottom: 1rem;
  width: 100%;
  justify-content: flex-start;
}

.user-message-row {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  margin-bottom: 1rem;
  width: 100%;
}

.bubble-container {
  display: flex;
  flex-direction: column;
  max-width: 82%; /* Slightly reduced to give breathing room */
}

.user-message-row .sender-name {
  margin-left: 0;
  margin-right: 5px;
}

.user-message-row .user-bubble {
  margin-bottom: 0;
}

/* Typing Indicator Animation */
.typing-dots span {
  display: inline-block;
  animation: typing-bounce 1.4s infinite ease-in-out both;
  font-weight: bold;
}

.typing-dots span:nth-child(1) { animation-delay: -0.32s; }
.typing-dots span:nth-child(2) { animation-delay: -0.16s; }

@keyframes typing-bounce {
  0%, 80%, 100% { transform: translateY(0); }
  40% { transform: translateY(-3px); }
}

.bot-avatar {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  object-fit: contain;
  background-color: white;
  border: 1px solid #eee;
  flex-shrink: 0;
  box-shadow: 0 2px 4px rgba(0,0,0,0.02);
}

.user-bubble {
  background-color: var(--primary-blue);
  color: white;
  border-radius: 15px 15px 0 15px;
  align-self: flex-end;
  box-shadow: 0 2px 8px rgba(10,132,207,0.2);
}

.chat-options {
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 0.5rem;
  width: 100%;
  flex-shrink: 0;
  padding-bottom: 1.5rem;
}

.chat-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  background-color: white;
  border: 1px solid var(--primary-blue);
  color: var(--primary-blue);
  padding: 0.4rem 0.8rem;
  border-radius: 20px;
  text-decoration: none;
  font-size: 0.8rem;
  font-weight: 500;
  transition: all 0.2s ease;
  cursor: pointer;
  text-align: left;
  animation: fadeIn 0.3s ease;
}

.chat-chip:hover {
  background-color: var(--primary-blue);
  color: white;
}

.chat-icon-inline {
  width: 15px;
  height: 15px;
  vertical-align: -3px;
  margin-right: 4px;
  stroke: currentColor;
  stroke-width: 2;
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.chatbot-input-area {
  display: flex;
  padding: 0.8rem;
  background-color: white;
  border-top: 1px solid #eee;
  gap: 0.5rem;
  align-items: center;
}

.chatbot-input-area input {
  flex: 1;
  padding: 0.6rem 1rem;
  border: 1px solid #ddd;
  border-radius: 20px;
  font-size: 0.9rem;
  outline: none;
  transition: border-color 0.3s;
}

.chatbot-input-area input:focus {
  border-color: var(--primary-blue);
}

.chatbot-input-area button {
  background-color: var(--primary-blue);
  color: white;
  border: none;
  border-radius: 50%;
  width: 38px;
  height: 38px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: transform 0.2s, background-color 0.2s;
}

.chatbot-input-area button:hover {
  background-color: var(--accent-red);
  transform: scale(1.05);
}

.chat-dropdown-response.active {
  display: block;
  animation: fadeInDown 0.3s ease;
}

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

.chatbot-footer {
  padding: 0.8rem;
  text-align: center;
  background-color: white;
  border-top: 1px solid #eee;
}

@media (max-width: 480px) {
  .chatbot-widget {
    bottom: 1rem;
    right: 1rem;
  }
  .chatbot-window {
    width: calc(100vw - 2rem);
    position: fixed;
    bottom: 80px;
    right: 1rem;
  }
}
