/* Base styles */
:root {
  --primary: #1e3565;
  --primary-light: #e0f7fa;
  --primary-dark: #1e3565;
  --secondary: #1e3565;
  --accent: #1e3565;
  --text-primary: #0f172a;
  --text-secondary: #64748b;
  --text-light: #94a3b8;
  --background: #f8fafc;
  --card-bg: rgba(255, 255, 255, 0.95);
  --error: #ef4444;
  --success: #10b981;
  --warning: #f59e0b;
  --border: #e2e8f0;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.05), 0 2px 4px rgba(0, 0, 0, 0.05);
  --shadow-lg: 0 10px 15px rgba(0, 0, 0, 0.1), 0 4px 6px rgba(0, 0, 0, 0.05);
  --shadow-xl: 0 20px 25px rgba(0, 0, 0, 0.15), 0 10px 10px rgba(0, 0, 0, 0.05);
  --radius-sm: 0.25rem;
  --radius-md: 0.5rem;
  --radius-lg: 0.75rem;
  --radius-xl: 1rem;
  --radius-full: 9999px;
  --transition-fast: 150ms ease;
  --transition-normal: 250ms ease;
  --transition-slow: 350ms ease;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
    Oxygen, Ubuntu, Cantarell, "Open Sans", "Helvetica Neue", sans-serif;
}

body {
  background: linear-gradient(135deg, #f8fafc 0%, #e0f7fa 100%);
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-primary);
  line-height: 1.5;
}

/* Page content */
.page-content {
  text-align: center;
  max-width: 600px;
  padding: 2rem;
}

h1 {
  font-size: 2.5rem;
  color: var(--text-primary);
  margin-bottom: 1rem;
  font-weight: 700;
}

p {
  font-size: 1.125rem;
  color: var(--text-secondary);
  margin-bottom: 1.5rem;
  line-height: 1.6;
}

.buttons {
  display: flex;
  gap: 1rem;
  justify-content: center;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.75rem 1.75rem;
  border-radius: var(--radius-full);
  font-weight: 500;
  text-decoration: none;
  transition: all 0.3s ease;
  box-shadow: var(--shadow-md);
  position: relative;
  overflow: hidden;
}

.btn::after {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(
    90deg,
    rgba(255, 255, 255, 0) 0%,
    rgba(255, 255, 255, 0.2) 50%,
    rgba(255, 255, 255, 0) 100%
  );
  transform: translateX(-100%);
  transition: transform 0.6s ease;
}

.btn:hover::after {
  transform: translateX(100%);
}

.btn-primary {
  background-color: var(--primary);
  color: white;
}

.btn-primary:hover {
  background-color: var(--primary-dark);
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
}

.btn-secondary {
  background-color: white;
  color: var(--text-primary);
  border: 1px solid var(--border);
}

.btn-secondary:hover {
  background-color: #f8fafc;
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
}

/* Chatbot styles */
.chatbot-container {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  z-index: 50;
  display: flex;
  flex-direction: column;
  justify-content: end;
  align-items: end;
}

.chatbot-button {
  height: 3.75rem;
  width: 3.75rem;
  border-radius: var(--radius-full);
  background-color: var(--primary);
  color: white;
  box-shadow: var(--shadow-lg);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.3s ease;
  border: none;
  position: relative;
  overflow: hidden;
}

.button-content {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  position: relative;
  z-index: 2;
}

.chatbot-button::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: radial-gradient(
    circle at center,
    var(--primary-light) 0%,
    transparent 70%
  );
  opacity: 0;
  transition: opacity 0.3s ease;
}

.chatbot-button:hover::before {
  opacity: 0.2;
}

.chatbot-button:hover {
  transform: scale(1.05) rotate(5deg);
  box-shadow: var(--shadow-xl);
}

.chatbot-button:active {
  transform: scale(0.95);
}

.chatbot-button i {
  font-size: 1.75rem;
  transition: all 0.3s ease;
}

.open-icon,
.close-icon {
  position: absolute;
  transition: all 0.3s ease;
}

.close-icon {
  opacity: 0;
  transform: scale(0.5) rotate(-90deg);
}

.chatbot-button.active .open-icon {
  opacity: 0;
  transform: scale(0.5) rotate(90deg);
}

.chatbot-button.active .close-icon {
  opacity: 1;
  transform: scale(1) rotate(0);
}

.notification-badge {
  position: absolute;
  top: -5px;
  right: -5px;
  background-color: var(--error);
  color: white;
  font-size: 0.75rem;
  font-weight: 600;
  height: 1.5rem;
  width: 1.5rem;
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow-sm);
  border: 2px solid white;
  transition: all 0.3s ease;
}

.chatbot-panel {
  margin-bottom: 1rem;
  width: 22rem;
  height: 36rem;
  border-radius: var(--radius-xl);
  background-color: var(--card-bg);
  box-shadow: var(--shadow-xl);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  border: 1px solid rgba(255, 255, 255, 0.2);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  visibility: hidden;
  opacity: 0;
  transform: translateY(20px) scale(0.95);
  transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.chatbot-panel.show-chat {
  visibility: visible;
  opacity: 1;
  transform: translateY(0) scale(1);
}

.chatbot-header {
  padding: 1.25rem;
  border-bottom: 1px solid rgba(226, 232, 240, 0.5);
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: linear-gradient(
    135deg,
    var(--primary) 0%,
    var(--primary-dark) 100%
  );
  color: white;
}

.header-content {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.avatar-container {
  position: relative;
}

.avatar {
  width: 2.5rem;
  height: 2.5rem;
  border-radius: var(--radius-full);
  background-color: rgba(255, 255, 255, 0.2);
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid rgba(255, 255, 255, 0.5);
}

.avatar i {
  font-size: 1.5rem;
}

.status-indicator {
  position: absolute;
  bottom: 0;
  right: 0;
  width: 0.75rem;
  height: 0.75rem;
  border-radius: var(--radius-full);
  background-color: var(--success);
  border: 2px solid white;
}

.header-text {
  display: flex;
  flex-direction: column;
}

.header-text h3 {
  font-size: 1.125rem;
  font-weight: 600;
  margin: 0;
}

.status {
  font-size: 0.75rem;
  opacity: 0.8;
}

.action-btn {
  background: none;
  border: none;
  color: inherit;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  border-radius: var(--radius-full);
  transition: all 0.2s ease;
}

.action-btn:hover {
  background-color: rgba(255, 255, 255, 0.2);
}

.chatbot-messages {
  flex: 1;
  overflow-y: auto;
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  scrollbar-width: thin;
  scrollbar-color: var(--border) transparent;
  background-color: rgba(248, 250, 252, 0.5);
  background-image: radial-gradient(
      circle at 25% 25%,
      rgba(8, 145, 178, 0.05) 0%,
      transparent 50%
    ),
    radial-gradient(
      circle at 75% 75%,
      rgba(8, 145, 178, 0.05) 0%,
      transparent 50%
    );
}

/* Custom scrollbar styles */
.chatbot-messages::-webkit-scrollbar {
  width: 6px;
}

.chatbot-messages::-webkit-scrollbar-track {
  background: transparent;
}

.chatbot-messages::-webkit-scrollbar-thumb {
  background-color: var(--border);
  border-radius: 20px;
}

.message-bubble {
  padding: 0.875rem 1.125rem;
  border-radius: var(--radius-lg);
  max-width: 85%;
  box-shadow: var(--shadow-sm);
  animation: fadeInUp 0.3s ease;
  position: relative;
  transition: transform 0.2s ease;
}

.message-bubble:hover {
  transform: translateY(-2px);
}

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.message-bubble p {
  margin: 0;
  font-size: 0.9375rem;
  line-height: 1.5;
}

.message-bot {
  background-color: white;
  color: var(--text-primary);
  border-top-left-radius: 0.25rem;
  align-self: flex-start;
  border-left: 3px solid rgba(154, 207, 140, 0.4);
}

.message-bot::before {
  content: "";
  position: absolute;
  left: -8px;
  top: 0;
  border-top: 8px solid white;
  border-left: 8px solid transparent;
}

.message-user {
  background: rgba(154, 207, 140, 0.4);
  color: white;
  margin-left: auto;
  border-top-right-radius: 0.25rem;
  align-self: flex-end;
}

.message-user::before {
  content: "";
  position: absolute;
  right: -8px;
  top: 0;
  border-top: 8px solid rgba(154, 207, 140, 0.4);
  border-right: 8px solid transparent;
}

.message-time {
  font-size: 0.6875rem;
  opacity: 0.7;
  margin-top: 0.375rem;
  display: block;
}

/* Chips styling */
.chips-container {
  display: flex;
  flex-wrap: wrap;
  gap: 0.625rem;
  margin: 0.75rem 0;
  align-self: flex-start;
  max-width: 90%;
  animation: fadeInUp 0.3s ease;
}

.chip {
  background-color: white;
  border: 1px solid var(--border);
  color: var(--primary);
  font-size: 0.8125rem;
  padding: 0.625rem 1rem;
  border-radius: var(--radius-full);
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: var(--shadow-sm);
  font-weight: 500;
  white-space: nowrap;
  text-overflow: ellipsis;
  overflow: hidden;
  position: relative;
  z-index: 1;
}

.chip::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(
    135deg,
    var(--primary-light) 0%,
    transparent 100%
  );
  border-radius: var(--radius-full);
  opacity: 0;
  z-index: -1;
  transition: opacity 0.2s ease;
}

.chip:hover {
  border-color: var(--primary);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.chip:hover::before {
  opacity: 1;
}

.chip:active {
  transform: translateY(0);
}

.typing-indicator {
  display: flex;
  gap: 0.25rem;
  padding: 0.75rem 1rem;
  width: auto;
  border-radius: var(--radius-lg);
  background-color: white;
  box-shadow: var(--shadow-sm);
  align-self: flex-start;
  margin-top: 0.5rem;
}

.typing-dot {
  height: 0.5rem;
  width: 0.5rem;
  border-radius: var(--radius-full);
  background-color: var(--primary);
  animation: typingPulse 1.5s infinite ease-in-out;
}

.typing-dot:nth-child(2) {
  animation-delay: 0.2s;
}

.typing-dot:nth-child(3) {
  animation-delay: 0.4s;
}

@keyframes typingPulse {
  0%,
  100% {
    opacity: 0.4;
    transform: scale(0.8);
  }
  50% {
    opacity: 1;
    transform: scale(1);
  }
}

.chatbot-input-container {
  padding: 1rem 1.25rem;
  border-top: 1px solid rgba(226, 232, 240, 0.5);
  display: flex;
  align-items: center;
  gap: 0.75rem;
  background-color: white;
}

.input-wrapper {
  flex: 1;
  position: relative;
  display: flex;
  align-items: center;
  background-color: var(--background);
  border-radius: var(--radius-full);
  border: 1px solid var(--border);
  transition: all 0.2s ease;
  overflow: hidden;
}

.input-wrapper:focus-within {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(8, 145, 178, 0.15);
}

.chatbot-input {
  flex: 1;
  border: none;
  background: transparent;
  padding: 0.75rem 1rem;
  outline: none;
  font-size: 0.9375rem;
}

.input-actions {
  display: flex;
  align-items: center;
  padding-right: 0.5rem;
}

.input-actions .action-btn {
  color: var(--text-light);
}

.input-actions .action-btn:hover {
  color: var(--primary);
  background-color: var(--primary-light);
}

.send-button {
  height: 2.75rem;
  width: 2.75rem;
  border-radius: var(--radius-full);
  background: linear-gradient(
    135deg,
    var(--primary) 0%,
    var(--primary-dark) 100%
  );
  color: white;
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: var(--shadow-md);
  position: relative;
  overflow: hidden;
}

.send-button::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: radial-gradient(
    circle at center,
    rgba(255, 255, 255, 0.3) 0%,
    transparent 70%
  );
  opacity: 0;
  transition: opacity 0.2s ease;
}

.send-button:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
}

.send-button:hover::before {
  opacity: 1;
}

.send-button:active {
  transform: scale(0.95);
}

.send-button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.send-button i {
  font-size: 1.25rem;
  transition: transform 0.2s ease;
}

.send-button:hover i {
  transform: translateX(2px);
}

/* Media Queries */
@media (min-width: 640px) {
  .chatbot-panel {
    width: 24rem;
  }
}

@media (max-width: 640px) {
  .page-content {
    padding: 1rem;
  }

  h1 {
    font-size: 2rem;
  }

  .buttons {
    flex-direction: column;
    gap: 0.75rem;
  }

  .chatbot-panel {
    position: fixed;
    bottom: 0;
    right: 0;
    width: 100%;
    height: 85vh;
    border-radius: var(--radius-xl) var(--radius-xl) 0 0;
    margin-bottom: 0;
  }

  .chips-container {
    max-width: 100%;
    overflow-x: auto;
    flex-wrap: nowrap;
    padding-bottom: 0.5rem;
    -webkit-overflow-scrolling: touch;
  }

  .chip {
    flex-shrink: 0;
  }
}
.message-user > p,
.message-user > span {
  color: black;
}
@keyframes pulseHighlight {
  0% {
    box-shadow: 0 0 0 0 rgba(72, 103, 170, 0.6);
  }
  70% {
    box-shadow: 0 0 0 10px rgba(77, 104, 163, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(78, 105, 164, 0);
  }
}

.pulsate {
  animation: pulseHighlight 1.5s infinite;
  border-color: #1e3565;
}
