/**
 * AISA COMPANION - COMPONENT STYLING & MODALS (SLIM RIGHT SIDEBAR & MULTIMODAL)
 * Miyazaki Haruto Entertainment Co., Ltd. - Project MHEnt. Universe
 */

/* ==========================================================================
   1. LEFT SIDEBAR COMPONENTS (SLEEK & ORGANIC SANCTUARY)
   ========================================================================== */
/* New Session Button */
.btn-new-session {
  background: linear-gradient(135deg, rgba(236, 72, 153, 0.16) 0%, rgba(139, 92, 246, 0.16) 100%);
  border: 1px solid rgba(244, 114, 182, 0.3);
  color: #ffffff;
  border-radius: var(--radius-md);
  padding: 9px 14px;
  font-size: 0.82rem;
  font-weight: 800;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: var(--transition-smooth);
}
.btn-new-session:hover {
  background: linear-gradient(135deg, rgba(236, 72, 153, 0.28) 0%, rgba(139, 92, 246, 0.28) 100%);
  border-color: rgba(244, 114, 182, 0.6);
  box-shadow: 0 0 14px rgba(236, 72, 153, 0.25);
  transform: translateY(-1px);
}

/* Multi-Chat Sessions List in Sidebar */
.sessions-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 4px;
  margin-bottom: 2px;
}

.sessions-count-badge {
  background: rgba(236, 72, 153, 0.2);
  color: #f472b6;
  border-radius: var(--radius-full);
  font-size: 0.68rem;
  font-weight: 800;
  padding: 1px 7px;
  border: 1px solid rgba(236, 72, 153, 0.3);
}

.sidebar-sessions-list {
  max-height: 200px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 5px;
  padding-right: 2px;
}

.sidebar-sessions-list::-webkit-scrollbar {
  width: 4px;
}
.sidebar-sessions-list::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.15);
  border-radius: 4px;
}
.sidebar-sessions-list::-webkit-scrollbar-thumb:hover {
  background: rgba(244, 114, 182, 0.5);
}

.session-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 7px 10px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: var(--transition-smooth);
  user-select: none;
}

.session-item:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(244, 114, 182, 0.3);
  transform: translateX(2px);
}

.session-item.active {
  background: linear-gradient(135deg, rgba(236, 72, 153, 0.22) 0%, rgba(139, 92, 246, 0.22) 100%);
  border-color: rgba(244, 114, 182, 0.55);
  box-shadow: 0 0 12px rgba(236, 72, 153, 0.15);
}

.session-item-main {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 1;
  min-width: 0;
}

.session-item-icon {
  font-size: 0.88rem;
  flex-shrink: 0;
}

.session-item-texts {
  display: flex;
  flex-direction: column;
  min-width: 0;
  gap: 2px;
}

.session-item-title {
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--text-high);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.3;
}

.session-item.active .session-item-title {
  color: #ffffff;
  font-weight: 800;
}

.session-item-meta {
  font-size: 0.65rem;
  color: var(--text-muted);
  line-height: 1.2;
}

.btn-delete-session {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: none;
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  opacity: 0;
  flex-shrink: 0;
  transition: var(--transition-smooth);
}

.session-item:hover .btn-delete-session {
  opacity: 0.8;
}

.btn-delete-session:hover {
  background: rgba(239, 68, 68, 0.3) !important;
  color: #ef4444 !important;
  opacity: 1 !important;
  transform: scale(1.1);
}

.sessions-empty-tip {
  font-size: 0.72rem;
  color: var(--text-muted);
  font-style: italic;
  text-align: center;
  padding: 8px 0;
}

/* Mode Switcher Segmented Control */
.mode-selector-widget {
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 4px;
}

.mode-buttons-group {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 4px;
}

.mode-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  border-radius: var(--radius-md);
  padding: 7px 4px;
  font-size: 0.72rem;
  font-weight: 700;
  cursor: pointer;
  transition: var(--transition-smooth);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
}

.mode-btn .mode-icon {
  font-size: 1.05rem;
}

.mode-btn:hover {
  color: var(--text-high);
  background: rgba(255, 255, 255, 0.05);
}

.mode-btn.active {
  background: linear-gradient(135deg, rgba(236, 72, 153, 0.25), rgba(139, 92, 246, 0.25));
  border: 1px solid rgba(244, 114, 182, 0.4);
  color: #ffffff;
  box-shadow: 0 0 12px rgba(236, 72, 153, 0.22);
}

/* Companion Presence Card */
.sanctuary-presence-card {
  background: linear-gradient(135deg, rgba(236, 72, 153, 0.06) 0%, rgba(139, 92, 246, 0.06) 100%);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 14px;
  position: relative;
  overflow: hidden;
}

.presence-avatars-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin-bottom: 10px;
}

.presence-avatar-pill {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 5px 10px;
  border-radius: var(--radius-full);
  background: rgba(0, 0, 0, 0.25);
  border: 1px solid var(--border-subtle);
  transition: var(--transition-smooth);
}
.presence-avatar-pill.harmony {
  border-color: rgba(236, 72, 153, 0.3);
}
.presence-avatar-pill.echo {
  border-color: rgba(139, 92, 246, 0.3);
}

.presence-avatar-pill.dimmed {
  opacity: 0.35;
  filter: grayscale(60%);
}

.presence-icon {
  font-size: 1.15rem;
}

.presence-name {
  font-weight: 800;
  font-size: 0.78rem;
  letter-spacing: 0.2px;
}
.name-pink { color: var(--harmony-soft); }
.name-purple { color: var(--echo-soft); }

.presence-status-quote {
  font-size: 0.75rem;
  color: var(--text-medium);
  font-style: italic;
  text-align: center;
  line-height: 1.45;
  background: rgba(0, 0, 0, 0.2);
  padding: 8px 10px;
  border-radius: var(--radius-sm);
}

/* Quick Navigation Links */
.sidebar-section-title {
  font-size: 0.7rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: var(--text-muted);
  margin-top: 4px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.sidebar-quick-prompts {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.sidebar-prompt-item {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 8px 10px;
  font-size: 0.74rem;
  color: var(--text-medium);
  cursor: pointer;
  transition: var(--transition-smooth);
  text-align: left;
  display: flex;
  align-items: center;
  gap: 6px;
}
.sidebar-prompt-item:hover {
  background: rgba(236, 72, 153, 0.12);
  border-color: var(--harmony-border);
  color: #ffffff;
  transform: translateX(3px);
}

/* ==========================================================================
   2. SLIM RIGHT SIDEBAR (UTILITIES, COMPACT MEMORY & AMBIENCE)
   ========================================================================== */
.slim-card {
  background: var(--bg-glass-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.slim-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.slim-card-title {
  font-size: 0.76rem;
  font-weight: 800;
  color: var(--text-high);
  display: flex;
  align-items: center;
  gap: 6px;
}

.btn-slim-link {
  background: transparent;
  border: none;
  color: #38bdf8;
  font-size: 0.7rem;
  font-weight: 700;
  cursor: pointer;
}
.btn-slim-link:hover {
  text-decoration: underline;
}

/* Memory Quick Form */
.quick-add-fact-row {
  display: flex;
  gap: 6px;
}

.input-sidebar-fact {
  flex: 1;
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 6px 8px;
  font-size: 0.76rem;
  color: var(--text-high);
  outline: none;
}
.input-sidebar-fact:focus {
  border-color: var(--harmony-primary);
}

.btn-sidebar-add-fact {
  background: rgba(236, 72, 153, 0.2);
  border: 1px solid rgba(236, 72, 153, 0.4);
  color: #f472b6;
  border-radius: var(--radius-sm);
  padding: 0 8px;
  font-size: 0.8rem;
  font-weight: 800;
  cursor: pointer;
  transition: var(--transition-smooth);
}
.btn-sidebar-add-fact:hover {
  background: var(--harmony-primary);
  color: white;
}

/* Ambient Player Card */
.ambient-player-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(0, 0, 0, 0.25);
  border-radius: var(--radius-sm);
  padding: 8px 10px;
}

.ambient-info {
  display: flex;
  flex-direction: column;
}

.ambient-label {
  font-size: 0.76rem;
  font-weight: 800;
  color: #f472b6;
}

.ambient-sub {
  font-size: 0.68rem;
  color: var(--text-muted);
}

.btn-ambient-toggle {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid var(--border-subtle);
  color: var(--text-medium);
  border-radius: var(--radius-full);
  padding: 4px 10px;
  font-size: 0.72rem;
  font-weight: 700;
  cursor: pointer;
  transition: var(--transition-smooth);
}
.btn-ambient-toggle:hover {
  background: rgba(255, 255, 255, 0.15);
  color: #ffffff;
}
.btn-ambient-toggle.active {
  background: rgba(236, 72, 153, 0.25);
  border-color: var(--harmony-primary);
  color: #ffffff;
  box-shadow: 0 0 10px rgba(236, 72, 153, 0.3);
}

/* Wave visualizer */
.ambient-visualizer {
  display: flex;
  align-items: center;
  gap: 3px;
  height: 12px;
}
.ambient-visualizer span {
  width: 3px;
  height: 4px;
  border-radius: 2px;
  background: var(--text-muted);
  transition: var(--transition-smooth);
}
.ambient-visualizer.playing span {
  background: #f472b6;
  animation: wavePulse 1.2s infinite ease-in-out;
}
.ambient-visualizer.playing span:nth-child(2) { animation-delay: 0.2s; height: 10px; }
.ambient-visualizer.playing span:nth-child(3) { animation-delay: 0.4s; height: 7px; }
.ambient-visualizer.playing span:nth-child(4) { animation-delay: 0.1s; height: 12px; }
.ambient-visualizer.playing span:nth-child(5) { animation-delay: 0.3s; height: 5px; }

/* ==========================================================================
   3. MODALS SYSTEM
   ========================================================================== */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(3, 5, 8, 0.8);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  z-index: 1000;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 16px;
  animation: fadeIn 0.2s ease-out;
}

.modal-backdrop.active {
  display: flex;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.modal-dialog {
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-medium);
  border-radius: var(--radius-xl);
  width: 100%;
  max-width: 660px;
  max-height: 85vh;
  display: flex;
  flex-direction: column;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.6), 0 0 30px rgba(236, 72, 153, 0.15);
  overflow: hidden;
  animation: zoomIn 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes zoomIn {
  from { transform: scale(0.94); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}

.modal-header {
  padding: 16px 22px;
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(12, 17, 27, 0.6);
}

.modal-title {
  font-family: var(--font-display);
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--text-high);
  display: flex;
  align-items: center;
  gap: 8px;
}

.btn-modal-close {
  background: rgba(255, 255, 255, 0.08);
  border: none;
  color: var(--text-medium);
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  cursor: pointer;
  transition: var(--transition-smooth);
}
.btn-modal-close:hover {
  background: rgba(239, 68, 68, 0.25);
  color: #ef4444;
}

.modal-body {
  padding: 20px 22px;
  overflow-y: auto;
  flex: 1;
}

/* Memory Vault Inside Modal */
.memory-form-card {
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 14px;
  margin-bottom: 20px;
}

.memory-form-title {
  font-size: 0.8rem;
  font-weight: 800;
  color: #38bdf8;
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.memory-input-row {
  display: flex;
  gap: 8px;
}

.memory-text-input {
  flex: 1;
  background: var(--bg-void);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 8px 12px;
  color: var(--text-high);
  font-size: 0.85rem;
  outline: none;
}
.memory-text-input:focus {
  border-color: var(--harmony-primary);
}

.memory-select {
  background: var(--bg-void);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 8px 10px;
  color: var(--text-medium);
  font-size: 0.82rem;
  outline: none;
}

.btn-add-fact {
  background: linear-gradient(135deg, #ec4899, #8b5cf6);
  border: none;
  color: white;
  border-radius: var(--radius-sm);
  padding: 0 14px;
  font-size: 0.82rem;
  font-weight: 700;
  cursor: pointer;
  transition: var(--transition-smooth);
}
.btn-add-fact:hover {
  filter: brightness(1.15);
}

.memory-section-label {
  font-size: 0.74rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: var(--text-muted);
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.memory-facts-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 24px;
}

.memory-card {
  background: rgba(18, 25, 39, 0.7);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 12px 14px;
  transition: var(--transition-smooth);
}
.memory-card:hover {
  border-color: var(--border-medium);
}

.memory-card-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
  font-size: 0.72rem;
}

.memory-tag {
  padding: 2px 7px;
  border-radius: var(--radius-full);
  font-weight: 800;
  font-size: 0.65rem;
  text-transform: uppercase;
}
.tag-identity { background: rgba(236, 72, 153, 0.2); color: #f472b6; }
.tag-habit { background: rgba(139, 92, 246, 0.2); color: #c084fc; }
.tag-personality { background: rgba(6, 182, 212, 0.2); color: #38bdf8; }
.tag-preference { background: rgba(245, 158, 11, 0.2); color: #fbbf24; }
.tag-project { background: rgba(16, 185, 129, 0.2); color: #34d399; }
.tag-plan { background: rgba(59, 130, 246, 0.2); color: #60a5fa; }
.tag-general { background: rgba(255, 255, 255, 0.1); color: var(--text-medium); }

.memory-date {
  color: var(--text-muted);
  margin-right: auto;
}

.btn-del-memory {
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 2px 6px;
  font-size: 0.75rem;
  border-radius: 4px;
  transition: var(--transition-smooth);
}
.btn-del-memory:hover {
  color: #ef4444;
  background: rgba(239, 68, 68, 0.15);
}

.memory-content {
  font-size: 0.85rem;
  color: var(--text-high);
  line-height: 1.5;
}

.memory-logs-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.memory-log-row {
  display: flex;
  gap: 8px;
  padding: 8px 12px;
  background: rgba(0, 0, 0, 0.2);
  border-radius: var(--radius-sm);
  font-size: 0.8rem;
  line-height: 1.45;
}

.log-role {
  font-weight: 800;
  white-space: nowrap;
  font-size: 0.72rem;
}
.memory-log-row.user .log-role { color: #38bdf8; }
.memory-log-row.assistant .log-role { color: #f472b6; }

.log-text {
  color: var(--text-medium);
  word-break: break-word;
}

.empty-state {
  text-align: center;
  padding: 20px;
  color: var(--text-muted);
  font-size: 0.82rem;
  font-style: italic;
}

/* ==========================================================================
   4. MHENT UNIVERSE LUXURY CONFIRM & ALERT DIALOG
   ========================================================================== */
.modal-dialog-confirm {
  max-width: 440px;
  border-radius: 20px;
  background: linear-gradient(145deg, rgba(16, 22, 36, 0.96), rgba(8, 11, 18, 0.98));
  border: 1px solid rgba(244, 114, 182, 0.35);
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.8), 0 0 35px rgba(236, 72, 153, 0.2);
  overflow: hidden;
  text-align: center;
}

.dialog-header {
  padding: 14px 18px;
  background: rgba(255, 255, 255, 0.03);
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.dialog-body {
  padding: 24px 22px 14px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.dialog-icon-circle {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: linear-gradient(135deg, rgba(236, 72, 153, 0.2), rgba(139, 92, 246, 0.2));
  border: 1px solid rgba(244, 114, 182, 0.4);
  box-shadow: 0 0 22px rgba(236, 72, 153, 0.25);
  font-size: 1.8rem;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 14px;
  animation: pulseIcon 2.5s infinite ease-in-out;
}

@keyframes pulseIcon {
  0%, 100% { transform: scale(1); box-shadow: 0 0 20px rgba(236, 72, 153, 0.25); }
  50% { transform: scale(1.06); box-shadow: 0 0 28px rgba(236, 72, 153, 0.45); }
}

.dialog-prompt-heading {
  font-family: var(--font-display);
  font-size: 1.08rem;
  font-weight: 800;
  color: #ffffff;
  margin: 0 0 8px;
  line-height: 1.4;
}

.dialog-prompt-sub {
  font-size: 0.82rem;
  color: var(--text-medium);
  margin: 0;
  line-height: 1.5;
}

.dialog-actions-row {
  padding: 14px 22px 22px;
  display: flex;
  gap: 12px;
  justify-content: center;
}

.btn-dialog-action {
  flex: 1;
  padding: 10px 18px;
  border-radius: 12px;
  font-size: 0.84rem;
  font-weight: 800;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  transition: var(--transition-smooth);
}

.btn-dialog-cancel {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: var(--text-medium);
}
.btn-dialog-cancel:hover {
  background: rgba(255, 255, 255, 0.16);
  color: #ffffff;
  border-color: rgba(255, 255, 255, 0.25);
}

.btn-dialog-confirm {
  background: linear-gradient(135deg, #ec4899 0%, #8b5cf6 100%);
  border: none;
  color: #ffffff;
  box-shadow: 0 0 16px rgba(236, 72, 153, 0.35);
}
.btn-dialog-confirm:hover {
  transform: translateY(-1px);
  box-shadow: 0 0 22px rgba(236, 72, 153, 0.55);
}

.btn-dialog-danger {
  background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
  border: none;
  color: #ffffff;
  box-shadow: 0 0 16px rgba(239, 68, 68, 0.35);
}
.btn-dialog-danger:hover {
  transform: translateY(-1px);
  box-shadow: 0 0 22px rgba(239, 68, 68, 0.55);
}

/* ==========================================================================
   7. GATEKEEPER OVERLAY (LUXURY MHENT AUTH MODAL)
   ========================================================================== */
.gatekeeper-overlay {
  position: fixed;
  inset: 0;
  z-index: 99999;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: radial-gradient(circle at 50% 25%, rgba(236, 72, 153, 0.15) 0%, rgba(139, 92, 246, 0.08) 40%, rgba(5, 7, 11, 0.96) 80%);
  backdrop-filter: blur(28px);
  -webkit-backdrop-filter: blur(28px);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s cubic-bezier(0.16, 1, 0.3, 1), visibility 0.3s ease;
  overflow-y: auto;
}

.gatekeeper-overlay.active {
  opacity: 1;
  visibility: visible;
}

.gatekeeper-card {
  position: relative;
  width: 100%;
  max-width: 420px;
  background: rgba(13, 17, 28, 0.88);
  border: 1px solid rgba(244, 114, 182, 0.35);
  border-radius: 26px;
  padding: 34px 28px;
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.85), 0 0 40px rgba(236, 72, 153, 0.2);
  transform: translateY(12px) scale(0.98);
  transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1);
  overflow: hidden;
}

.gatekeeper-overlay.active .gatekeeper-card {
  transform: translateY(0) scale(1);
}

.gatekeeper-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 15%;
  right: 15%;
  height: 2px;
  background: linear-gradient(90deg, transparent, #ec4899, #8b5cf6, transparent);
  box-shadow: 0 0 15px #ec4899;
}

.gatekeeper-emblem-wrap {
  text-align: center;
  margin-bottom: 20px;
}

.gatekeeper-emblem {
  width: 64px;
  height: 64px;
  margin: 0 auto 12px;
  border-radius: 50%;
  background: linear-gradient(135deg, rgba(236, 72, 153, 0.2), rgba(139, 92, 246, 0.25));
  border: 1px solid rgba(244, 114, 182, 0.45);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 28px;
  box-shadow: 0 0 24px rgba(236, 72, 153, 0.35);
  animation: pulseGlow 3s ease-in-out infinite alternate;
}

@keyframes pulseGlow {
  0% { transform: scale(1); box-shadow: 0 0 18px rgba(236, 72, 153, 0.3); }
  100% { transform: scale(1.04); box-shadow: 0 0 28px rgba(236, 72, 153, 0.55); }
}

.gatekeeper-title {
  font-family: var(--font-display);
  font-size: 1.35rem;
  font-weight: 900;
  letter-spacing: -0.5px;
  color: #ffffff;
  margin: 0 0 4px;
}

.gatekeeper-title span {
  background: linear-gradient(135deg, #f472b6 0%, #c084fc 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.gatekeeper-subtitle {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin: 0 0 10px;
}

.gatekeeper-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 0.68rem;
  font-weight: 800;
  padding: 3px 10px;
  border-radius: 20px;
  background: rgba(236, 72, 153, 0.12);
  color: #f472b6;
  border: 1px solid rgba(236, 72, 153, 0.25);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* Error Banner */
.gate-error-banner {
  display: none;
  background: rgba(239, 68, 68, 0.15);
  border: 1px solid rgba(239, 68, 68, 0.4);
  color: #fca5a5;
  border-radius: 12px;
  padding: 10px 14px;
  font-size: 0.78rem;
  font-weight: 600;
  line-height: 1.4;
  margin-bottom: 16px;
  text-align: left;
}

.gate-error-banner.shake {
  animation: gateShake 0.4s ease-in-out;
}

@keyframes gateShake {
  0%, 100% { transform: translateX(0); }
  20%, 60% { transform: translateX(-6px); }
  40%, 80% { transform: translateX(6px); }
}

/* Form Styles */
.gate-form {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.gate-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  text-align: left;
}

.gate-label {
  font-size: 0.76rem;
  font-weight: 700;
  color: var(--text-medium);
  letter-spacing: 0.3px;
}

.gate-input-wrapper {
  position: relative;
  display: flex;
  align-items: center;
}

.gate-input-icon {
  position: absolute;
  left: 13px;
  font-size: 14px;
  opacity: 0.6;
  pointer-events: none;
}

.gate-input {
  width: 100%;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 14px;
  padding: 11px 14px 11px 38px;
  color: #ffffff;
  font-size: 0.88rem;
  font-family: inherit;
  outline: none;
  transition: var(--transition-smooth);
}

.gate-input:focus {
  background: rgba(255, 255, 255, 0.07);
  border-color: rgba(244, 114, 182, 0.6);
  box-shadow: 0 0 16px rgba(236, 72, 153, 0.2);
}

.gate-input-hint {
  font-size: 0.68rem;
  color: var(--text-muted);
  margin-top: 2px;
}

.btn-gate-submit {
  width: 100%;
  padding: 12px;
  margin-top: 6px;
  border-radius: 14px;
  border: none;
  background: linear-gradient(135deg, #ec4899 0%, #8b5cf6 100%);
  color: #ffffff;
  font-size: 0.88rem;
  font-weight: 800;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  box-shadow: 0 0 20px rgba(236, 72, 153, 0.35);
  transition: var(--transition-smooth);
}

.btn-gate-submit:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: 0 0 28px rgba(236, 72, 153, 0.55);
}

.btn-gate-submit:disabled {
  opacity: 0.7;
  cursor: not-allowed;
}

.gate-divider {
  display: flex;
  align-items: center;
  margin: 16px 0;
  text-align: center;
}

.gate-divider::before,
.gate-divider::after {
  content: "";
  flex: 1;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.gate-divider span {
  padding: 0 10px;
  font-size: 0.68rem;
  color: var(--text-muted);
  font-weight: 800;
  letter-spacing: 0.5px;
}

.btn-gate-google {
  width: 100%;
  padding: 10px 14px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: #ffffff;
  font-size: 0.82rem;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  transition: var(--transition-smooth);
}

.btn-gate-google:hover:not(:disabled) {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.25);
  transform: translateY(-1px);
}

.gate-security-notice {
  margin-top: 18px;
  padding-top: 14px;
  border-top: 1px dashed rgba(255, 255, 255, 0.08);
  font-size: 0.72rem;
  color: var(--text-muted);
  line-height: 1.45;
  text-align: center;
}

.gate-spinner {
  width: 14px;
  height: 14px;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-top-color: #ffffff;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  display: inline-block;
}

/* ==========================================================================
   8. HEADER USER BADGE & LOGOUT BUTTON
   ========================================================================== */
.header-user-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(244, 114, 182, 0.3);
  border-radius: 20px;
  padding: 3px 6px 3px 8px;
  transition: var(--transition-smooth);
}

.header-user-badge:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(244, 114, 182, 0.55);
}

.user-badge-inner {
  display: flex;
  align-items: center;
  gap: 6px;
  cursor: default;
}

.user-badge-avatar {
  font-size: 15px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.user-avatar-img {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  object-fit: cover;
  border: 1px solid rgba(244, 114, 182, 0.5);
}

.user-badge-name {
  font-size: 0.78rem;
  font-weight: 800;
  color: #ffffff;
  max-width: 110px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.user-badge-status-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #10b981;
  box-shadow: 0 0 6px #10b981;
}

.btn-header-logout {
  padding: 4px 6px;
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition-smooth);
}

.btn-header-logout:hover {
  color: #ef4444;
  background: rgba(239, 68, 68, 0.15);
}

/* ==========================================================================
   AISA TOAST NOTIFICATIONS (AUTO MEMORY & ALERTS)
   ========================================================================== */
.aisa-toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 10000;
  display: flex;
  flex-direction: column;
  gap: 10px;
  pointer-events: none;
}

.aisa-toast {
  pointer-events: auto;
  background: rgba(15, 23, 42, 0.94);
  border: 1px solid rgba(244, 114, 182, 0.45);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5), 0 0 18px rgba(236, 72, 153, 0.2);
  backdrop-filter: blur(16px);
  color: #ffffff;
  padding: 12px 18px;
  border-radius: var(--radius-lg);
  font-size: 0.85rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 12px;
  animation: aisaToastSlideIn 0.35s cubic-bezier(0.16, 1, 0.3, 1) forwards;
  transition: opacity 0.3s ease, transform 0.3s ease;
  max-width: 420px;
}

.aisa-toast .toast-icon {
  font-size: 1.25rem;
  flex-shrink: 0;
}

.aisa-toast .toast-text {
  color: var(--text-high);
  line-height: 1.4;
}

.aisa-toast.hide {
  opacity: 0;
  transform: translateY(12px) scale(0.94);
}

@keyframes aisaToastSlideIn {
  from {
    opacity: 0;
    transform: translateY(20px) scale(0.92);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

