/* BuscoColegio AI School Advisor Widget Styles */
:root {
  --bc-primary: #007bff;
  --bc-primary-hover: #0056b3;
  --bc-secondary: #28a745;
  --bc-bg-light: #f8f9fa;
  --bc-text: #2c3e50;
  --bc-text-muted: #6c757d;
  --bc-border: #e9ecef;
  --bc-card-bg: #ffffff;
  --bc-shadow: 0 8px 30px rgba(0, 0, 0, 0.15);
}

#bc-chat-launcher {
  position: fixed;
  bottom: 24px;
  right: 24px;
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: linear-gradient(135deg, #007bff, #0056b3);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 4px 15px rgba(0, 123, 255, 0.4);
  z-index: 999999;
  transition: transform 0.25s cubic-bezier(0.175, 0.885, 0.32, 1.275), box-shadow 0.2s;
  border: none;
  outline: none;
}

#bc-chat-launcher:hover {
  transform: scale(1.08);
  box-shadow: 0 6px 20px rgba(0, 123, 255, 0.55);
}

#bc-chat-launcher svg {
  width: 30px;
  height: 30px;
  fill: currentColor;
}

#bc-chat-container {
  position: fixed;
  bottom: 96px;
  right: 24px;
  width: 380px;
  height: 580px;
  max-width: calc(100vw - 32px);
  max-height: calc(100vh - 120px);
  background: #ffffff;
  border-radius: 16px;
  box-shadow: var(--bc-shadow);
  display: none;
  flex-direction: column;
  overflow: hidden;
  z-index: 999999;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  border: 1px solid rgba(0, 0, 0, 0.08);
  animation: bcSlideUp 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes bcSlideUp {
  from {
    opacity: 0;
    transform: translateY(20px) scale(0.96);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

#bc-chat-header {
  flex-shrink: 0;
  background: linear-gradient(135deg, #007bff, #0056b3);
  color: #ffffff;
  padding: 14px 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

#bc-chat-header .bc-title-wrapper {
  display: flex;
  align-items: center;
  gap: 10px;
}

#bc-chat-header .bc-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.2);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
}

#bc-chat-header h3 {
  margin: 0;
  font-size: 15px;
  font-weight: 600;
  letter-spacing: -0.2px;
  color: #ffffff !important;
}

#bc-chat-header p {
  margin: 2px 0 0 0;
  font-size: 11px;
  color: #ffffff !important;
  opacity: 1 !important;
}

#bc-chat-close {
  background: transparent;
  border: none;
  color: #fff;
  cursor: pointer;
  padding: 4px;
  border-radius: 50%;
  opacity: 0.85;
  transition: opacity 0.2s;
}

#bc-chat-close:hover {
  opacity: 1;
}

#bc-chat-messages {
  flex: 1 1 0%;
  min-height: 0;
  height: 0;
  padding: 16px;
  overflow-y: auto !important;
  overflow-x: hidden;
  background: #f8fafc;
  display: flex;
  flex-direction: column;
  gap: 12px;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
}

#bc-chat-messages::-webkit-scrollbar {
  width: 6px;
}

#bc-chat-messages::-webkit-scrollbar-track {
  background: transparent;
}

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

#bc-chat-messages::-webkit-scrollbar-thumb:hover {
  background: #94a3b8;
}

.bc-msg {
  max-width: 88%;
  font-size: 13.5px;
  line-height: 1.45;
  word-break: break-word;
}

.bc-msg.user {
  align-self: flex-end;
  background: #007bff;
  color: #ffffff;
  padding: 10px 14px;
  border-radius: 14px 14px 2px 14px;
}

.bc-msg.assistant {
  align-self: flex-start;
  background: #ffffff;
  color: var(--bc-text);
  padding: 12px 14px;
  border-radius: 14px 14px 14px 2px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
  border: 1px solid #edf2f7;
}

.bc-msg p {
  margin: 0 0 8px 0;
}
.bc-msg p:last-child {
  margin-bottom: 0;
}

.bc-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 6px;
}

.bc-chip {
  background: #ffffff;
  border: 1px solid #cbd5e1;
  border-radius: 12px;
  padding: 6px 10px;
  font-size: 11.5px;
  color: #007bff;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
}

.bc-chip:hover {
  background: #f0f7ff;
  border-color: #007bff;
}

/* School Cards in Chat */
.bc-school-cards {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 8px;
}

.bc-pagination-info {
  font-size: 11px;
  color: #64748b;
  background: #f1f5f9;
  padding: 4px 10px;
  border-radius: 6px;
  margin-bottom: 2px;
  align-self: flex-start;
  border: 1px solid #e2e8f0;
}

.bc-has-more-box {
  background: #f8fafc;
  border: 1px dashed #cbd5e1;
  border-radius: 8px;
  padding: 8px 10px;
  font-size: 11.5px;
  color: var(--bc-text);
  display: flex;
  flex-direction: column;
  gap: 6px;
  align-items: flex-start;
  margin-top: 4px;
}

.bc-more-btn {
  background: #007bff;
  color: #ffffff;
  border: none;
  border-radius: 6px;
  padding: 6px 12px;
  font-size: 11px;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.15s, transform 0.1s;
}

.bc-more-btn:hover {
  background: #0056b3;
  transform: translateY(-1px);
}

.bc-card {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  padding: 10px 12px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.04);
  transition: border-color 0.2s, box-shadow 0.2s;
}

.bc-card:hover {
  border-color: #007bff;
  box-shadow: 0 3px 8px rgba(0,123,255,0.12);
}

.bc-card-title {
  font-size: 13px;
  font-weight: 600;
  color: #1e293b;
  margin-bottom: 4px;
  text-decoration: none;
  display: block;
}

.bc-card-title:hover {
  color: #007bff;
}

.bc-card-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-bottom: 6px;
}

.bc-badge {
  font-size: 10px;
  font-weight: 600;
  padding: 2px 6px;
  border-radius: 4px;
  text-transform: uppercase;
}

.bc-badge.publico { background: #e0f2fe; color: #0369a1; }
.bc-badge.concertado { background: #fef3c7; color: #b45309; }
.bc-badge.privado { background: #f3e8ff; color: #7e22ce; }
.bc-badge.bilingue { background: #dcfce7; color: #15803d; }
.bc-badge.evau { background: #fee2e2; color: #b91c1c; }
.bc-badge.valoracion { background: #fef9c3; color: #854d0e; }
.bc-badge.docente { background: #e0e7ff; color: #4338ca; }

.bc-card-info {
  font-size: 11px;
  color: #64748b;
  line-height: 1.35;
}

.bc-card-btn {
  display: inline-block;
  margin-top: 6px;
  font-size: 11px;
  color: #007bff;
  font-weight: 600;
  text-decoration: none;
}

.bc-card-btn:hover {
  text-decoration: underline;
}

#bc-chat-input-area {
  flex-shrink: 0;
  padding: 10px 14px;
  background: #ffffff;
  border-top: 1px solid #edf2f7;
  display: flex;
  gap: 8px;
  align-items: center;
}

#bc-chat-input {
  flex: 1;
  border: 1px solid #cbd5e1;
  border-radius: 20px;
  padding: 8px 14px;
  font-size: 13px;
  outline: none;
  transition: border-color 0.2s;
}

#bc-chat-input:focus {
  border-color: #007bff;
}

#bc-chat-send {
  background: #007bff;
  border: none;
  color: #fff;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 0.2s;
}

#bc-chat-send:hover {
  background: #0056b3;
}

#bc-chat-send svg {
  width: 16px;
  height: 16px;
  fill: currentColor;
}

/* Floating button to return to bottom */
#bc-scroll-bottom-btn {
  position: absolute;
  bottom: 66px;
  right: 18px;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: #007bff;
  color: #ffffff;
  border: 1px solid rgba(255, 255, 255, 0.4);
  box-shadow: 0 4px 12px rgba(0, 123, 255, 0.35);
  display: none;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 10;
  transition: transform 0.15s, background-color 0.15s, opacity 0.2s;
}

#bc-scroll-bottom-btn:hover {
  background: #0056b3;
  transform: scale(1.1);
}

/* Mobile responsiveness */
@media (max-width: 480px) {
  #bc-chat-container {
    bottom: 0;
    right: 0;
    width: 100vw;
    height: 100vh;
    max-width: 100vw;
    max-height: 100vh;
    border-radius: 0;
  }
}
