/* ==========================================================================
   Skilloratic AI Chatbot Widget Styles (css/chatbot.css)
   Ultra-Crisp, High-Contrast Modern Theme matching Skilloratic.com
   Guaranteed zero text clashing - all typography strictly scoped with high contrast
   ========================================================================== */

:root {
  --sk-primary: #2563EB;
  --sk-primary-dark: #1E40AF;
  --sk-primary-light: #EFF6FF;
  --sk-accent: #0284C7;
  --sk-accent-cyan: #38BDF8;
  
  /* Light Theme Defaults (Matches Skilloratic Light Theme) */
  --sk-win-bg: #F8FAFC;
  --sk-win-border: #E2E8F0;
  --sk-card-bg: #FFFFFF;
  --sk-card-border: #E2E8F0;
  --sk-text-main: #0F172A;
  --sk-text-muted: #475569;
  --sk-text-subtle: #64748B;
  
  /* Bot & User Bubbles */
  --sk-bot-bubble-bg: #FFFFFF;
  --sk-bot-bubble-border: #E2E8F0;
  --sk-bot-bubble-text: #0F172A;
  
  --sk-user-bubble-bg: linear-gradient(135deg, #2563EB 0%, #0284C7 100%);
  --sk-user-bubble-text: #FFFFFF;
}

/* Dark Theme Overrides (When site is in [data-theme="dark"]) */
[data-theme="dark"] {
  --sk-win-bg: #0F172A;
  --sk-win-border: rgba(255, 255, 255, 0.12);
  --sk-card-bg: #1E293B;
  --sk-card-border: rgba(255, 255, 255, 0.12);
  --sk-text-main: #F8FAFC;
  --sk-text-muted: #CBD5E1;
  --sk-text-subtle: #94A3B8;
  
  --sk-bot-bubble-bg: #1E293B;
  --sk-bot-bubble-border: rgba(255, 255, 255, 0.12);
  --sk-bot-bubble-text: #F8FAFC;
}

/* --------------------------------------------------------------------------
   1. Floating Trigger Button
   -------------------------------------------------------------------------- */
.sk-chat-toggle {
  position: fixed;
  bottom: 24px;
  right: 24px;
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: linear-gradient(135deg, #1E40AF 0%, #2563EB 55%, #0284C7 100%);
  color: #FFFFFF !important;
  border: 2px solid rgba(255, 255, 255, 0.35);
  box-shadow: 0 8px 24px rgba(37, 99, 235, 0.45);
  cursor: pointer;
  z-index: 99999;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 25px;
  transition: transform 0.25s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.25s ease;
  animation: skPulseGlow 3s infinite;
}

@keyframes skPulseGlow {
  0% { box-shadow: 0 0 0 0 rgba(37, 99, 235, 0.55), 0 8px 24px rgba(37, 99, 235, 0.4); }
  70% { box-shadow: 0 0 0 14px rgba(37, 99, 235, 0), 0 8px 24px rgba(37, 99, 235, 0.4); }
  100% { box-shadow: 0 0 0 0 rgba(37, 99, 235, 0), 0 8px 24px rgba(37, 99, 235, 0.4); }
}

.sk-chat-toggle:hover {
  transform: scale(1.08) translateY(-2px);
  box-shadow: 0 12px 30px rgba(37, 99, 235, 0.6);
}

.sk-chat-toggle .sk-unread-dot {
  position: absolute;
  top: 2px;
  right: 2px;
  width: 14px;
  height: 14px;
  background-color: #EF4444;
  border: 2px solid #FFFFFF;
  border-radius: 50%;
}

/* --------------------------------------------------------------------------
   2. Floating Teaser Greeting Pill
   -------------------------------------------------------------------------- */
.sk-teaser-pill {
  position: fixed;
  bottom: 34px;
  right: 94px;
  background: #FFFFFF;
  border: 1.5px solid #2563EB;
  color: #0F172A !important;
  padding: 8px 15px;
  border-radius: 30px;
  font-size: 13px;
  font-weight: 700;
  box-shadow: 0 8px 25px rgba(15, 23, 42, 0.15);
  cursor: pointer;
  z-index: 99999;
  display: flex;
  align-items: center;
  gap: 8px;
  transition: transform 0.2s, box-shadow 0.2s, border-color 0.2s;
  animation: skFadeIn 0.5s ease-out;
}

[data-theme="dark"] .sk-teaser-pill {
  background: #1E293B;
  border-color: #38BDF8;
  color: #FFFFFF !important;
}

.sk-teaser-pill:hover {
  transform: translateY(-2px);
  border-color: #1E40AF;
  box-shadow: 0 10px 30px rgba(37, 99, 235, 0.25);
}

@media (max-width: 600px) {
  .sk-teaser-pill { display: none; }
}

/* Ensure Back To Top doesn't overlap chat toggle */
#backToTop, .back-to-top {
  bottom: 96px !important;
  right: 30px !important;
  z-index: 99990 !important;
}

/* --------------------------------------------------------------------------
   3. Chat Drawer Window
   -------------------------------------------------------------------------- */
.sk-chat-window {
  position: fixed;
  bottom: 96px;
  right: 24px;
  width: 395px;
  max-width: calc(100vw - 32px);
  height: 590px;
  max-height: calc(100vh - 120px);
  background: var(--sk-win-bg);
  border: 1px solid var(--sk-win-border);
  border-radius: 20px;
  box-shadow: 0 20px 50px -10px rgba(15, 23, 42, 0.25), 0 0 1px rgba(0, 0, 0, 0.1);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  z-index: 99998;
  opacity: 0;
  pointer-events: none;
  transform: translateY(20px) scale(0.96);
  transition: opacity 0.25s cubic-bezier(0.16, 1, 0.3, 1), transform 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  font-family: 'Inter', system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

.sk-chat-window.sk-open {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0) scale(1);
}

/* --------------------------------------------------------------------------
   4. Chat Header
   -------------------------------------------------------------------------- */
.sk-chat-header {
  padding: 14px 18px;
  background: linear-gradient(135deg, #1E40AF 0%, #2563EB 55%, #0284C7 100%);
  border-bottom: 1px solid rgba(255, 255, 255, 0.15);
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: #FFFFFF !important;
}

.sk-chat-header-info {
  display: flex;
  align-items: center;
  gap: 12px;
}

.sk-chat-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.2);
  border: 1.5px solid rgba(255, 255, 255, 0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #FFFFFF !important;
  font-size: 19px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
  cursor: default;
  user-select: none;
}

.sk-chat-title {
  font-size: 15.5px;
  font-weight: 800;
  color: #FFFFFF !important;
  margin: 0;
  line-height: 1.2;
  letter-spacing: -0.01em;
}

.sk-chat-status {
  font-size: 11.5px;
  font-weight: 600;
  color: #BBF7D0 !important;
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 2px;
}

.sk-chat-status::before {
  content: '';
  width: 7px;
  height: 7px;
  background-color: #22C55E;
  border-radius: 50%;
  box-shadow: 0 0 6px #22C55E;
}

.sk-chat-close {
  background: rgba(255, 255, 255, 0.15);
  border: none;
  color: #FFFFFF !important;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  font-size: 15px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s, transform 0.2s;
}

.sk-chat-close:hover {
  background: rgba(255, 255, 255, 0.3);
  transform: scale(1.1);
}

/* --------------------------------------------------------------------------
   5. Chat Body & Messages
   -------------------------------------------------------------------------- */
.sk-chat-body {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  background: var(--sk-win-bg);
}

.sk-chat-body::-webkit-scrollbar {
  width: 5px;
}

.sk-chat-body::-webkit-scrollbar-thumb {
  background: rgba(148, 163, 184, 0.4);
  border-radius: 4px;
}

.sk-msg {
  max-width: 90%;
  display: flex;
  flex-direction: column;
  animation: skFadeIn 0.25s ease-out;
}

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

.sk-msg-bot {
  align-self: flex-start;
}

.sk-msg-user {
  align-self: flex-end;
}

/* Bubble Base */
.sk-bubble {
  padding: 12px 16px;
  border-radius: 16px;
  font-size: 13.5px;
  line-height: 1.55;
  word-break: break-word;
}

/* --------------------------------------------------------------------------
   CRITICAL CONTRAST FIX: Strict Typing Overrides Inside Bubbles
   -------------------------------------------------------------------------- */

/* Bot Message Bubble (Pure High-Contrast & Crisp Readability) */
.sk-msg-bot .sk-bubble {
  background: var(--sk-bot-bubble-bg) !important;
  color: var(--sk-bot-bubble-text) !important;
  border: 1px solid var(--sk-bot-bubble-border) !important;
  border-bottom-left-radius: 4px;
  box-shadow: 0 2px 10px rgba(15, 23, 42, 0.06);
}

/* Force ALL nested text elements in Bot Bubble to be visible */
.sk-msg-bot .sk-bubble p,
.sk-msg-bot .sk-bubble .sk-bubble-p,
.sk-msg-bot .sk-bubble span,
.sk-msg-bot .sk-bubble div,
.sk-msg-bot .sk-bubble li {
  color: var(--sk-bot-bubble-text) !important;
  margin: 4px 0 !important;
  line-height: 1.55 !important;
  font-size: 13.5px !important;
}

.sk-msg-bot .sk-bubble strong {
  color: #1E40AF !important;
  font-weight: 700 !important;
}

[data-theme="dark"] .sk-msg-bot .sk-bubble strong {
  color: #38BDF8 !important;
}

.sk-msg-bot .sk-bubble a {
  color: #2563EB !important;
  font-weight: 600 !important;
  text-decoration: underline !important;
}

[data-theme="dark"] .sk-msg-bot .sk-bubble a {
  color: #38BDF8 !important;
}

.sk-msg-bot .sk-bubble ul {
  margin: 6px 0 0 0;
  padding-left: 18px;
  color: var(--sk-bot-bubble-text) !important;
}

/* User Message Bubble */
.sk-msg-user .sk-bubble {
  background: var(--sk-user-bubble-bg) !important;
  color: #FFFFFF !important;
  border-bottom-right-radius: 4px;
  box-shadow: 0 4px 14px rgba(37, 99, 235, 0.3);
}

.sk-msg-user .sk-bubble p,
.sk-msg-user .sk-bubble span,
.sk-msg-user .sk-bubble strong {
  color: #FFFFFF !important;
  margin: 0 !important;
}

/* --------------------------------------------------------------------------
   6. Resource Cards (White/Slate Card with Royal Blue Badge)
   -------------------------------------------------------------------------- */
.sk-cards-container {
  display: flex;
  flex-direction: column;
  gap: 9px;
  margin-top: 10px;
}

.sk-res-card {
  background: var(--sk-card-bg) !important;
  border: 1.5px solid var(--sk-card-border) !important;
  border-radius: 12px;
  padding: 11px 13px;
  text-decoration: none !important;
  color: inherit !important;
  transition: border-color 0.2s, box-shadow 0.2s, transform 0.2s;
  display: block;
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.04);
}

.sk-res-card:hover {
  border-color: #2563EB !important;
  background: #FFFFFF !important;
  box-shadow: 0 8px 24px rgba(37, 99, 235, 0.14);
  transform: translateY(-2px);
}

[data-theme="dark"] .sk-res-card:hover {
  border-color: #38BDF8 !important;
  background: #1E293B !important;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
}

.sk-card-badge {
  font-size: 10.5px;
  text-transform: uppercase;
  font-weight: 800;
  letter-spacing: 0.03em;
  padding: 3px 8px;
  border-radius: 6px;
  background: #EFF6FF !important;
  color: #1D4ED8 !important;
  border: 1px solid #BFDBFE;
  display: inline-block;
  margin-bottom: 5px;
}

[data-theme="dark"] .sk-card-badge {
  background: rgba(56, 189, 248, 0.2) !important;
  color: #38BDF8 !important;
  border-color: rgba(56, 189, 248, 0.3);
}

.sk-card-title {
  font-size: 13.5px !important;
  font-weight: 700 !important;
  color: var(--sk-text-main) !important;
  margin: 0 0 5px 0 !important;
  line-height: 1.35 !important;
  transition: color 0.2s;
}

.sk-res-card:hover .sk-card-title {
  color: #2563EB !important;
}

[data-theme="dark"] .sk-res-card:hover .sk-card-title {
  color: #38BDF8 !important;
}

.sk-card-summary {
  font-size: 12px !important;
  color: var(--sk-text-muted) !important;
  margin: 0 0 7px 0 !important;
  line-height: 1.45 !important;
}

.sk-card-footer {
  font-size: 11px !important;
  font-weight: 500 !important;
  color: var(--sk-text-subtle) !important;
  display: flex;
  justify-content: space-between;
  padding-top: 4px;
  border-top: 1px dashed rgba(148, 163, 184, 0.25);
}

/* --------------------------------------------------------------------------
   7. Quick Reply Chips
   -------------------------------------------------------------------------- */
.sk-chips-container {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-top: 10px;
}

.sk-chip {
  background: #EFF6FF !important;
  border: 1px solid #BFDBFE !important;
  border-radius: 100px;
  padding: 6px 12px;
  color: #1E40AF !important;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  box-shadow: 0 1px 3px rgba(37, 99, 235, 0.08);
}

.sk-chip:hover {
  background: #2563EB !important;
  border-color: #2563EB !important;
  color: #FFFFFF !important;
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.3);
  transform: translateY(-1px);
}

[data-theme="dark"] .sk-chip {
  background: rgba(30, 41, 59, 0.9) !important;
  border-color: rgba(255, 255, 255, 0.15) !important;
  color: #E2E8F0 !important;
}

[data-theme="dark"] .sk-chip:hover {
  background: #38BDF8 !important;
  border-color: #38BDF8 !important;
  color: #0F172A !important;
}

/* --------------------------------------------------------------------------
   8. Thumbs Feedback Bar
   -------------------------------------------------------------------------- */
.sk-feedback-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 7px;
  font-size: 11.5px;
  color: var(--sk-text-subtle) !important;
}

.sk-fb-btn {
  background: #FFFFFF;
  border: 1px solid #CBD5E1;
  border-radius: 6px;
  color: #64748B;
  padding: 2px 7px;
  cursor: pointer;
  transition: all 0.2s;
}

[data-theme="dark"] .sk-fb-btn {
  background: #1E293B;
  border-color: rgba(255, 255, 255, 0.15);
  color: #94A3B8;
}

.sk-fb-btn:hover {
  color: #2563EB;
  border-color: #2563EB;
  background: #EFF6FF;
}

.sk-fb-btn.sk-active {
  color: #2563EB;
  border-color: #2563EB;
  background: #DBEAFE;
}

/* --------------------------------------------------------------------------
   9. Typing Indicator
   -------------------------------------------------------------------------- */
.sk-typing {
  display: flex;
  gap: 4px;
  padding: 10px 14px;
  background: var(--sk-bot-bubble-bg);
  border: 1px solid var(--sk-bot-bubble-border);
  border-radius: 16px;
}

.sk-typing-dot {
  width: 7px;
  height: 7px;
  background: #94A3B8;
  border-radius: 50%;
  animation: skBounce 1.2s infinite ease-in-out;
}

.sk-typing-dot:nth-child(2) { animation-delay: 0.2s; }
.sk-typing-dot:nth-child(3) { animation-delay: 0.4s; }

@keyframes skBounce {
  0%, 80%, 100% { transform: translateY(0); }
  40% { transform: translateY(-5px); background: #2563EB; }
}

/* --------------------------------------------------------------------------
   10. Input Footer Area
   -------------------------------------------------------------------------- */
.sk-chat-footer {
  padding: 13px 16px;
  background: #FFFFFF;
  border-top: 1px solid #E2E8F0;
}

[data-theme="dark"] .sk-chat-footer {
  background: #1E293B;
  border-top-color: rgba(255, 255, 255, 0.1);
}

.sk-chat-input-form {
  display: flex;
  align-items: center;
  gap: 10px;
}

.sk-chat-input {
  flex: 1;
  background: #F1F5F9;
  border: 1.5px solid #CBD5E1;
  border-radius: 24px;
  padding: 10px 16px;
  color: #0F172A !important;
  font-size: 13.5px;
  font-weight: 500;
  outline: none;
  transition: all 0.2s;
}

[data-theme="dark"] .sk-chat-input {
  background: #0F172A;
  border-color: rgba(255, 255, 255, 0.15);
  color: #FFFFFF !important;
}

.sk-chat-input:focus {
  background: #FFFFFF;
  border-color: #2563EB;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}

[data-theme="dark"] .sk-chat-input:focus {
  background: #0F172A;
  border-color: #38BDF8;
  box-shadow: 0 0 0 3px rgba(56, 189, 248, 0.2);
}

.sk-chat-input::placeholder {
  color: #94A3B8;
}

.sk-chat-send {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: linear-gradient(135deg, #1E40AF 0%, #2563EB 60%, #0284C7 100%);
  border: none;
  color: #FFFFFF !important;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.35);
  transition: transform 0.2s, box-shadow 0.2s;
}

.sk-chat-send:hover {
  transform: scale(1.06);
  box-shadow: 0 6px 18px rgba(37, 99, 235, 0.5);
}

/* --------------------------------------------------------------------------
   11. Mobile Fullscreen Mode
   -------------------------------------------------------------------------- */
@media (max-width: 480px) {
  .sk-chat-window {
    bottom: 0;
    right: 0;
    width: 100vw;
    height: 100vh;
    max-width: 100vw;
    max-height: 100vh;
    border-radius: 0;
  }
}

/* --------------------------------------------------------------------------
   12. Owner Mode Internal Styles (High Contrast)
   -------------------------------------------------------------------------- */
.sk-owner-box {
  background: #FFFBEB;
  border: 1.5px solid #F59E0B;
  border-radius: 12px;
  padding: 14px;
  margin-top: 6px;
  color: #78350F !important;
}

.sk-owner-box input {
  background: #FFFFFF;
  border: 1.5px solid #D97706;
  color: #0F172A !important;
  font-size: 13.5px;
  padding: 7px 12px;
  border-radius: 6px;
  outline: none;
  min-width: 0;
}

.sk-owner-box input:focus {
  border-color: #B45309;
}

.sk-owner-box button {
  white-space: nowrap !important;
  flex-shrink: 0 !important;
  padding: 7px 16px !important;
  font-weight: 600 !important;
  border-radius: 6px !important;
  background: #0284C7 !important;
  border: none !important;
  color: #FFFFFF !important;
  cursor: pointer;
  transition: background 0.15s;
}

.sk-owner-box button:hover {
  background: #0369A1 !important;
}

.sk-prop-diff-card {
  background: #F8FAFC;
  border: 1.5px solid #2563EB;
  border-radius: 12px;
  padding: 14px;
  margin-top: 8px;
  color: #0F172A !important;
  box-shadow: 0 4px 14px rgba(37, 99, 235, 0.1);
}

.sk-diff-table {
  background: #FFFFFF;
  border: 1px solid #E2E8F0;
  padding: 10px 12px;
  border-radius: 8px;
  font-family: monospace;
  font-size: 12px;
  color: #0F172A !important;
}

.sk-owner-chip {
  background: #FEF3C7 !important;
  border-color: #F59E0B !important;
  color: #92400E !important;
}

.sk-owner-chip:hover {
  background: #F59E0B !important;
  color: #FFFFFF !important;
}

.sk-header-admin-btn {
  background: #F59E0B;
  color: #FFFFFF !important;
  font-size: 11px;
  font-weight: 700;
  padding: 3px 9px;
  border-radius: 6px;
  text-decoration: none !important;
  display: inline-flex;
  align-items: center;
  margin-left: 8px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
  transition: background 0.15s, transform 0.1s;
}

.sk-header-admin-btn:hover {
  background: #D97706;
  color: #FFFFFF !important;
  transform: translateY(-1px);
}
