/* Someya AI - Modern, Dynamic, and Professional Chatbot UI */
@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@400;500;600;700;800&display=swap');

:root {
  --bpc-primary: #0a1931;
  --bpc-primary-light: #162c54;
  --bpc-primary-gradient: linear-gradient(135deg, #0a1931 0%, #1e3a6d 100%);
  --bpc-gold: #e5a93c;
  --bpc-gold-light: #fef5e7;
  --bpc-gold-border: #f2cb7c;
  --bpc-accent: #2563eb;
  --bpc-success: #10b981;
  --bpc-text-dark: #0f172a;
  --bpc-text-muted: #64748b;
  --bpc-bg-subtle: #f8fafc;
  --bpc-border: #e2e8f0;
  --bpc-shadow-lg: 0 20px 45px -10px rgba(10, 25, 49, 0.28), 0 10px 20px -8px rgba(10, 25, 49, 0.15);
  --bpc-shadow-sm: 0 2px 8px rgba(15, 23, 42, 0.05);
  --bpc-radius-panel: 20px;
  --bpc-radius-bubble: 16px;
}

.bpc-ai-widget {
  font-family: 'Plus Jakarta Sans', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  color: var(--bpc-text-dark);
  z-index: 999999;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Floating Launcher */
.bpc-ai-floating {
  position: fixed;
  right: 24px;
  bottom: 24px;
}

.bpc-ai-launcher {
  display: flex;
  align-items: center;
  gap: 10px;
  border: 1px solid rgba(229, 169, 60, 0.35);
  border-radius: 999px;
  padding: 10px 18px 10px 12px;
  background: var(--bpc-primary-gradient);
  color: #ffffff;
  box-shadow: 0 10px 30px rgba(10, 25, 49, 0.32), 0 4px 12px rgba(229, 169, 60, 0.2);
  font-family: inherit;
  font-size: 14px;
  font-weight: 650;
  letter-spacing: 0.2px;
  cursor: pointer;
  transition: all 0.28s cubic-bezier(0.16, 1, 0.3, 1);
  user-select: none;
}

.bpc-ai-launcher:hover {
  transform: translateY(-2px) scale(1.02);
  box-shadow: 0 14px 36px rgba(10, 25, 49, 0.38), 0 6px 18px rgba(229, 169, 60, 0.3);
  border-color: var(--bpc-gold);
}

.bpc-ai-launcher:active {
  transform: translateY(0) scale(0.98);
}

.bpc-ai-launcher-avatar {
  position: relative;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: #ffffff;
  padding: 2px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
}

.bpc-ai-launcher-avatar img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  border-radius: 50%;
}

.bpc-ai-launcher-ping {
  position: absolute;
  top: -1px;
  right: -1px;
  width: 9px;
  height: 9px;
  background: var(--bpc-success);
  border: 2px solid #ffffff;
  border-radius: 50%;
  box-shadow: 0 0 0 2px rgba(16, 185, 129, 0.3);
}

.bpc-ai-launcher-label {
  white-space: nowrap;
}

.bpc-ai-launcher-sparkle {
  color: var(--bpc-gold);
  font-size: 15px;
  margin-left: 2px;
  animation: bpcSparkle 2.5s infinite;
}

@keyframes bpcSparkle {
  0%, 100% { opacity: 0.8; transform: scale(1); }
  50% { opacity: 1; transform: scale(1.2); }
}

/* Chat Panel */
.bpc-ai-panel {
  display: flex;
  flex-direction: column;
  width: min(430px, calc(100vw - 24px));
  height: min(650px, calc(100vh - 90px));
  background: #ffffff;
  border: 1px solid var(--bpc-border);
  border-radius: var(--bpc-radius-panel);
  box-shadow: var(--bpc-shadow-lg);
  overflow: hidden;
  transition: transform 0.28s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.25s ease;
  transform-origin: bottom right;
}

.bpc-ai-floating .bpc-ai-panel {
  position: absolute;
  right: 0;
  bottom: 64px;
}

.bpc-ai-panel[hidden] {
  display: none;
  opacity: 0;
  transform: translateY(16px) scale(0.96);
}

/* Header */
.bpc-ai-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 13px 18px;
  background: var(--bpc-primary-gradient);
  color: #ffffff;
  border-bottom: 2.5px solid var(--bpc-gold);
  position: relative;
  z-index: 10;
}

.bpc-ai-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.bpc-ai-avatar {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 42px;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: #ffffff;
  border: 2px solid var(--bpc-gold);
  box-shadow: 0 3px 8px rgba(0, 0, 0, 0.18);
  overflow: visible;
}

.bpc-ai-avatar img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  border-radius: 50%;
}

.bpc-ai-status-indicator {
  position: absolute;
  bottom: 0px;
  right: 0px;
  width: 11px;
  height: 11px;
  border-radius: 50%;
  background: var(--bpc-success);
  border: 2px solid #0d1e3d;
  box-shadow: 0 0 8px rgba(16, 185, 129, 0.8);
}

.bpc-ai-heading {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.bpc-ai-title-row {
  display: flex;
  align-items: center;
  gap: 7px;
}

.bpc-ai-heading strong {
  font-size: 15px;
  font-weight: 750;
  letter-spacing: 0.2px;
  color: #ffffff;
}

.bpc-ai-badge {
  display: inline-flex;
  align-items: center;
  padding: 1.5px 6.5px;
  background: rgba(229, 169, 60, 0.22);
  border: 1px solid rgba(229, 169, 60, 0.6);
  border-radius: 999px;
  font-size: 9px;
  font-weight: 700;
  color: #fce7b8;
  letter-spacing: 0.3px;
  text-transform: uppercase;
}

.bpc-ai-heading small {
  font-size: 11px;
  color: #cbd5e1;
}

.bpc-ai-header-actions {
  display: flex;
  align-items: center;
  gap: 6px;
}

.bpc-ai-icon-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border: 0;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.12);
  color: #ffffff;
  font-size: 16px;
  line-height: 1;
  cursor: pointer;
  transition: all 0.2s ease;
}

.bpc-ai-icon-btn:hover {
  background: rgba(255, 255, 255, 0.25);
  color: #ffffff;
}

/* Persistent Programmes Quick Strip (Direct Under Header) */
.bpc-ai-quick-strip {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 7px 12px;
  background: #f1f5f9;
  border-bottom: 1px solid #e2e8f0;
  overflow-x: auto;
  white-space: nowrap;
  scrollbar-width: none;
  -ms-overflow-style: none;
  flex-shrink: 0;
}

.bpc-ai-quick-strip::-webkit-scrollbar {
  display: none;
}

.bpc-ai-strip-label {
  font-size: 10.5px;
  font-weight: 750;
  color: var(--bpc-primary);
  text-transform: uppercase;
  letter-spacing: 0.3px;
  flex-shrink: 0;
}

.bpc-ai-strip-scroll {
  display: flex;
  align-items: center;
  gap: 5px;
}

.bpc-ai-widget a.bpc-ai-strip-link {
  all: unset !important;
  box-sizing: border-box !important;
  display: inline-flex !important;
  align-items: center !important;
  gap: 3px !important;
  padding: 3px 9px !important;
  background: #ffffff !important;
  border: 1px solid #cbd5e1 !important;
  border-radius: 999px !important;
  color: var(--bpc-primary) !important;
  font-family: inherit !important;
  font-size: 11px !important;
  font-weight: 700 !important;
  text-decoration: none !important;
  cursor: pointer !important;
  transition: all 0.15s ease !important;
  white-space: nowrap !important;
  line-height: 1.2 !important;
  box-shadow: 0 1px 2px rgba(0,0,0,0.03) !important;
}

.bpc-ai-widget a.bpc-ai-strip-link:hover {
  background: var(--bpc-primary) !important;
  color: #fce7b8 !important;
  border-color: var(--bpc-gold) !important;
  transform: translateY(-1px) !important;
  box-shadow: 0 3px 8px rgba(10,25,49,0.15) !important;
}

/* Chat Messages Container */
.bpc-ai-messages {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 16px 14px 12px;
  background: var(--bpc-bg-subtle);
  display: flex;
  flex-direction: column;
  gap: 13px;
  scroll-behavior: smooth;
}

.bpc-ai-messages::-webkit-scrollbar {
  width: 5px;
}

.bpc-ai-messages::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: 4px;
}

/* Message Item */
.bpc-ai-message {
  max-width: 90%;
  font-size: 13px;
  line-height: 1.55;
  position: relative;
  word-break: break-word;
  animation: bpcFadeSlide 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

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

.bpc-ai-assistant-message {
  align-self: flex-start;
  background: #ffffff;
  border: 1px solid var(--bpc-border);
  border-radius: var(--bpc-radius-bubble) var(--bpc-radius-bubble) var(--bpc-radius-bubble) 4px;
  color: #1e293b;
  box-shadow: var(--bpc-shadow-sm);
  padding: 12px 14px;
}

.bpc-ai-user-message {
  align-self: flex-end;
  background: var(--bpc-primary-gradient);
  color: #ffffff;
  border-radius: var(--bpc-radius-bubble) var(--bpc-radius-bubble) 4px var(--bpc-radius-bubble);
  box-shadow: 0 3px 10px rgba(10, 25, 49, 0.2);
  padding: 10px 14px;
}

.bpc-ai-user-message .bpc-ai-message-content {
  color: #ffffff;
}

/* Greeting Lead */
.bpc-ai-greeting-lead {
  margin: 0 0 10px;
  padding: 10px 12px;
  border-radius: 8px;
  background: #edf4fe;
  color: var(--bpc-primary);
  font-size: 13px;
  line-height: 1.5;
  border-left: 3px solid var(--bpc-accent);
}

/* Rectangular Course Cards Section (Inside Welcome Card) */
.bpc-ai-courses-section {
  margin: 10px 0;
  padding: 10px 11px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
}

.bpc-ai-courses-title {
  margin-bottom: 7px;
}

.bpc-ai-courses-title span {
  display: block;
  font-size: 11.5px;
  font-weight: 750;
  color: var(--bpc-primary);
}

.bpc-ai-courses-title small {
  display: block;
  font-size: 10px;
  color: var(--bpc-text-muted);
  margin-top: 1px;
}

.bpc-ai-courses-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 5px;
}

.bpc-ai-widget a.bpc-ai-course-card {
  all: unset !important;
  box-sizing: border-box !important;
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  gap: 3px !important;
  padding: 5px 7px !important;
  background: #ffffff !important;
  border: 1px solid #cbd5e1 !important;
  border-radius: 6px !important;
  color: var(--bpc-primary) !important;
  font-family: inherit !important;
  font-size: 10.5px !important;
  font-weight: 700 !important;
  text-decoration: none !important;
  cursor: pointer !important;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04) !important;
  transition: all 0.18s cubic-bezier(0.16, 1, 0.3, 1) !important;
  line-height: 1.2 !important;
}

.bpc-ai-widget a.bpc-ai-course-card:hover {
  background: var(--bpc-primary) !important;
  color: #ffffff !important;
  border-color: var(--bpc-gold) !important;
  transform: translateY(-1.5px) !important;
  box-shadow: 0 3px 8px rgba(10, 25, 49, 0.16) !important;
}

.bpc-ai-course-icon {
  font-size: 12px;
  line-height: 1;
  flex-shrink: 0;
}

.bpc-ai-course-code {
  flex: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  letter-spacing: 0.2px;
  text-align: center;
}

.bpc-ai-course-ext {
  font-size: 8.5px;
  color: #94a3b8;
  flex-shrink: 0;
  transition: color 0.15s ease;
}

.bpc-ai-widget a.bpc-ai-course-card:hover .bpc-ai-course-ext {
  color: var(--bpc-gold) !important;
}

/* Training Note */
.bpc-ai-training-note {
  margin: 10px 0 0;
  padding: 8px 10px;
  border-left: 3px solid var(--bpc-gold);
  border-radius: 6px;
  background: var(--bpc-gold-light);
  color: #475569;
  font-size: 11.5px;
  line-height: 1.45;
}

.bpc-ai-training-note strong {
  color: #92400e;
}

/* Typing Indicator */
.bpc-ai-typing {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  background: #ffffff;
  border: 1px solid var(--bpc-border);
  border-radius: var(--bpc-radius-bubble) var(--bpc-radius-bubble) var(--bpc-radius-bubble) 4px;
  box-shadow: var(--bpc-shadow-sm);
  color: var(--bpc-text-muted);
  font-size: 12px;
  font-weight: 550;
  align-self: flex-start;
  animation: bpcFadeSlide 0.2s ease;
}

.bpc-ai-typing-dots {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.bpc-ai-dot {
  width: 5px;
  height: 5px;
  background: var(--bpc-gold);
  border-radius: 50%;
  animation: bpcDotPulse 1.4s infinite ease-in-out both;
}

.bpc-ai-dot:nth-child(1) { animation-delay: -0.32s; }
.bpc-ai-dot:nth-child(2) { animation-delay: -0.16s; }
.bpc-ai-dot:nth-child(3) { animation-delay: 0s; }

@keyframes bpcDotPulse {
  0%, 80%, 100% { transform: scale(0.6); opacity: 0.4; }
  40% { transform: scale(1.15); opacity: 1; background: var(--bpc-primary); }
}

/* Programme Card from answers */
.bpc-ai-programme-link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin: 10px 0 4px;
  padding: 9px 12px;
  border: 1px solid #cbd5e1;
  border-left: 3.5px solid var(--bpc-gold);
  border-radius: 8px;
  background: #f8fafc;
}

.bpc-ai-programme-link span {
  color: var(--bpc-primary);
  font-size: 12px;
  font-weight: 700;
}

.bpc-ai-programme-link a {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 4px 9px;
  background: var(--bpc-primary);
  color: #ffffff !important;
  font-size: 11px;
  font-weight: 650;
  border-radius: 5px;
  text-decoration: none !important;
  white-space: nowrap;
}

.bpc-ai-programme-link a:hover {
  background: var(--bpc-primary-light);
}

/* Sources */
.bpc-ai-sources {
  margin-top: 8px;
  padding-top: 6px;
  border-top: 1px solid #e2e8f0;
  font-size: 11.5px;
}

.bpc-ai-sources strong {
  display: block;
  margin-bottom: 4px;
  color: var(--bpc-text-muted);
  font-size: 10px;
  text-transform: uppercase;
}

.bpc-ai-sources a {
  display: block;
  margin: 2px 0;
  color: var(--bpc-accent);
  text-decoration: none;
}

/* Tables */
.bpc-ai-table-wrap {
  display: block;
  width: 100%;
  max-width: 100%;
  margin: 10px 0;
  overflow-x: auto;
  border: 1px solid #d5deeb;
  border-radius: 8px;
  background: #ffffff;
}

.bpc-ai-message-content table.bpc-ai-answer-table {
  border-collapse: separate;
  border-spacing: 0;
  width: 100%;
  min-width: 380px;
  font-size: 12px;
  line-height: 1.5;
}

.bpc-ai-message-content .bpc-ai-answer-table th {
  padding: 8px 11px;
  text-align: left;
  background: var(--bpc-primary);
  color: #ffffff;
  font-weight: 700;
  border-right: 1px solid #1e3a6d;
  border-bottom: 1px solid #1e3a6d;
}

.bpc-ai-message-content .bpc-ai-answer-table td {
  padding: 8px 11px;
  text-align: left;
  border-right: 1px solid #e2e8f0;
  border-bottom: 1px solid #e2e8f0;
  background: #ffffff;
  color: #334155;
}

.bpc-ai-message-content .bpc-ai-answer-table tbody tr:nth-child(even) td {
  background: #f8fafc;
}

/* Citations */
.bpc-ai-message-content a.bpc-ai-citation {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  margin: 0 2px;
  padding: 1px 6px;
  border-radius: 999px;
  background: #eef2ff;
  color: var(--bpc-accent) !important;
  font-size: 11px;
  font-weight: 650;
  text-decoration: none !important;
  border: 1px solid #c7d2fe;
}

/* Feedback Row */
.bpc-ai-feedback {
  margin: 8px 0 2px 2px;
  font-size: 12px;
  color: #64748b;
  padding: 6px 10px;
  background: #f8fafc;
  border: 1px dashed #cbd5e1;
  border-radius: 6px;
}

.bpc-ai-feedback-actions {
  display: flex;
  gap: 6px;
  margin-top: 5px;
  flex-wrap: wrap;
}

.bpc-ai-feedback-btn {
  border: 1px solid #cbd5e1;
  border-radius: 999px;
  padding: 3px 10px;
  background: #ffffff;
  color: var(--bpc-primary);
  font-family: inherit;
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
}

.bpc-ai-feedback-btn:hover {
  background: #f1f5f9;
  border-color: var(--bpc-gold);
}

/* Form & Input Area */
.bpc-ai-form {
  padding: 10px 12px 8px;
  border-top: 1px solid var(--bpc-border);
  background: #ffffff;
}

.bpc-ai-input-wrap {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  border: 1.5px solid #cbd5e1;
  border-radius: 12px;
  padding: 6px 9px;
  background: #ffffff;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.bpc-ai-input-wrap:focus-within {
  border-color: var(--bpc-accent);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
}

.bpc-ai-input {
  flex: 1;
  border: 0;
  padding: 2px 4px;
  margin: 0;
  background: transparent;
  color: var(--bpc-text-dark);
  font-family: inherit;
  font-size: 13px;
  line-height: 1.45;
  resize: none;
  max-height: 95px;
  min-height: 22px;
  outline: none;
}

.bpc-ai-input::placeholder {
  color: #94a3b8;
}

.bpc-ai-send {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border: 0;
  border-radius: 7px;
  background: var(--bpc-primary-gradient);
  color: #ffffff;
  cursor: pointer;
  flex-shrink: 0;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.bpc-ai-send:hover:not(:disabled) {
  background: linear-gradient(135deg, #162c54 0%, #2563eb 100%);
  transform: scale(1.05);
}

.bpc-ai-send:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.bpc-ai-send svg {
  width: 15px;
  height: 15px;
}

.bpc-ai-form-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 6px;
  padding: 0 2px;
}

.bpc-ai-form-bottom small {
  color: #94a3b8;
  font-size: 10px;
}

.bpc-ai-footer {
  padding: 4px 12px 7px;
  background: #ffffff;
  text-align: center;
  color: #94a3b8;
  font-size: 9.5px;
  font-weight: 500;
  border-top: 1px solid #f1f5f9;
}

/* Embedded shortcode style */
.bpc-ai-embedded {
  width: 100%;
  max-width: 850px;
  margin: 20px auto;
}

.bpc-ai-embedded .bpc-ai-panel {
  width: 100%;
  height: 680px;
  max-height: 82vh;
}

/* Mobile Responsive */
@media (max-width: 600px) {
  .bpc-ai-floating {
    right: 12px;
    bottom: 12px;
  }
  .bpc-ai-panel {
    width: calc(100vw - 24px);
    height: min(78vh, 590px);
  }
  .bpc-ai-floating .bpc-ai-panel {
    right: -2px;
    bottom: 56px;
  }
  .bpc-ai-courses-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}
