/* Modern Homepage Redesign - Complete A-Z Improvement */

/* ============================================
   HERO SECTION - Modern Design
   ============================================ */
.modern-hero {
  position: relative;
  min-height: auto;
  padding: 40px 0 50px;
  display: flex;
  align-items: center;
  overflow: hidden;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  margin-bottom: 0;
  width: 100%;
}

.hero-background {
  position: absolute;
  inset: 0;
  z-index: 0;
}

.hero-slider {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.hero-slide {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  opacity: 0;
  transform: scale(1.1);
  transition: opacity 1s ease, transform 1.5s ease;
}

.hero-slide.active {
  opacity: 1;
  transform: scale(1);
}

.hero-overlay-gradient {
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(102, 126, 234, 0.85) 0%, rgba(118, 75, 162, 0.85) 100%),
              linear-gradient(180deg, rgba(0, 0, 0, 0.3) 0%, rgba(0, 0, 0, 0.1) 100%);
  z-index: 1;
}

.hero-glow-effect {
  position: absolute;
  width: 600px;
  height: 600px;
  right: -200px;
  top: -200px;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.15) 0%, transparent 70%);
  filter: blur(80px);
  z-index: 2;
  pointer-events: none;
  animation: pulse-glow 4s ease-in-out infinite;
}

@keyframes pulse-glow {
  0%, 100% { opacity: 0.5; transform: scale(1); }
  50% { opacity: 0.8; transform: scale(1.1); }
}

.hero-container {
  position: relative;
  z-index: 3;
  padding: 20px 24px;
  max-width: 1200px;
  margin: 0 auto;
  width: 100%;
}

.min-vh-50 {
  min-height: auto;
}

.hero-content-wrapper {
  color: #fff;
}

.hero-badge {
  display: inline-block;
}

.badge-text {
  display: inline-flex;
  align-items: center;
  padding: 8px 20px;
  background: rgba(255, 255, 255, 0.2);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: 50px;
  font-size: 0.9rem;
  font-weight: 500;
  color: #fff;
  animation: fadeInDown 0.8s ease;
}

.hero-title {
  font-size: clamp(1.75rem, 3vw, 2.25rem);
  font-weight: 700;
  line-height: 1.2;
  margin: 12px 0 12px;
  color: #fff;
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.15);
  animation: fadeInUp 0.8s ease 0.2s both;
}

.hero-subtitle {
  font-size: clamp(0.9rem, 1.2vw, 1rem);
  line-height: 1.5;
  color: rgba(255, 255, 255, 0.9);
  margin-bottom: 0;
  max-width: 480px;
  animation: fadeInUp 0.8s ease 0.4s both;
}

.hero-cta-buttons {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 16px;
  animation: fadeInUp 0.8s ease 0.6s both;
}

.btn-hero-primary {
  padding: 10px 20px;
  font-size: 0.9rem;
  font-weight: 600;
  background: #fff;
  color: #667eea;
  border: none;
  border-radius: 8px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
  transition: all 0.3s ease;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
}

.btn-hero-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.2);
  color: #667eea;
  background: #fff;
}

.btn-hero-secondary {
  padding: 10px 20px;
  font-size: 0.9rem;
  font-weight: 600;
  background: rgba(255, 255, 255, 0.15);
  backdrop-filter: blur(10px);
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: 8px;
  transition: all 0.3s ease;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
}

.btn-hero-secondary:hover {
  background: rgba(255, 255, 255, 0.25);
  border-color: rgba(255, 255, 255, 0.5);
  transform: translateY(-2px);
  color: #fff;
}

.hero-search-form {
  animation: fadeInUp 0.8s ease 0.8s both;
  max-width: 420px;
  margin-top: 16px;
}

.search-input-wrapper {
  position: relative;
  display: flex;
  align-items: center;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(10px);
  border-radius: 8px;
  padding: 3px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
  width: 100%;
}

.search-icon {
  position: absolute;
  left: 12px;
  color: #667eea;
  font-size: 1rem;
  z-index: 1;
}

.search-input {
  flex: 1;
  border: none;
  padding: 10px 12px 10px 36px;
  font-size: 0.85rem;
  background: transparent;
  border-radius: 8px;
}

.search-input:focus {
  outline: none;
  box-shadow: none;
}

.btn-search-submit {
  padding: 8px 16px;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: #fff;
  border: none;
  border-radius: 6px;
  font-weight: 600;
  font-size: 0.8rem;
  transition: all 0.3s ease;
  white-space: nowrap;
}

.btn-search-submit:hover {
  transform: scale(1.05);
  box-shadow: 0 5px 20px rgba(102, 126, 234, 0.4);
}

.hero-stats-modern {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 20px;
}

.stat-item {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(10px);
  padding: 8px 14px;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  transition: all 0.3s ease;
}

.stat-item:hover {
  background: rgba(255, 255, 255, 0.2);
  transform: translateY(-3px);
}

.stat-icon {
  font-size: 1.2rem;
  line-height: 1;
}

.stat-content {
  display: flex;
  flex-direction: column;
}

.stat-number {
  font-size: 1.1rem;
  font-weight: 700;
  color: #fff;
  line-height: 1;
}

.stat-label {
  font-size: 0.8rem;
  color: rgba(255, 255, 255, 0.85);
  margin-top: 2px;
}

.hero-visual {
  position: relative;
  height: 300px;
  max-width: 350px;
  margin-left: auto;
}

.hero-card-float {
  position: relative;
  width: 100%;
  height: 100%;
}

.floating-card {
  position: absolute;
  background: rgba(30, 30, 50, 0.9);
  backdrop-filter: blur(20px);
  padding: 14px 20px;
  border-radius: 12px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  font-weight: 600;
  color: #a5b4fc;
  animation: float 6s ease-in-out infinite;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.floating-card i {
  font-size: 1.4rem;
  color: #818cf8;
}

.floating-card span {
  font-size: 0.8rem;
}

.floating-card.card-1 {
  top: 5%;
  right: 20%;
  animation-delay: 0s;
}

.floating-card.card-2 {
  top: 45%;
  right: 0%;
  animation-delay: 2s;
}

.floating-card.card-3 {
  top: 55%;
  right: 45%;
  animation-delay: 4s;
}

.floating-card.card-3 {
  bottom: 10%;
  left: 20%;
  animation-delay: 4s;
}

@keyframes float {
  0%, 100% { transform: translateY(0px) rotate(0deg); }
  50% { transform: translateY(-20px) rotate(5deg); }
}

.hero-dots-modern {
  position: absolute;
  bottom: 40px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 12px;
  z-index: 4;
}

.hero-dots-modern button {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.5);
  background: transparent;
  cursor: pointer;
  transition: all 0.3s ease;
  padding: 0;
}

.hero-dots-modern button.active {
  background: #fff;
  border-color: #fff;
  transform: scale(1.3);
}

/* ============================================
   MAIN CONTENT SECTIONS
   ============================================ */
.main-content {
  padding: 24px 0;
  background: #f8f9fa;
  width: 100%;
}

.main-content > .container-fluid {
  max-width: 100%;
  width: 100%;
  margin: 0 auto;
  padding-left: 24px;
  padding-right: 24px;
}

.section-modern {
  margin-bottom: 28px;
}

.section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
  flex-wrap: wrap;
  gap: 10px;
}

.section-title-group {
  flex: 1;
  min-width: 200px;
}

.section-badge {
  display: inline-block;
  padding: 3px 10px;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: #fff;
  border-radius: 12px;
  font-size: 0.7rem;
  font-weight: 600;
  margin-bottom: 6px;
}

.section-title {
  font-size: 1.1rem;
  font-weight: 700;
  color: #1a202c;
  margin: 0 0 4px;
  line-height: 1.2;
}

.section-description {
  font-size: 0.8rem;
  color: #64748b;
  margin: 0;
  line-height: 1.4;
}

.btn-view-all {
  display: inline-flex;
  align-items: center;
  padding: 6px 12px;
  color: #667eea;
  font-weight: 600;
  font-size: 0.75rem;
  text-decoration: none;
  border: 1.5px solid #667eea;
  border-radius: 6px;
  transition: all 0.3s ease;
}

.btn-view-all:hover {
  background: #667eea;
  color: #fff;
  transform: translateX(2px);
}

/* ============================================
   COURSE CARDS - Modern Design
   ============================================ */
.courses-grid-modern {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 14px;
  margin-top: 12px;
}

.course-card-modern {
  background: #fff;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 1px 6px rgba(0, 0, 0, 0.05);
  transition: all 0.25s ease;
  display: flex;
  flex-direction: column;
}

.course-card-modern:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.08);
}

.course-image-wrapper {
  position: relative;
  width: 100%;
  padding-top: 52%; /* Shorter aspect ratio */
  overflow: hidden;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.course-image {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.4s ease;
}

.course-card-modern:hover .course-image {
  transform: scale(1.08);
}

.course-overlay {
  position: absolute;
  inset: 0;
  background: rgba(102, 126, 234, 0.85);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.25s ease;
}

.course-card-modern:hover .course-overlay {
  opacity: 1;
}

.btn-overlay {
  padding: 6px 14px;
  background: #fff;
  color: #667eea;
  border-radius: 5px;
  font-weight: 600;
  font-size: 0.75rem;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  transition: transform 0.2s ease;
}

.btn-overlay:hover {
  transform: scale(1.03);
  color: #667eea;
}

.course-badge-price,
.course-badge-free {
  position: absolute;
  top: 10px;
  right: 10px;
  padding: 4px 10px;
  border-radius: 12px;
  font-size: 0.7rem;
  font-weight: 600;
  z-index: 2;
}

.course-badge-price {
  background: #fbbf24;
  color: #78350f;
}

.course-badge-free {
  background: #10b981;
  color: #fff;
}

.course-card-body {
  padding: 12px;
  flex: 1;
  display: flex;
  flex-direction: column;
}

.course-title {
  font-size: 0.85rem;
  font-weight: 600;
  color: #1a202c;
  margin: 0 0 4px;
  line-height: 1.3;
}

.course-summary {
  font-size: 0.75rem;
  color: #64748b;
  line-height: 1.4;
  margin: 0 0 10px;
  flex: 1;
}

.course-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
  padding-top: 8px;
  border-top: 1px solid #e2e8f0;
}

.course-enrollments,
.course-level {
  display: flex;
  align-items: center;
  gap: 4px;
  color: #64748b;
  font-size: 0.7rem;
}

.course-enrollments i,
.course-level i {
  color: #667eea;
  font-size: 0.75rem;
}

.btn-course-action {
  padding: 5px 12px;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: #fff;
  border-radius: 5px;
  font-weight: 600;
  font-size: 0.7rem;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  transition: all 0.25s ease;
}

.btn-course-action:hover {
  transform: translateX(2px);
  box-shadow: 0 3px 8px rgba(102, 126, 234, 0.35);
  color: #fff;
}

.course-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-top: auto;
}

.tag-modern {
  padding: 2px 8px;
  background: #f1f5f9;
  color: #475569;
  border-radius: 8px;
  font-size: 0.65rem;
  font-weight: 500;
}

/* ============================================
   SEARCH & FILTER BAR
   ============================================ */
.search-filter-bar {
  background: #fff;
  padding: 14px;
  border-radius: 10px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.04);
}

.search-box-modern {
  position: relative;
  margin-bottom: 12px;
}

.search-box-modern i {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: #667eea;
  font-size: 0.9rem;
  z-index: 1;
}

.search-box-modern .form-control {
  padding: 10px 14px 10px 36px;
  border: 1.5px solid #e2e8f0;
  border-radius: 8px;
  font-size: 0.8rem;
  transition: all 0.3s ease;
}

.search-box-modern .form-control:focus {
  border-color: #667eea;
  box-shadow: 0 0 0 4px rgba(102, 126, 234, 0.1);
  outline: none;
}

.tag-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.filter-label {
  font-weight: 600;
  color: #475569;
  font-size: 0.75rem;
}

.tag-filter-btn {
  padding: 5px 10px;
  background: #f1f5f9;
  color: #475569;
  border: none;
  border-radius: 12px;
  font-size: 0.7rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
}

.tag-filter-btn:hover {
  background: #667eea;
  color: #fff;
  transform: translateY(-1px);
}

.search-suggestions-modern {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: #fff;
  border-radius: 8px;
  box-shadow: 0 6px 24px rgba(0, 0, 0, 0.12);
  margin-top: 6px;
  z-index: 10;
  max-height: 300px;
  overflow-y: auto;
}

.search-suggestions-modern a {
  display: block;
  padding: 10px 14px;
  color: #1a202c;
  text-decoration: none;
  border-bottom: 1px solid #e2e8f0;
  transition: background 0.2s ease;
}

.search-suggestions-modern a:hover {
  background: #f8f9fa;
}

.search-suggestions-modern a:last-child {
  border-bottom: none;
}

/* ============================================
   BLOG CARDS - Modern Design
   ============================================ */
.blog-grid-modern {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 14px;
  margin-top: 12px;
}

.blog-card-modern {
  background: #fff;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 1px 6px rgba(0, 0, 0, 0.05);
  transition: all 0.25s ease;
  display: flex;
  flex-direction: column;
}

.blog-card-modern:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.08);
}

.blog-image-wrapper {
  position: relative;
  width: 100%;
  padding-top: 45%;
  overflow: hidden;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.blog-image {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.4s ease;
}

.blog-card-modern:hover .blog-image {
  transform: scale(1.06);
}

.blog-date-badge {
  position: absolute;
  top: 8px;
  left: 8px;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(10px);
  padding: 4px 6px;
  border-radius: 4px;
  text-align: center;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.1);
}

.date-day {
  display: block;
  font-size: 0.85rem;
  font-weight: 700;
  color: #667eea;
  line-height: 1;
}

.date-month {
  display: block;
  font-size: 0.55rem;
  font-weight: 600;
  color: #64748b;
  text-transform: uppercase;
  margin-top: 1px;
}

.blog-card-body {
  padding: 10px;
  flex: 1;
  display: flex;
  flex-direction: column;
}

.blog-title {
  font-size: 0.8rem;
  font-weight: 600;
  color: #1a202c;
  margin: 0 0 5px;
  line-height: 1.3;
}

.blog-title a {
  color: inherit;
  text-decoration: none;
  transition: color 0.2s ease;
}

.blog-title a:hover {
  color: #667eea;
}

.blog-excerpt {
  font-size: 0.7rem;
  color: #64748b;
  line-height: 1.4;
  margin: 0 0 8px;
  flex: 1;
}

.blog-footer {
  padding-top: 8px;
  border-top: 1px solid #e2e8f0;
}

.btn-read-more {
  display: inline-flex;
  align-items: center;
  color: #667eea;
  font-weight: 600;
  text-decoration: none;
  font-size: 0.8rem;
  transition: all 0.3s ease;
}

.btn-read-more:hover {
  color: #764ba2;
  transform: translateX(3px);
}

/* ============================================
   FEATURES SECTION
   ============================================ */
.features-section-modern {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  padding: 36px 0;
  margin-top: 28px;
  border-radius: 20px 20px 0 0;
  color: #fff;
}

.features-section-modern .section-header {
  margin-bottom: 24px;
}

.features-section-modern .section-badge {
  background: rgba(255, 255, 255, 0.2);
  backdrop-filter: blur(10px);
}

.features-section-modern .section-title {
  color: #fff;
}

.features-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 14px;
  margin-top: 16px;
}

.feature-card-modern {
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(10px);
  padding: 18px 14px;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.15);
  text-align: center;
  transition: all 0.3s ease;
}

.feature-card-modern:hover {
  background: rgba(255, 255, 255, 0.15);
  transform: translateY(-4px);
  box-shadow: 0 12px 24px rgba(0, 0, 0, 0.15);
}

.feature-icon {
  width: 44px;
  height: 44px;
  margin: 0 auto 12px;
  background: rgba(255, 255, 255, 0.2);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.3rem;
  color: #fff;
}

.feature-card-modern h3 {
  font-size: 0.9rem;
  font-weight: 700;
  color: #fff;
  margin: 0 0 8px;
}

.feature-card-modern p {
  font-size: 0.75rem;
  line-height: 1.5;
  color: rgba(255, 255, 255, 0.85);
  margin: 0;
}

/* ============================================
   ANIMATIONS
   ============================================ */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fadeInDown {
  from {
    opacity: 0;
    transform: translateY(-30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ============================================
   RESPONSIVE DESIGN
   ============================================ */
@media (max-width: 1200px) {
  .courses-grid-modern,
  .blog-grid-modern {
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 24px;
  }
}

@media (max-width: 992px) {
  .modern-hero {
    min-height: 55vh;
  }

  .hero-visual {
    display: none;
  }

  .section-header {
    flex-direction: column;
    align-items: flex-start;
  }

  .btn-view-all {
    margin-top: 12px;
  }

  .hero-stats-modern {
    gap: 12px;
  }

  .stat-item {
    flex: 1;
    min-width: 120px;
  }
}

@media (max-width: 768px) {
  .modern-hero {
    min-height: auto;
    padding: 30px 0;
  }

  .hero-container {
    padding: 30px 16px;
  }

  .hero-title {
    font-size: 1.75rem;
  }

  .hero-subtitle {
    font-size: 0.95rem;
  }

  .hero-cta-buttons {
    flex-direction: column;
    width: 100%;
  }

  .btn-hero-primary,
  .btn-hero-secondary {
    width: 100%;
    justify-content: center;
  }

  .search-input-wrapper {
    flex-direction: column;
    gap: 8px;
  }

  .search-input {
    width: 100%;
  }

  .btn-search-submit {
    width: 100%;
  }

  .hero-stats-modern {
    flex-direction: column;
    gap: 12px;
  }

  .stat-item {
    width: 100%;
  }

  .courses-grid-modern,
  .blog-grid-modern {
    grid-template-columns: 1fr;
    gap: 24px;
  }

  .features-grid {
    grid-template-columns: 1fr;
    gap: 24px;
  }

  .main-content {
    padding: 60px 0;
  }

  .section-modern {
    margin-bottom: 60px;
  }

  .features-section-modern {
    padding: 60px 0;
    border-radius: 30px 30px 0 0;
  }
}

@media (max-width: 576px) {
  .hero-title {
    font-size: 2rem;
  }

  .section-title {
    font-size: 1.75rem;
  }

  .course-card-body,
  .blog-card-body {
    padding: 20px;
  }

  .search-filter-bar {
    padding: 20px;
  }
}

/* ============================================
   ACCESSIBILITY & PERFORMANCE
   ============================================ */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* Focus states for accessibility */
button:focus-visible,
a:focus-visible,
input:focus-visible {
  outline: 3px solid rgba(102, 126, 234, 0.5);
  outline-offset: 2px;
}

/* Print styles */
@media print {
  .modern-hero,
  .hero-dots-modern,
  .btn-view-all,
  .btn-course-action,
  .btn-read-more {
    display: none;
  }
}

/* ============================================
   ADVANCED AI CHATBOT WIDGET
   ============================================ */

/* Floating Toggle Button */
.ai-chat-toggle {
  position: fixed;
  bottom: 30px;
  right: 30px;
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  border: none;
  cursor: pointer;
  box-shadow: 0 4px 20px rgba(102, 126, 234, 0.4);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  overflow: hidden;
}

.ai-chat-toggle:hover {
  transform: scale(1.1);
  box-shadow: 0 6px 30px rgba(102, 126, 234, 0.5);
}

.ai-chat-toggle .toggle-icon {
  width: 28px;
  height: 28px;
  color: white;
  transition: transform 0.3s ease;
}

.ai-chat-toggle.active .toggle-icon {
  transform: rotate(180deg);
}

/* Pulse Animation */
.toggle-pulse {
  position: absolute;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  background: inherit;
  animation: pulse-ring 2s ease-out infinite;
}

@keyframes pulse-ring {
  0% {
    transform: scale(1);
    opacity: 0.6;
  }
  100% {
    transform: scale(1.8);
    opacity: 0;
  }
}

.ai-chat-toggle.active .toggle-pulse {
  animation: none;
  opacity: 0;
}

/* Badge on toggle */
.toggle-badge {
  position: absolute;
  top: -2px;
  right: -2px;
  background: #ef4444;
  color: white;
  font-size: 11px;
  font-weight: 600;
  min-width: 20px;
  height: 20px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 6px;
  box-shadow: 0 2px 8px rgba(239, 68, 68, 0.4);
  opacity: 0;
  transform: scale(0.8);
  transition: all 0.3s ease;
}

.toggle-badge.show {
  opacity: 1;
  transform: scale(1);
}

/* Chat Window */
.ai-chat-window {
  position: fixed;
  bottom: 100px;
  right: 30px;
  width: 380px;
  max-width: calc(100vw - 40px);
  height: 520px;
  max-height: calc(100vh - 140px);
  background: var(--card, #ffffff);
  border-radius: 20px;
  box-shadow: 0 10px 60px rgba(0, 0, 0, 0.15),
              0 0 0 1px rgba(0, 0, 0, 0.05);
  z-index: 999;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  opacity: 0;
  visibility: hidden;
  transform: translateY(20px) scale(0.95);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.ai-chat-window.open {
  opacity: 1;
  visibility: visible;
  transform: translateY(0) scale(1);
}

/* Chat Header */
.ai-chat-header {
  display: flex;
  align-items: center;
  padding: 16px 20px;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  gap: 12px;
}

.ai-avatar {
  width: 42px;
  height: 42px;
  background: rgba(255, 255, 255, 0.2);
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}

.ai-avatar svg {
  width: 24px;
  height: 24px;
  color: white;
}

.status-dot {
  position: absolute;
  bottom: -2px;
  right: -2px;
  width: 12px;
  height: 12px;
  background: #22c55e;
  border: 2px solid white;
  border-radius: 50%;
}

.header-info {
  flex: 1;
}

.header-info h4 {
  margin: 0;
  font-size: 16px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 8px;
}

.ai-badge {
  background: rgba(255, 255, 255, 0.25);
  padding: 2px 8px;
  border-radius: 12px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.5px;
}

.context-info {
  font-size: 12px;
  opacity: 0.85;
  margin-top: 2px;
}

.close-chat {
  background: rgba(255, 255, 255, 0.15);
  border: none;
  width: 32px;
  height: 32px;
  border-radius: 8px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s;
}

.close-chat:hover {
  background: rgba(255, 255, 255, 0.25);
}

.close-chat svg {
  width: 18px;
  height: 18px;
  color: white;
}

/* Messages Container */
.ai-chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  background: var(--bg, #f8fafc);
}

.ai-chat-messages::-webkit-scrollbar {
  width: 6px;
}

.ai-chat-messages::-webkit-scrollbar-track {
  background: transparent;
}

.ai-chat-messages::-webkit-scrollbar-thumb {
  background: rgba(0, 0, 0, 0.15);
  border-radius: 3px;
}

/* Chat Message Bubbles */
.chat-message {
  display: flex;
  gap: 10px;
  animation: messageSlide 0.3s ease;
}

@keyframes messageSlide {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.chat-message.user {
  flex-direction: row-reverse;
}

.message-avatar {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.chat-message.ai .message-avatar {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
}

.chat-message.user .message-avatar {
  background: #e2e8f0;
  color: #64748b;
}

.message-avatar svg {
  width: 18px;
  height: 18px;
}

.message-content {
  max-width: 75%;
  padding: 12px 16px;
  border-radius: 16px;
  font-size: 14px;
  line-height: 1.5;
}

.chat-message.ai .message-content {
  background: var(--card, white);
  color: var(--text, #1e293b);
  border-bottom-left-radius: 4px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

.chat-message.user .message-content {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  border-bottom-right-radius: 4px;
}

.message-time {
  font-size: 11px;
  opacity: 0.6;
  margin-top: 4px;
}

/* Typing Indicator */
.typing-indicator {
  display: flex;
  gap: 10px;
  padding: 8px 0;
}

.typing-indicator .message-avatar {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
}

.typing-dots {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 12px 16px;
  background: var(--card, white);
  border-radius: 16px;
  border-bottom-left-radius: 4px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

.typing-dots span {
  width: 8px;
  height: 8px;
  background: #94a3b8;
  border-radius: 50%;
  animation: typingBounce 1.4s infinite ease-in-out both;
}

.typing-dots span:nth-child(1) {
  animation-delay: 0s;
}

.typing-dots span:nth-child(2) {
  animation-delay: 0.16s;
}

.typing-dots span:nth-child(3) {
  animation-delay: 0.32s;
}

@keyframes typingBounce {
  0%, 80%, 100% {
    transform: scale(0.8);
    opacity: 0.5;
  }
  40% {
    transform: scale(1);
    opacity: 1;
  }
}

/* Suggested Topics */
.chat-suggestions {
  padding: 12px 20px;
  background: var(--bg, #f8fafc);
  border-top: 1px solid var(--border, #e2e8f0);
}

.suggestions-label {
  font-size: 11px;
  font-weight: 600;
  color: var(--muted, #64748b);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 8px;
}

.suggestions-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.suggestion-btn {
  background: var(--card, white);
  border: 1px solid var(--border, #e2e8f0);
  padding: 8px 14px;
  border-radius: 20px;
  font-size: 13px;
  color: var(--text, #475569);
  cursor: pointer;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  gap: 6px;
}

.suggestion-btn:hover {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  border-color: transparent;
  color: white;
  transform: translateY(-1px);
}

.suggestion-btn svg {
  width: 14px;
  height: 14px;
  opacity: 0.7;
}

/* Chat Input Area */
.ai-chat-input-container {
  padding: 16px 20px;
  background: var(--card, white);
  border-top: 1px solid var(--border, #e2e8f0);
}

.ai-chat-input-wrapper {
  display: flex;
  gap: 10px;
  align-items: flex-end;
}

.ai-chat-input {
  flex: 1;
  padding: 12px 16px;
  border: 2px solid var(--border, #e2e8f0);
  border-radius: 14px;
  font-size: 14px;
  resize: none;
  min-height: 44px;
  max-height: 120px;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
  font-family: inherit;
  background: var(--bg, #f8fafc);
  color: var(--text, #1e293b);
}

.ai-chat-input:focus {
  border-color: #667eea;
  box-shadow: 0 0 0 4px rgba(102, 126, 234, 0.1);
}

.ai-chat-input::placeholder {
  color: var(--muted, #94a3b8);
}

.ai-chat-send {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.2s, box-shadow 0.2s;
  flex-shrink: 0;
}

.ai-chat-send:hover:not(:disabled) {
  transform: scale(1.05);
  box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
}

.ai-chat-send:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.ai-chat-send svg {
  width: 20px;
  height: 20px;
  color: white;
}

/* Input Actions */
.input-actions {
  display: flex;
  gap: 8px;
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px dashed var(--border, #e2e8f0);
}

.input-action-btn {
  background: none;
  border: none;
  padding: 4px 8px;
  font-size: 12px;
  color: var(--muted, #64748b);
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 4px;
  border-radius: 6px;
  transition: background 0.2s, color 0.2s;
}

.input-action-btn:hover {
  background: var(--bg, #f1f5f9);
  color: #667eea;
}

.input-action-btn svg {
  width: 14px;
  height: 14px;
}

/* Responsive */
@media (max-width: 480px) {
  .ai-chat-toggle {
    bottom: 20px;
    right: 20px;
    width: 54px;
    height: 54px;
  }
  
  .ai-chat-window {
    bottom: 85px;
    right: 10px;
    left: 10px;
    width: auto;
    height: calc(100vh - 120px);
    max-height: none;
    border-radius: 16px;
  }
  
  .ai-chat-header {
    padding: 14px 16px;
  }
  
  .ai-chat-messages {
    padding: 16px;
  }
  
  .suggestion-btn {
    padding: 6px 12px;
    font-size: 12px;
  }
}

/* Dark Mode Support */
@media (prefers-color-scheme: dark) {
  .ai-chat-window {
    box-shadow: 0 10px 60px rgba(0, 0, 0, 0.4),
                0 0 0 1px rgba(255, 255, 255, 0.1);
  }
  
  .ai-chat-messages::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.2);
  }
  
  .chat-message.user .message-avatar {
    background: #374151;
    color: #9ca3af;
  }
}
