/* aicoteacher-theme.css - Independent styles for Support Mission */

:root {
  /* BASE THEME - Copied from styles.css */
  --ev-bg: #f8fafc;
  --ev-bg-alt: #ffffff;
  --ev-card: #ffffff;
  --ev-text: #f1f5f9;
  --ev-muted: #64748b;
  --ev-accent: #18eddb;
  --ev-accent-alt: #2dd4ff;
  --ev-border-soft: #e2e8f0;
  --ev-radius-lg: 12px;
  --ev-radius-md: 8px;
  --ev-radius-pill: 999px;
  --ev-shadow-soft: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
  --ev-font: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
html, body {
  margin: 0;
  padding: 0;
  height: 100%;
  max-width: 100vw;
  overflow-x: hidden;
}

/* UTILS */
.hidden { display: none !important; }

/* CONTAINER & LAYOUT */
.ev-container {
  width: 100%;
  max-width: 1120px;
  margin: 0 auto;
  padding: 0 1.5rem;
}

.ev-logo { display: flex; align-items: center; gap: 0.8rem; }

/* BUTTONS - Copied from styles.css */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  font-family: var(--ev-font); font-weight: 600;
  padding: 0.6rem 1.2rem;
  border-radius: var(--ev-radius-md);
  border: none; cursor: pointer; text-decoration: none;
  transition: all 0.2s ease;
  font-size: 0.95rem;
}

.btn-primary {
  background: var(--ev-accent);
  color: black;
  box-shadow: 0 2px 4px rgba(37, 99, 235, 0.2);
}
.btn-primary:hover {
  background: var(--ev-accent-alt);
  transform: translateY(-1px);
}

.btn-ghost {
  background: transparent; color: var(--ev-muted);
}
.btn-ghost:hover {
  background: var(--ev-accent);
  color: black;
}

.btn-small { padding: 0.4rem 0.8rem; font-size: 0.85rem; }

/* CHAT BUBBLES - Copied from styles.css */
.chat-row { display: flex; margin-bottom: 0.8rem; }
.chat-row-left { justify-content: flex-start; }
.chat-row-right { justify-content: flex-end; }
.chat-bubble { max-width: 70%; padding: 0.6rem 1rem; border-radius: 12px; font-size: 0.95rem; line-height: 1.5; }

/* AI (Other) -> Dark Theme */
.chat-bubble-other {
  background: rgba(15, 23, 42, 0.8);
  border: 1px solid var(--ev-accent);
  color: white;
  border-bottom-left-radius: 2px;
}
/* User (Me) -> Cyan Theme */
.chat-bubble-me {
  background: var(--ev-accent);
  color: black;
  border-bottom-right-radius: 2px;
}

/* ========== SUPPORT PAGE SPECIFIC STYLES (Formerly Inline) ========== */
.rescue-body {
  background: radial-gradient(circle at top, #071531 0, #020712 55%);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  font-family: var(--ev-font); /* Ensure font is applied */
  color: var(--ev-text);
}

.rescue-header {
  background: rgba(2, 7, 18, 0.9);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--ev-border-soft);
  padding: 1rem 0;
  position: fixed; top: 0; left: 0; width: 100%; z-index: 1000;
  /* iOS Scroll Stability */
  transform: translateZ(0);
  will-change: transform;
}

.rescue-nav {
  display: flex; justify-content: space-between; align-items: center;
}

/* Header Helpers */
.logo-text {
  color: white;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 1px;
  font-size: 1.2rem;
}

.nav-actions {
  display: flex;
  gap: 0.8rem;
  align-items: center;
}

.nav-btn-feedback {
  padding: 0.8rem 1.2rem;
  font-size: 0.95rem;
  border-color: rgba(255, 255, 255, 0.15);
}

.nav-btn-cta {
  padding: 0.8rem 1.5rem;
  font-size: 1rem;
}

/* Toggle Short/Long CTA Text */
.cta-mobile { display: none; }

.rescue-main {
  flex: 1;
  padding: 6rem 0 3rem; /* Increased top padding for fixed header */
  width: 100%;
  max-width: 100vw;
  overflow-x: hidden;
}

.rescue-grid {
  display: grid;
  grid-template-columns: 1fr 300px;
  gap: 1.5rem;
  align-items: start;
}

/* CHAT AREA */
.rescue-chat-container {
  background: rgba(15, 23, 42, 0.6);
  border: 1px solid var(--ev-accent);
  backdrop-filter: blur(10px);
  border-radius: var(--ev-radius-lg);
  padding: 1.5rem;
  box-shadow: var(--ev-shadow-soft);
  display: flex; flex-direction: column;
  height: 600px; /* Fixed height for chat focus */
}

.rescue-chat-window {
  flex: 1;
  background: #020617;
  border: 1px solid rgba(15, 23, 42, 0.85);
  border-radius: 12px;
  padding: 1rem;
  overflow-y: auto;
  margin-bottom: 1rem;
  display: flex; flex-direction: column; gap: 0.8rem;
}

.rescue-chat-input-area {
  display: flex; gap: 0.8rem;
}

#btn-scan {
  margin-right: 0.5rem;
  background: #18eddb;
  color: black;
}

#btn-send {
  padding: 0 1.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

.rescue-input {
  flex: 1;
  background: #0f172a;
  border: 1px solid var(--ev-border-soft);
  border-radius: 99px;
  padding: 0.8rem 1.2rem;
  color: white;
  font-size: 0.95rem;
}
.rescue-input:disabled { opacity: 0.5; cursor: not-allowed; }

/* SIDEBAR WIDGETS */
.widget-card {
  background: rgba(15, 23, 42, 0.6);
  border: 1px solid var(--ev-border-soft);
  border-radius: var(--ev-radius-md);
  padding: 1rem;
  margin-bottom: 1rem;
}

.widget-title {
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--ev-muted);
  margin: 0 0 0.8rem;
  font-weight: 700;
  border-bottom: 1px solid rgba(255,255,255,0.1);
  padding-bottom: 0.5rem;
}

.live-feed-box {
  height: 250px;
  overflow-y: hidden; /* Prevent scrollbars, let JS handle flow */
  position: relative;
  display: flex;
  flex-direction: column;
}

.live-feed-content {
  /* Removed absolute positioning and animation for vertical list style */
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.feed-item {
  font-size: 0.8rem;
  color: white;
  line-height: 1.4;
  border-left: 2px solid var(--ev-accent-alt);
  padding: 0.6rem 0.5rem;
  background: rgba(31, 230, 168, 0.05);
  border-radius: 0 4px 4px 0;
  animation: fadeIn 0.5s ease-out;
}

.feed-item strong { color: white; }
.feed-meta { display: block; font-size: 0.7rem; color: var(--ev-muted); margin-top: 0.2rem; }

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

.trend-list {
  list-style: none; padding: 0; margin: 0;
  counter-reset: trend-rank;
}
.trend-item {
  font-size: 0.85rem;
  margin-bottom: 0.5rem;
  color: #e2e8f0;
  display: flex; align-items: center; gap: 0.5rem;
}
.trend-item::before {
  counter-increment: trend-rank;
  content: "#" counter(trend-rank);
  font-size: 0.8rem;
  color: var(--ev-accent);
  font-weight: bold;
  min-width: 20px;
}

/* Logo Blending */
.ev-logo img {
  /* mix-blend-mode: screen; REMOVED per user request */
}

.countdown-box {
  text-align: center;
  background: rgba(249, 115, 22, 0.1); /* Urgent Orange Tint */
  border: 1px solid rgba(249, 115, 22, 0.3);
}
.countdown-timer {
  font-size: 1.8rem;
  font-weight: 800;
  color: #f97316; /* Urgent Orange */
  margin: 0.5rem 0;
}
.countdown-label { font-size: 0.75rem; color: var(--ev-muted); }

/* MODAL OVERLAY (Lead Capture) */
.lead-modal-overlay {
  position: fixed; top: 0; left: 0; width: 100%; height: 100%;
  background: rgba(2, 6, 23, 0.95);
  z-index: 1000;
  display: flex; justify-content: center; align-items: center;
  backdrop-filter: blur(8px);
}
.lead-modal-overlay.hidden { display: none; }

.lead-modal {
  background: #0f172a;
  border: 1px solid var(--ev-accent);
  box-shadow: 0 0 50px rgba(31, 230, 168, 0.2);
  padding: 2.5rem;
  border-radius: 20px;
  width: 90%; max-width: 480px;
  text-align: center;
  position: relative;
}

.lead-modal h2 { margin-top: 0; color: var(--ev-accent); font-size: 1.8rem; }
.lead-modal p { color: var(--ev-muted); line-height: 1.6; margin-bottom: 1.5rem; }

.form-group { margin-bottom: 1rem; text-align: left; }
.form-group label { color: var(--ev-text); font-size: 0.85rem; margin-bottom: 0.4rem; display: block; }
.form-input {
  width: 100%; padding: 0.75rem;
  background: #020617; border: 1px solid #334155;
  border-radius: 8px; color: white;
}

.btn-urgent {
  background: linear-gradient(135deg, #f97316, #c2410c);
  color: white; width: 100%; padding: 1rem; font-size: 1.1rem;
  box-shadow: 0 10px 30px rgba(249, 115, 22, 0.4);
  border: none;
  cursor: pointer;
  border-radius: var(--ev-radius-md); /* Added radius for consistency */
  font-family: var(--ev-font);
}
.btn-urgent:hover { transform: translateY(-2px); box-shadow: 0 15px 40px rgba(249, 115, 22, 0.6); }

.limit-badge {
  display: none;
}

@media (max-width: 768px) {
  .ev-container { padding: 0 0.5rem; }
  .rescue-grid { grid-template-columns: 1fr; }
  .rescue-chat-container {
    height: 500px;
    padding: 0.5rem; /* Reduce padding to prevent cutoff */
    max-width: 100%;
  }
  .widget-card { margin-bottom: 0.5rem; }

  /* Mobile Header Fixes */
  .logo-text { display: none; }
  .nav-btn-feedback, .nav-btn-cta {
    padding: 0.5rem 0.8rem !important;
    font-size: 0.85rem !important;
  }
  .nav-actions { gap: 0.4rem; }

  /* Switch CTA text on mobile */
  .cta-desktop { display: none; }
  .cta-mobile { display: inline; }

  /* Chat Input Overflow Fixes */
  .rescue-chat-input-area {
    gap: 0.4rem;
  }

  .rescue-input {
    min-width: 0; /* Allow input to shrink below default width */
  }

  #btn-scan {
    margin-right: 0.2rem;
    padding: 0.4rem 0.6rem;
    font-size: 0.75rem;
  }

  #btn-send {
    padding: 0 0.6rem;
  }
}

/* ========== CUSTOM SCROLLBARS (NEON) ========== */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: var(--ev-accent);
  border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--ev-accent-alt);
  box-shadow: 0 0 5px var(--ev-accent);
}
