/*
 * ═══════════════════════════════════════════════════════════════════════════
 * BacAI — Demo Chat Styles v1.0
 * Modern, clean design dedicat paginii de demo
 * ═══════════════════════════════════════════════════════════════════════════
 */

/* ═══════════════════════════════════════════════════════════════════════════
   PAGE LAYOUT
   ═══════════════════════════════════════════════════════════════════════════ */

.demo-page {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.demo-main {
  flex: 1;
  padding: 90px 24px 40px;
}

.demo-container {
  max-width: 1400px;
  margin: 0 auto;
}

/* ═══════════════════════════════════════════════════════════════════════════
   DEMO HEADER
   ═══════════════════════════════════════════════════════════════════════════ */

.demo-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 32px;
  padding: 24px 32px;
  background: linear-gradient(135deg, rgba(139, 92, 246, 0.08), rgba(0, 212, 255, 0.05));
  border: 1px solid rgba(139, 92, 246, 0.15);
  border-radius: 20px;
}

.demo-title {
  display: flex;
  align-items: center;
  gap: 16px;
}

.demo-icon {
  font-size: 48px;
  animation: iconFloat 3s ease-in-out infinite;
}

@keyframes iconFloat {
  0%, 100% { transform: translateY(0) rotate(-5deg); }
  50% { transform: translateY(-8px) rotate(5deg); }
}

.demo-title h1 {
  font-family: var(--font-display);
  font-size: 28px;
  font-weight: 700;
  margin: 0;
  background: var(--gradient-primary);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.demo-subtitle {
  font-size: 14px;
  color: var(--text-secondary);
  margin: 4px 0 0;
}

.demo-counter-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}

.demo-counter {
  font-family: var(--font-display);
  font-size: 32px;
  font-weight: 700;
  color: var(--accent-green);
}

.demo-counter-label {
  font-size: 12px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* Counter states */
.demo-counter.low {
  color: var(--accent-orange);
}

.demo-counter.critical {
  color: #ef4444;
  animation: pulse 1.5s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.7; transform: scale(1.05); }
}

/* ═══════════════════════════════════════════════════════════════════════════
   CHAT WRAPPER (2 columns)
   ═══════════════════════════════════════════════════════════════════════════ */

.demo-chat-wrapper {
  display: grid;
  grid-template-columns: 1fr 320px;
  gap: 24px;
  align-items: start;
}

/* ═══════════════════════════════════════════════════════════════════════════
   MAIN CHAT CONTAINER
   ═══════════════════════════════════════════════════════════════════════════ */

.demo-chat {
  background: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: 24px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  height: calc(100vh - 220px);
  min-height: 600px;
  box-shadow: 
    0 4px 24px rgba(0, 0, 0, 0.2),
    0 0 0 1px rgba(255, 255, 255, 0.03) inset;
}

/* Chat Header */
.chat-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 16px 24px;
  background: rgba(0, 0, 0, 0.2);
  border-bottom: 1px solid var(--border-subtle);
}

.chat-header-left {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}

.subject-selector {
  display: flex;
  align-items: center;
  gap: 10px;
}

.subject-selector label {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-muted);
}

.subject-selector select {
  padding: 8px 14px;
  font-family: inherit;
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
  background: var(--bg-primary);
  border: 1px solid var(--border-medium);
  border-radius: 10px;
  cursor: pointer;
  transition: var(--transition-fast);
}

.subject-selector select:hover {
  border-color: var(--border-strong);
}

.subject-selector select:focus {
  outline: none;
  border-color: var(--accent-cyan);
  box-shadow: 0 0 0 3px rgba(0, 212, 255, 0.15);
}

.coming-soon-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  font-size: 11px;
  font-weight: 600;
  color: var(--accent-cyan);
  background: rgba(0, 212, 255, 0.1);
  border: 1px solid rgba(0, 212, 255, 0.2);
  border-radius: 20px;
}

.chat-status {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: var(--text-muted);
}

.status-dot {
  width: 8px;
  height: 8px;
  background: var(--accent-green);
  border-radius: 50%;
  animation: statusPulse 2s ease-in-out infinite;
}

@keyframes statusPulse {
  0%, 100% { opacity: 1; box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.4); }
  50% { opacity: 0.8; box-shadow: 0 0 0 6px rgba(16, 185, 129, 0); }
}

/* Chat Body - Messages Area */
.chat-body {
  flex: 1;
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

#chat-messages {
  flex: 1;
  min-height: 500px;
  padding: 24px;
  overflow-y: auto;
  overflow-x: hidden;
  display: flex;
  flex-direction: column;
  gap: 16px;
  background: 
    radial-gradient(ellipse at 0% 0%, rgba(0, 212, 255, 0.03) 0%, transparent 50%),
    radial-gradient(ellipse at 100% 100%, rgba(139, 92, 246, 0.03) 0%, transparent 50%),
    var(--bg-primary);
}

/* Custom Scrollbar - Always visible */
#chat-messages::-webkit-scrollbar {
  width: 8px;
}

#chat-messages::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.03);
  border-radius: 10px;
  margin: 8px 0;
}

#chat-messages::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.15);
  border-radius: 10px;
  border: 2px solid transparent;
  background-clip: padding-box;
}

#chat-messages::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.25);
  border: 2px solid transparent;
  background-clip: padding-box;
}

/* Firefox scrollbar */
#chat-messages {
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.15) rgba(255, 255, 255, 0.03);
}

/* Messages */
.msg {
  max-width: 75%;
  padding: 14px 18px;
  border-radius: 18px;
  line-height: 1.6;
  animation: messageSlide 0.3s ease;
}

@keyframes messageSlide {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}

.msg.user {
  align-self: flex-end;
  background: var(--gradient-primary);
  color: #ffffff;
  border-radius: 18px 18px 4px 18px;
  box-shadow: 0 4px 20px rgba(139, 92, 246, 0.25);
}

.msg.bot {
  align-self: flex-start;
  background: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
  color: var(--text-primary);
  border-radius: 18px 18px 18px 4px;
}

/* Dropzone */
#dropzone {
  position: absolute;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  background: rgba(0, 212, 255, 0.08);
  border: 3px dashed rgba(0, 212, 255, 0.4);
  border-radius: 20px;
  z-index: 100;
  backdrop-filter: blur(8px);
}

#dropzone.active {
  display: flex;
}

.dropzone-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  padding: 40px 60px;
  background: rgba(10, 14, 23, 0.95);
  border: 1px solid rgba(0, 212, 255, 0.3);
  border-radius: 20px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}

.dropzone-icon {
  font-size: 48px;
  animation: bounce 1s ease infinite;
}

@keyframes bounce {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-10px); }
}

.dropzone-text {
  font-size: 18px;
  font-weight: 700;
  color: var(--text-primary);
}

.dropzone-hint {
  font-size: 13px;
  color: var(--text-muted);
}

/* Chat Input Area */
.chat-input-wrapper {
  padding: 16px 20px 20px;
  background: rgba(0, 0, 0, 0.15);
  border-top: 1px solid var(--border-subtle);
}

#attach-tray {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  padding: 12px;
  margin-bottom: 12px;
  background: rgba(0, 0, 0, 0.2);
  border: 1px solid var(--border-subtle);
  border-radius: 14px;
}

#attach-tray.hidden {
  display: none;
}

.chat-input-container {
  display: flex;
  align-items: flex-end;
  gap: 12px;
  padding: 8px;
  background: var(--bg-primary);
  border: 2px solid var(--border-medium);
  border-radius: 16px;
  transition: var(--transition-fast);
}

.chat-input-container:focus-within {
  border-color: var(--accent-cyan);
  box-shadow: 0 0 0 4px rgba(0, 212, 255, 0.1);
}

.btn-attach {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  background: transparent;
  border: none;
  border-radius: 10px;
  color: var(--text-muted);
  cursor: pointer;
  transition: var(--transition-fast);
  flex-shrink: 0;
}

.btn-attach:hover {
  color: var(--accent-cyan);
  background: rgba(0, 212, 255, 0.1);
}

.btn-attach svg {
  width: 20px;
  height: 20px;
}

#chat-input {
  flex: 1;
  min-height: 40px;
  max-height: 120px;
  padding: 8px 4px;
  font-family: inherit;
  font-size: 15px;
  line-height: 1.5;
  color: var(--text-primary);
  background: transparent;
  border: none;
  resize: none;
}

#chat-input::placeholder {
  color: var(--text-muted);
}

#chat-input:focus {
  outline: none;
}

.btn-send {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  background: var(--gradient-cta);
  border: none;
  border-radius: 12px;
  color: #ffffff;
  cursor: pointer;
  transition: var(--transition-fast);
  flex-shrink: 0;
}

.btn-send:hover {
  transform: scale(1.05);
  box-shadow: 0 4px 20px rgba(139, 92, 246, 0.4);
}

.btn-send:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}

.btn-send svg {
  width: 20px;
  height: 20px;
}

.input-hint {
  margin: 12px 0 0;
  font-size: 12px;
  color: var(--text-muted);
  text-align: center;
}

.input-hint strong {
  color: var(--accent-cyan);
}

/* ═══════════════════════════════════════════════════════════════════════════
   SIDEBAR
   ═══════════════════════════════════════════════════════════════════════════ */

.demo-sidebar {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.sidebar-section {
  padding: 20px;
  background: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: 20px;
}

.sidebar-section h3 {
  font-family: var(--font-display);
  font-size: 16px;
  font-weight: 700;
  margin: 0 0 4px;
  color: var(--text-primary);
}

.sidebar-hint {
  font-size: 12px;
  color: var(--text-muted);
  margin: 0 0 16px;
}

/* Quick Questions */
.quick-questions-grid {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.qbtn {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 12px 14px;
  text-align: left;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary);
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border-subtle);
  border-radius: 12px;
  cursor: pointer;
  transition: var(--transition-fast);
}

.qbtn:hover {
  color: var(--text-primary);
  background: rgba(0, 212, 255, 0.05);
  border-color: rgba(0, 212, 255, 0.2);
  transform: translateX(4px);
}

.qbtn-emoji {
  font-size: 18px;
  flex-shrink: 0;
}

/* Sidebar CTA */
.sidebar-cta {
  background: linear-gradient(135deg, rgba(139, 92, 246, 0.1), rgba(236, 72, 153, 0.05));
  border-color: rgba(139, 92, 246, 0.2);
}

.cta-content {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 16px;
}

.cta-emoji {
  font-size: 28px;
}

.cta-content strong {
  display: block;
  font-size: 14px;
  color: var(--text-primary);
  margin-bottom: 4px;
}

.cta-content p {
  font-size: 12px;
  color: var(--text-muted);
  margin: 0;
  line-height: 1.5;
}

.btn-sm {
  padding: 10px 20px;
  font-size: 13px;
  width: 100%;
}

/* Coming Soon Box */
.coming-soon-box {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  background: linear-gradient(135deg, rgba(0, 212, 255, 0.05), rgba(139, 92, 246, 0.03));
  border-color: rgba(0, 212, 255, 0.15);
}

.coming-icon {
  font-size: 24px;
  animation: rocketFloat 2s ease-in-out infinite;
}

@keyframes rocketFloat {
  0%, 100% { transform: translateY(0) rotate(-10deg); }
  50% { transform: translateY(-4px) rotate(-5deg); }
}

.coming-soon-box strong {
  display: block;
  font-size: 13px;
  color: var(--text-primary);
  margin-bottom: 4px;
}

.coming-soon-box p {
  font-size: 11px;
  color: var(--text-muted);
  margin: 0;
  line-height: 1.5;
}

/* ═══════════════════════════════════════════════════════════════════════════
   NAV ACTIVE STATE
   ═══════════════════════════════════════════════════════════════════════════ */

nav a.active {
  color: var(--accent-cyan);
  background: rgba(0, 212, 255, 0.1);
}

nav a.active::after {
  width: 20px;
  background: var(--accent-cyan);
}

/* ═══════════════════════════════════════════════════════════════════════════
   RESPONSIVE
   ═══════════════════════════════════════════════════════════════════════════ */

@media (max-width: 1024px) {
  .demo-chat-wrapper {
    grid-template-columns: 1fr;
  }
  
  .demo-sidebar {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
  }
  
  .sidebar-section:first-child {
    grid-column: 1 / -1;
  }
  
  .quick-questions-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 768px) {
  .demo-main {
    padding: 90px 16px 40px;
  }
  
  .demo-header {
    flex-direction: column;
    text-align: center;
    padding: 20px;
  }
  
  .demo-title {
    flex-direction: column;
    gap: 12px;
  }
  
  .demo-icon {
    font-size: 40px;
  }
  
  .demo-title h1 {
    font-size: 24px;
  }
  
  .demo-sidebar {
    grid-template-columns: 1fr;
  }
  
  .quick-questions-grid {
    grid-template-columns: 1fr;
  }
  
  .chat-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
  }
  
  .chat-header-left {
    width: 100%;
    justify-content: space-between;
  }
  
  .coming-soon-pill {
    display: none;
  }
  
  .demo-chat {
    height: auto;
    min-height: 500px;
    max-height: none;
  }
  
  #chat-messages {
    min-height: 400px;
  }
}

@media (max-width: 480px) {
  .demo-counter {
    font-size: 28px;
  }
  
  .subject-selector {
    flex-direction: column;
    align-items: flex-start;
    gap: 6px;
  }
  
  .subject-selector select {
    width: 100%;
  }
  
  .qbtn {
    padding: 10px 12px;
    font-size: 12px;
  }
}