/* ==========================================================================
   DEMO PAGE STYLES
   ========================================================================== */

/* --- Demo Section Layout --- */
.demo-section {
  min-height: 100vh;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #0c0d10 0%, #141520 40%, #0e0f14 100%);
  position: relative;
  overflow: hidden;
}

.demo-section::before {
  content: '';
  position: absolute;
  width: 800px;
  height: 800px;
  background: radial-gradient(circle, rgba(91, 95, 255, 0.08) 0%, transparent 70%);
  top: -200px;
  right: -200px;
  pointer-events: none;
}

.demo-section::after {
  content: '';
  position: absolute;
  width: 600px;
  height: 600px;
  background: radial-gradient(circle, rgba(57, 217, 138, 0.05) 0%, transparent 70%);
  bottom: -200px;
  left: -100px;
  pointer-events: none;
}

/* --- Honeypot (invisible to real users) --- */
.demo-honeypot-field {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
  tab-index: -1;
}

/* --- Name Entry Gate --- */
body.demo-page {
  background-color: #0c0d10 !important;
}

body.demo-page .navbar {
  background: rgba(12, 13, 16, 0.8) !important;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08) !important;
  box-shadow: 0 4px 30px rgba(0, 0, 0, 0.4);
}

body.demo-page .navbar .nav-link {
  color: rgba(255, 255, 255, 0.7) !important;
}

body.demo-page .navbar .nav-link:hover {
  color: #FFFFFF !important;
}

body.demo-page .navbar .logo-img {
  filter: brightness(0) invert(1) !important;
}

body.demo-page .navbar .nav-btn-login {
  color: #FFFFFF !important;
}

.demo-name-gate {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 100vh;
  padding: 120px 20px 60px 20px;
  z-index: 10;
  transition: opacity 0.4s ease, transform 0.4s ease;
}

.demo-gate-header {
  text-align: center;
  max-width: 680px;
  margin-bottom: 40px;
  animation: gate-appear 0.6s ease-out forwards;
}

.demo-gate-header h1 {
  font-size: 2.8rem;
  font-family: var(--font-display);
  font-weight: 800;
  color: #FFFFFF;
  margin-bottom: 16px;
  line-height: 1.25;
  letter-spacing: -0.02em;
}

.demo-gate-header p {
  font-size: 1.1rem;
  color: rgba(255, 255, 255, 0.7);
  line-height: 1.6;
}

@media (max-width: 768px) {
  .demo-gate-header h1 {
    font-size: 2rem;
  }
  .demo-gate-header p {
    font-size: 0.95rem;
  }
}

.demo-name-gate.fade-out {
  opacity: 0;
  transform: scale(0.95);
  pointer-events: none;
}

.demo-gate-card {
  background: rgba(255, 255, 255, 0.04);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--border-radius-lg);
  padding: 60px 48px;
  text-align: center;
  max-width: 460px;
  width: 100%;
  box-shadow: 0 32px 80px rgba(0, 0, 0, 0.3), 0 0 0 1px rgba(255, 255, 255, 0.04);
  animation: gate-appear 0.6s ease-out forwards;
}

@keyframes gate-appear {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.demo-gate-avatar {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary-color) 0%, #7e82ff 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 24px auto;
  position: relative;
}

.demo-gate-avatar span {
  color: #FFFFFF;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1.6rem;
}

.demo-gate-pulse {
  position: absolute;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  border: 2px solid var(--primary-color);
  animation: gate-pulse 2s ease-out infinite;
}

@keyframes gate-pulse {
  0% {
    transform: scale(1);
    opacity: 0.6;
  }
  100% {
    transform: scale(1.5);
    opacity: 0;
  }
}

.demo-gate-card h2 {
  color: #FFFFFF;
  font-size: 1.8rem;
  margin-bottom: 8px;
}

.demo-gate-card > p {
  color: rgba(255, 255, 255, 0.5);
  font-size: 0.95rem;
  margin-bottom: 32px;
}

.demo-gate-input {
  width: 100%;
  padding: 14px 18px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--border-radius-sm);
  color: #FFFFFF;
  font-family: var(--font-sans);
  font-size: 1rem;
  outline: none;
  transition: all var(--transition-fast);
  margin-bottom: 16px;
}

.demo-gate-input::placeholder {
  color: rgba(255, 255, 255, 0.3);
}

.demo-gate-input:focus {
  border-color: var(--primary-color);
  background: rgba(255, 255, 255, 0.08);
  box-shadow: 0 0 0 3px rgba(91, 95, 255, 0.15);
}

.demo-gate-btn {
  width: 100%;
  padding: 14px 24px;
  font-size: 1rem;
}

.demo-gate-hint {
  color: rgba(255, 255, 255, 0.3) !important;
  font-size: 0.8rem !important;
  margin-top: 20px !important;
  margin-bottom: 0 !important;
}

/* Spinner for buttons */
.demo-btn-spinner {
  display: inline-block;
  width: 16px;
  height: 16px;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-top-color: #FFFFFF;
  border-radius: 50%;
  animation: spinner-rotate 0.6s linear infinite;
}

@keyframes spinner-rotate {
  to { transform: rotate(360deg); }
}

/* --- Chat Container --- */
.demo-chat-container {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 100vh;
  padding: 80px 20px 40px 20px;
  z-index: 10;
  animation: chat-slide-in 0.5s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes chat-slide-in {
  from {
    opacity: 0;
    transform: translateY(30px) scale(0.97);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

/* --- Chat Window --- */
.demo-chat-window {
  width: 100%;
  max-width: 520px;
  height: 680px;
  background: rgba(20, 21, 32, 0.95);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--border-radius-lg);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: 0 40px 100px rgba(0, 0, 0, 0.4), 0 0 0 1px rgba(255, 255, 255, 0.04);
}

/* --- Top Bar --- */
.demo-chat-topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 20px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  background: rgba(255, 255, 255, 0.02);
  flex-shrink: 0;
}

.demo-chat-topbar-left {
  display: flex;
  align-items: center;
  gap: 12px;
}

.demo-chat-topbar-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary-color) 0%, #7e82ff 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  flex-shrink: 0;
}

.demo-chat-topbar-avatar span {
  color: #FFFFFF;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.1rem;
}

.demo-online-dot {
  width: 10px;
  height: 10px;
  background: var(--secondary-color);
  border: 2px solid #141520;
  border-radius: 50%;
  position: absolute;
  bottom: -1px;
  right: -1px;
}

.demo-chat-topbar-info h4 {
  color: #FFFFFF;
  font-size: 0.95rem;
  font-weight: 600;
}

.demo-chat-status {
  font-size: 0.75rem;
  color: var(--secondary-color);
  font-weight: 500;
}

.demo-chat-status.offline {
  color: #F2994A;
}

.demo-chat-topbar-actions {
  display: flex;
  gap: 8px;
}

.demo-topbar-icon-btn {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: rgba(255, 255, 255, 0.6);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.demo-topbar-icon-btn svg {
  width: 18px;
  height: 18px;
}

.demo-topbar-icon-btn:hover {
  background: rgba(255, 255, 255, 0.1);
  color: #FFFFFF;
  border-color: rgba(255, 255, 255, 0.15);
}

.demo-topbar-icon-btn.disabled {
  opacity: 0.3;
  cursor: not-allowed;
}

/* --- Messages Area --- */
.demo-chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 24px 20px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  scroll-behavior: smooth;
  -ms-overflow-style: none;
  scrollbar-width: thin;
  scrollbar-color: rgba(255,255,255,0.1) transparent;
}

.demo-chat-messages::-webkit-scrollbar {
  width: 4px;
}

.demo-chat-messages::-webkit-scrollbar-track {
  background: transparent;
}

.demo-chat-messages::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.1);
  border-radius: 10px;
}

/* --- Messages --- */
.demo-msg {
  display: flex;
  gap: 10px;
  animation: msg-appear 0.35s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes msg-appear {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.demo-msg-user {
  justify-content: flex-end;
}

.demo-msg-bot {
  justify-content: flex-start;
}

.demo-msg-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary-color) 0%, #7e82ff 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #FFFFFF;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.8rem;
  flex-shrink: 0;
  margin-top: 2px;
}

.demo-msg-bubble {
  max-width: 80%;
  padding: 12px 16px;
  border-radius: 16px;
  font-size: 0.9rem;
  line-height: 1.5;
}

.demo-msg-bubble p {
  margin: 0;
  font-size: 0.9rem;
  line-height: 1.5;
}

.demo-msg-bubble-user {
  background: var(--primary-color);
  color: #FFFFFF;
  border-bottom-right-radius: 4px;
}

.demo-msg-bubble-user p {
  color: #FFFFFF;
}

.demo-msg-bubble-bot {
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid rgba(255, 255, 255, 0.06);
  color: rgba(255, 255, 255, 0.9);
  border-bottom-left-radius: 4px;
}

.demo-msg-bubble-bot p {
  color: rgba(255, 255, 255, 0.9);
}

.demo-msg-bubble-bot a {
  color: var(--primary-color);
  text-decoration: underline;
}

.demo-msg-bubble-user a {
  color: #FFFFFF;
  text-decoration: underline;
  font-weight: 500;
}

/* Chat Rich Formatting Styles */
.chat-text-line {
  margin-bottom: 4px;
  line-height: 1.5;
}

.chat-line-break {
  height: 8px;
}

.demo-msg-bubble ul.chat-list {
  margin: 10px 0;
  padding-left: 20px;
  list-style-type: disc;
}

.demo-msg-bubble ul.chat-list li {
  margin-bottom: 6px;
  line-height: 1.5;
}

.demo-msg-bubble strong {
  font-weight: 700;
  color: #FFFFFF;
}



/* System Messages */
.demo-msg-system {
  justify-content: center;
}

.demo-msg-system span {
  font-size: 0.78rem;
  color: rgba(255, 255, 255, 0.35);
  background: rgba(255, 255, 255, 0.04);
  padding: 4px 14px;
  border-radius: 20px;
}

/* --- Typing Indicator --- */
.demo-typing-indicator {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 20px 12px 20px;
  flex-shrink: 0;
}

.demo-typing-avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary-color) 0%, #7e82ff 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #FFFFFF;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.7rem;
  flex-shrink: 0;
}

.demo-typing-dots {
  display: flex;
  align-items: center;
  gap: 8px;
}

.demo-typing-dots span {
  font-size: 0.78rem;
  color: rgba(255, 255, 255, 0.4);
  font-style: italic;
}

.demo-typing-dot-group {
  display: flex;
  gap: 3px;
}

.demo-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.35);
  animation: demo-dot-bounce 1.4s infinite ease-in-out both;
}

.demo-dot:nth-child(1) { animation-delay: -0.32s; }
.demo-dot:nth-child(2) { animation-delay: -0.16s; }

@keyframes demo-dot-bounce {
  0%, 80%, 100% { transform: scale(0.5); opacity: 0.4; }
  40% { transform: scale(1); opacity: 1; }
}

/* --- Input Area --- */
.demo-chat-input-area {
  display: flex;
  gap: 10px;
  padding: 16px 20px;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  background: rgba(255, 255, 255, 0.02);
  flex-shrink: 0;
}

.demo-chat-input {
  flex: 1;
  padding: 12px 16px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--border-radius-sm);
  color: #FFFFFF;
  font-family: var(--font-sans);
  font-size: 0.9rem;
  outline: none;
  transition: all var(--transition-fast);
}

.demo-chat-input::placeholder {
  color: rgba(255, 255, 255, 0.25);
}

.demo-chat-input:focus {
  border-color: var(--primary-color);
  background: rgba(255, 255, 255, 0.08);
  box-shadow: 0 0 0 3px rgba(91, 95, 255, 0.1);
}

.demo-send-btn {
  width: 44px;
  height: 44px;
  border-radius: var(--border-radius-sm);
  background: var(--primary-color);
  border: none;
  color: #FFFFFF;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all var(--transition-fast);
  flex-shrink: 0;
}

.demo-send-btn svg {
  width: 18px;
  height: 18px;
}

.demo-send-btn:hover {
  background: var(--primary-hover);
  transform: scale(1.05);
}

.demo-send-btn:active {
  transform: scale(0.95);
}

/* --- Schedule Meeting Overlay --- */
.demo-schedule-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 20px;
  animation: overlay-appear 0.3s ease forwards;
}

@keyframes overlay-appear {
  from { opacity: 0; }
  to { opacity: 1; }
}

.demo-schedule-card {
  background: rgba(20, 21, 32, 0.97);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--border-radius-lg);
  padding: 48px 40px;
  max-width: 420px;
  width: 100%;
  box-shadow: 0 40px 100px rgba(0, 0, 0, 0.5);
  animation: schedule-card-in 0.4s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes schedule-card-in {
  from {
    opacity: 0;
    transform: translateY(20px) scale(0.95);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.demo-schedule-header {
  text-align: center;
  margin-bottom: 32px;
}

.demo-schedule-icon {
  width: 48px;
  height: 48px;
  color: var(--primary-color);
  margin-bottom: 16px;
}

.demo-schedule-header h3 {
  color: #FFFFFF;
  font-size: 1.4rem;
  margin-bottom: 8px;
}

.demo-schedule-header p {
  color: rgba(255, 255, 255, 0.5);
  font-size: 0.9rem;
}

.demo-schedule-field {
  margin-bottom: 20px;
}

.demo-schedule-field label {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.6);
  margin-bottom: 8px;
}

.demo-schedule-field input {
  width: 100%;
  padding: 12px 16px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--border-radius-sm);
  color: #FFFFFF;
  font-family: var(--font-sans);
  font-size: 0.95rem;
  outline: none;
  transition: all var(--transition-fast);
}

.demo-schedule-field input::placeholder {
  color: rgba(255, 255, 255, 0.25);
}

.demo-schedule-field input:focus {
  border-color: var(--primary-color);
  background: rgba(255, 255, 255, 0.08);
  box-shadow: 0 0 0 3px rgba(91, 95, 255, 0.12);
}

.demo-schedule-confirm-btn {
  width: 100%;
  padding: 14px 24px;
  font-size: 1rem;
  margin-top: 8px;
}

/* --- Completion Screen --- */
.demo-completion-screen {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 100vh;
  padding: 40px 20px;
  z-index: 10;
  position: absolute;
  top: 0;
  left: 0;
}

.demo-completion-content {
  text-align: center;
  animation: completion-appear 0.8s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes completion-appear {
  from {
    opacity: 0;
    transform: scale(0.9);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

.demo-completion-checkmark {
  width: 80px;
  height: 80px;
  margin: 0 auto 32px auto;
}

.demo-checkmark-svg {
  width: 80px;
  height: 80px;
}

.demo-checkmark-circle {
  stroke-dasharray: 166;
  stroke-dashoffset: 166;
  stroke-width: 2;
  stroke: var(--secondary-color);
  animation: checkmark-circle 0.6s ease-in-out forwards;
}

.demo-checkmark-check {
  stroke-dasharray: 48;
  stroke-dashoffset: 48;
  stroke-width: 3;
  stroke: var(--secondary-color);
  stroke-linecap: round;
  stroke-linejoin: round;
  animation: checkmark-draw 0.3s ease-in-out 0.5s forwards;
}

@keyframes checkmark-circle {
  to { stroke-dashoffset: 0; }
}

@keyframes checkmark-draw {
  to { stroke-dashoffset: 0; }
}

.demo-completion-content h2 {
  color: #FFFFFF;
  font-size: 2.2rem;
  margin-bottom: 12px;
  max-width: 500px;
}

.demo-completion-content p {
  color: rgba(255, 255, 255, 0.5);
  font-size: 1.1rem;
  margin-bottom: 40px;
}

.demo-completion-btn {
  font-size: 1rem;
  padding: 14px 32px;
}

/* Responsive Demo */
@media (max-width: 600px) {
  .demo-gate-card {
    padding: 40px 24px;
  }

  .demo-chat-window {
    height: calc(100vh - 100px);
    max-width: 100%;
    border-radius: 16px;
  }

  .demo-schedule-card {
    padding: 32px 24px;
  }

  .demo-completion-content h2 {
    font-size: 1.6rem;
  }
}
