/* Modern styles for Bootstrap 5 customization */

:root {
  --bf-primary: #1DA7A0;
  --bf-secondary: #123C6B;
  --bf-dark: #212121;
  --bf-light: #F8FAFC;
  --bf-surface: #F8FAFC;
  --bs-primary: var(--bf-primary);
  --bs-primary-rgb: 29, 167, 160;
}

/* Typography */
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  line-height: 1.6;
  color: var(--bf-dark);
  margin: 0;
  padding: 0;
  background: var(--bf-surface); /* Light background */
}

h1, h2, h3, h4, h5, h6, .h1, .h2, .h3, .h4, .h5, .h6 {
  font-weight: 600;
  line-height: 1.3;
}

/* Navigation */
.navbar {
  padding: 1rem 0;
  transition: all 0.3s ease;
  background: var(--bf-secondary) !important;
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.navbar-dark .navbar-brand {
  font-weight: 600;
  color: white !important;
}

.navbar-dark .navbar-toggler {
  border-color: rgba(255,255,255,0.3);
}

.navbar-nav .nav-link {
  font-weight: 500;
  color: rgba(255, 255, 255, 0.9) !important;
  padding: 0.5rem 1rem !important;
  transition: all 0.3s ease;
}

.navbar-nav .nav-link:hover {
  color: white !important;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 4px;
}

/* Dropdown Menu Styling */
.navbar-dark .dropdown-menu {
  background: var(--bf-secondary);
  border: 1px solid rgba(255, 255, 255, 0.1);
  margin-top: 0.5rem;
}

.navbar-dark .dropdown-item {
  color: rgba(255, 255, 255, 0.9);
  padding: 0.5rem 1rem;
  transition: all 0.2s ease;
}

.navbar-dark .dropdown-item:hover,
.navbar-dark .dropdown-item:focus {
  background: rgba(255, 255, 255, 0.1);
  color: white;
}

.navbar-dark .dropdown-divider {
  border-color: rgba(255, 255, 255, 0.2);
}

/* Hero Section - Vanilla Bootstrap approach with good contrast */
.hero-section {
  background: linear-gradient(135deg, var(--bf-primary) 0%, var(--bf-secondary) 100%);
  color: white;
  position: relative;
  overflow: hidden;
  padding-top: 100px; /* Account for fixed navbar */
  padding-bottom: 60px;
  min-height: 80vh;
}

/* Optional: If gradient doesn't work well, use solid color */
@supports not (background: linear-gradient(135deg, #000 0%, #fff 100%)) {
  .hero-section {
    background: var(--bf-primary);
  }
}

.hero-section::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.05'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
  pointer-events: none;
  z-index: 1;
}

.hero-section > * {
  position: relative;
  z-index: 2;
}

.hero-section h1 {
  color: white;
  text-shadow: 0 2px 4px rgba(0,0,0,0.2);
  font-weight: 400;
}

.hero-section h2 {
  color: #FFE66D !important;
  text-shadow: 0 1px 2px rgba(0,0,0,0.2);
}

.hero-section .text-primary {
  color: #FFE66D !important;
}

.hero-section .lead {
  color: rgba(255, 255, 255, 0.95);
  font-size: 1.1rem;
}

.min-vh-50 {
  min-height: 50vh;
}

/* Cards */
.card {
  border: none;
  border-radius: 12px;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.card:hover.hover-shadow {
  transform: translateY(-5px);
  box-shadow: 0 10px 30px rgba(0,0,0,0.15) !important;
}

/* Buttons */
.btn {
  border-radius: 6px;
  font-weight: 500;
  padding: 0.5rem 1.5rem;
  transition: all 0.3s ease;
}

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

.btn-primary:hover {
  background-color: #168a84;
  border-color: #168a84;
  transform: translateY(-2px);
  box-shadow: 0 5px 15px rgba(29, 167, 160, 0.3);
}

.btn-outline-primary {
  color: var(--bf-primary);
  border-color: var(--bf-primary);
}

.btn-outline-primary:hover {
  background-color: var(--bf-primary);
  border-color: var(--bf-primary);
}

/* Forms */
.form-control, .form-select {
  border-radius: 6px;
  border: 2px solid #e0e0e0;
  padding: 0.75rem;
  transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

.form-control:focus, .form-select:focus {
  border-color: var(--bf-primary);
  box-shadow: 0 0 0 0.2rem rgba(29, 167, 160, 0.25);
}

/* Chat Widget */
.chat-messages {
  background: #f8f9fa;
  border-radius: 8px;
  padding: 1rem;
  scroll-behavior: smooth;
}

.message {
  animation: slideIn 0.3s ease;
}

.message.text-end {
  text-align: right;
}

.message .bg-white {
  background: white !important;
  color: var(--bf-dark);
}

.message .bg-primary {
  background: var(--bf-primary) !important;
}

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

/* HTMX Indicators */
.htmx-indicator {
  display: none;
}

.htmx-request .htmx-indicator {
  display: block;
}

.htmx-request.htmx-indicator {
  display: block;
}

/* Enhanced Thinking Animation */
.thinking-animation {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--bf-primary), var(--bf-secondary));
  position: relative;
  overflow: hidden;
  /* Force perfect circle on mobile */
  aspect-ratio: 1 / 1;
  flex-shrink: 0;
}

/* Pulsing effect for the entire thinking bubble */
.htmx-request #typing-indicator .message > div {
  animation: thinking-bubble-pulse 2s infinite ease-in-out;
}

@keyframes thinking-bubble-pulse {
  0%, 100% {
    transform: scale(1);
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
  }
  50% {
    transform: scale(1.02);
    box-shadow: 0 4px 16px rgba(29, 167, 160, 0.15);
  }
}

.thinking-dots {
  display: flex;
  gap: 4px;
}

.thinking-dots span {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: white;
  animation: thinking-pulse 1.4s infinite ease-in-out;
}

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

@keyframes thinking-pulse {
  0%, 80%, 100% {
    transform: scale(0.7);
    opacity: 0.5;
  }
  40% {
    transform: scale(1);
    opacity: 1;
  }
}

/* Thinking text animation */
.thinking-text {
  min-width: 120px;
}

/* Ensure perfect circle on all screen sizes */
@media (max-width: 576px) {
  .thinking-animation {
    width: 36px;
    height: 36px;
    min-width: 36px;
    min-height: 36px;
  }
}

.thinking-message {
  animation: thinking-text-fade 3s infinite ease-in-out;
}

@keyframes thinking-text-fade {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.6; }
}

/* New chat button styles */
.btn-new-chat {
  position: absolute;
  top: 10px;
  right: 10px;
  z-index: 10;
  opacity: 0.8;
  transition: opacity 0.2s;
}

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

/* Style for quick actions below chat */
.quick-actions-below {
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid var(--bs-gray-300);
}

/* Alpine.js Transitions */
[x-cloak] {
  display: none !important;
}

/* Badges */
.badge {
  font-weight: 500;
  padding: 0.5rem 1rem;
  border-radius: 20px;
}

/* Section Backgrounds */
section {
  position: relative;
}

.py-5 {
  padding-top: 3rem !important;
  padding-bottom: 3rem !important;
}

#agent {
  background: linear-gradient(135deg, #f8f9fa, #e9ecef);
  border-top: 1px solid #dee2e6;
}

#offerings {
  background: white;
}

#about {
  background: linear-gradient(135deg, #f8f9fa, #e9ecef);
}

#contact {
  background: white;
  border-top: 1px solid #dee2e6;
}

/* Footer */
footer {
  background: var(--bf-dark) !important;
  padding: 40px 0;
}

/* Responsive Adjustments */
@media (max-width: 768px) {
  .hero-section h1 {
    font-size: 2rem;
  }
  
  .card {
    margin-bottom: 1rem;
  }
}

/* Loading States */
.spinner-border-sm {
  width: 1rem;
  height: 1rem;
  border-width: 0.2em;
}

/* Shadow Utilities */
.shadow-sm {
  box-shadow: 0 2px 8px rgba(0,0,0,0.08) !important;
}

.shadow {
  box-shadow: 0 4px 12px rgba(0,0,0,0.12) !important;
}

/* Remove conflicting bg-gradient class since Bootstrap 5 has its own */

/* Smooth Scrolling */
html {
  scroll-behavior: smooth;
}

/* Package Cards Icons */
.bi {
  display: inline-block;
  vertical-align: middle;
}

.fs-1 {
  font-size: 3rem !important;
}

/* Contact Form Success */
.alert-success {
  background-color: #d4edda;
  border-color: #c3e6cb;
  color: #155724;
  border-radius: 8px;
}

/* Quick Action Buttons */
.btn-sm {
  padding: 0.375rem 0.75rem;
  font-size: 0.875rem;
}

/* Personalization Card */
.self-identify-section {
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(10px);
}

/* Hero Section Card Override - Ensure readable text */
.hero-section .card {
  background: rgba(255, 255, 255, 0.98);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.3);
  color: var(--bf-dark); /* Dark text for readability */
}

.hero-section .card h3,
.hero-section .card h4,
.hero-section .card h5,
.hero-section .card p,
.hero-section .card label {
  color: var(--bf-dark) !important;
}

.hero-section .btn-primary {
  background-color: var(--bf-primary);
  border-color: var(--bf-primary);
  color: white;
}

/* Hover Effects */
.hover-lift:hover {
  transform: translateY(-3px);
  transition: transform 0.3s ease;
}

/* Custom Scrollbar */
.chat-messages::-webkit-scrollbar {
  width: 8px;
}

.chat-messages::-webkit-scrollbar-track {
  background: #f1f1f1;
  border-radius: 4px;
}

.chat-messages::-webkit-scrollbar-thumb {
  background: #888;
  border-radius: 4px;
}

.chat-messages::-webkit-scrollbar-thumb:hover {
  background: #555;
}