/* ============================================================
   VOIDCHAT v2.0 — Professional Hacker Clean Theme
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=JetBrains+Mono:wght@300;400;500;600;700&family=Inter:wght@300;400;500;600&display=swap');

/* --- CSS Variables --- */
:root {
  --bg-primary: #0a0a0f;
  --bg-secondary: #0f0f18;
  --bg-tertiary: #141420;
  --bg-card: rgba(15, 15, 24, 0.95);
  --bg-hover: rgba(0, 255, 65, 0.04);

  --green-primary: #00ff41;
  --green-dim: #00cc33;
  --green-dark: #00661a;
  --green-subtle: rgba(0, 255, 65, 0.08);
  --green-glow: rgba(0, 255, 65, 0.15);

  --cyan: #00e5ff;
  --cyan-dim: rgba(0, 229, 255, 0.6);

  --text-primary: #e0e0e0;
  --text-secondary: #888;
  --text-muted: #555;

  --border: rgba(0, 255, 65, 0.1);
  --border-active: rgba(0, 255, 65, 0.3);

  --danger: #ff4444;
  --danger-dim: rgba(255, 68, 68, 0.15);

  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --radius-xl: 20px;

  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 4px 20px rgba(0, 0, 0, 0.4);
  --shadow-lg: 0 8px 40px rgba(0, 0, 0, 0.5);
  --shadow-glow: 0 0 30px rgba(0, 255, 65, 0.08);

  --font-mono: 'JetBrains Mono', 'Fira Code', 'Courier New', monospace;
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;

  --sidebar-width: 280px;
  --header-height: 64px;
  --input-height: 72px;

  --transition: 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

/* --- Reset --- */
*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html, body {
  height: 100%;
  overflow: hidden;
}

body {
  background: var(--bg-primary);
  color: var(--text-primary);
  font-family: var(--font-sans);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

::selection {
  background: rgba(0, 255, 65, 0.2);
  color: var(--green-primary);
}

::-webkit-scrollbar {
  width: 5px;
}
::-webkit-scrollbar-track {
  background: transparent;
}
::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 10px;
}
::-webkit-scrollbar-thumb:hover {
  background: var(--border-active);
}

/* ============================================================
   MATRIX BACKGROUND
   ============================================================ */
.matrix-bg {
  position: fixed;
  inset: 0;
  z-index: 0;
  opacity: 0.04;
  pointer-events: none;
}

.noise-overlay {
  position: fixed;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noiseFilter'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noiseFilter)' opacity='0.02'/%3E%3C/svg%3E");
  opacity: 0.4;
}

/* ============================================================
   LOGIN PAGE
   ============================================================ */
.login-page {
  overflow: hidden;
}

.login-wrapper {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 20px;
}

.login-card {
  background: var(--bg-card);
  backdrop-filter: blur(20px);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 48px 40px;
  width: 100%;
  max-width: 420px;
  box-shadow: var(--shadow-lg), var(--shadow-glow);
  animation: cardAppear 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes cardAppear {
  from {
    opacity: 0;
    transform: translateY(20px) scale(0.97);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

/* Logo */
.login-logo {
  text-align: center;
  margin-bottom: 32px;
}

.logo-icon {
  color: var(--green-primary);
  margin-bottom: 16px;
  filter: drop-shadow(0 0 12px rgba(0, 255, 65, 0.3));
  animation: logoPulse 3s ease-in-out infinite;
}

@keyframes logoPulse {
  0%, 100% { filter: drop-shadow(0 0 12px rgba(0, 255, 65, 0.3)); }
  50% { filter: drop-shadow(0 0 20px rgba(0, 255, 65, 0.5)); }
}

.logo-text {
  font-family: var(--font-mono);
  font-size: 2rem;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: 4px;
}

.logo-text span {
  color: var(--green-primary);
  text-shadow: 0 0 20px rgba(0, 255, 65, 0.4);
}

.logo-subtitle {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  color: var(--text-muted);
  letter-spacing: 3px;
  margin-top: 8px;
  text-transform: uppercase;
}

/* Terminal Line */
.terminal-line {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--green-dim);
  padding: 12px 16px;
  background: rgba(0, 255, 65, 0.03);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  margin-bottom: 28px;
  overflow: hidden;
  white-space: nowrap;
}

.terminal-prefix {
  color: var(--green-primary);
  margin-right: 8px;
}

.terminal-cursor {
  color: var(--green-primary);
  animation: blink 1s step-end infinite;
}

@keyframes blink {
  50% { opacity: 0; }
}

/* Form */
.form-group {
  margin-bottom: 20px;
}

.form-group label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: var(--text-muted);
  letter-spacing: 2px;
  margin-bottom: 8px;
  text-transform: uppercase;
}

.form-group label svg {
  color: var(--green-dark);
}

.form-group input {
  width: 100%;
  background: rgba(0, 255, 65, 0.03);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  padding: 14px 16px;
  font-family: var(--font-mono);
  font-size: 0.9rem;
  outline: none;
  transition: all var(--transition);
}

.form-group input:focus {
  border-color: var(--green-primary);
  box-shadow: 0 0 0 3px rgba(0, 255, 65, 0.08);
  background: rgba(0, 255, 65, 0.05);
}

.form-group input::placeholder {
  color: var(--text-muted);
  font-size: 0.8rem;
}

/* Login Button */
.btn-login {
  width: 100%;
  background: linear-gradient(135deg, rgba(0, 255, 65, 0.12), rgba(0, 255, 65, 0.06));
  border: 1px solid var(--border-active);
  border-radius: var(--radius-sm);
  color: var(--green-primary);
  padding: 14px 24px;
  font-family: var(--font-mono);
  font-size: 0.85rem;
  font-weight: 600;
  letter-spacing: 3px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  transition: all var(--transition);
  margin-top: 8px;
  position: relative;
  overflow: hidden;
}

.btn-login::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, transparent, rgba(0, 255, 65, 0.1));
  opacity: 0;
  transition: opacity var(--transition);
}

.btn-login:hover::before {
  opacity: 1;
}

.btn-login:hover {
  box-shadow: 0 0 25px rgba(0, 255, 65, 0.15);
  transform: translateY(-1px);
}

.btn-login:active {
  transform: translateY(0);
}

.btn-login.loading .btn-text,
.btn-login.loading svg {
  display: none;
}

.btn-loader {
  display: none;
  width: 20px;
  height: 20px;
  border: 2px solid var(--border);
  border-top-color: var(--green-primary);
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
}

.btn-login.loading .btn-loader {
  display: block;
}

.btn-login.success {
  background: rgba(0, 255, 65, 0.2);
  border-color: var(--green-primary);
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* Error */
.error-msg {
  color: var(--danger);
  font-family: var(--font-mono);
  font-size: 0.75rem;
  text-align: center;
  margin-top: 16px;
  min-height: 20px;
}

/* Login Footer */
.login-footer {
  margin-top: 32px;
  padding-top: 24px;
  border-top: 1px solid var(--border);
}

.security-badges {
  display: flex;
  justify-content: center;
  gap: 16px;
}

.badge {
  display: flex;
  align-items: center;
  gap: 4px;
  font-family: var(--font-mono);
  font-size: 0.6rem;
  color: var(--text-muted);
  letter-spacing: 1px;
}

.badge svg {
  color: var(--green-dark);
}

/* ============================================================
   CHAT PAGE — LAYOUT
   ============================================================ */
.chat-page {
  overflow: hidden;
}

.app-container {
  display: flex;
  height: 100vh;
  position: relative;
}

/* --- Sidebar --- */
.sidebar {
  width: var(--sidebar-width);
  background: var(--bg-secondary);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  z-index: 30;
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.sidebar-brand {
  padding: 20px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand-icon {
  color: var(--green-primary);
  flex-shrink: 0;
  filter: drop-shadow(0 0 8px rgba(0, 255, 65, 0.3));
}

.brand-text h1 {
  font-family: var(--font-mono);
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: 2px;
}

.brand-text h1 span {
  color: var(--green-primary);
}

.brand-text p {
  font-family: var(--font-mono);
  font-size: 0.6rem;
  color: var(--text-muted);
  letter-spacing: 1px;
  margin-top: 2px;
}

/* User Card */
.sidebar-user {
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 12px;
}

.user-avatar {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-md);
  background: linear-gradient(135deg, rgba(0, 255, 65, 0.15), rgba(0, 255, 65, 0.05));
  border: 1px solid var(--border-active);
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  flex-shrink: 0;
}

.user-avatar span {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--green-primary);
}

.avatar-status {
  position: absolute;
  bottom: -2px;
  right: -2px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--text-muted);
  border: 2px solid var(--bg-secondary);
}

.avatar-status.online {
  background: var(--green-primary);
  box-shadow: 0 0 6px rgba(0, 255, 65, 0.5);
}

.user-details {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.user-name {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text-primary);
}

.user-role {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  color: var(--green-dark);
  letter-spacing: 1px;
}

/* Section */
.sidebar-section {
  flex: 1;
  padding: 8px 0;
  overflow-y: auto;
}

.section-label {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 20px 8px;
  font-family: var(--font-mono);
  font-size: 0.65rem;
  color: var(--text-muted);
  letter-spacing: 2px;
}

.section-label svg {
  color: var(--green-dark);
}

/* Contact Item */
.contact-item {
  padding: 12px 20px;
  display: flex;
  align-items: center;
  gap: 12px;
  cursor: default;
  transition: all var(--transition);
  border-left: 3px solid transparent;
  margin: 0 8px;
  border-radius: var(--radius-sm);
}

.contact-item.active {
  background: var(--green-subtle);
  border-left-color: var(--green-primary);
}

.contact-avatar {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-sm);
  background: rgba(0, 229, 255, 0.08);
  border: 1px solid rgba(0, 229, 255, 0.15);
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  flex-shrink: 0;
}

.contact-avatar span {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--cyan);
}

.contact-status {
  position: absolute;
  bottom: -2px;
  right: -2px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--text-muted);
  border: 2px solid var(--bg-secondary);
  transition: all var(--transition);
}

.contact-status.online {
  background: var(--green-primary);
  box-shadow: 0 0 6px rgba(0, 255, 65, 0.5);
}

.contact-info {
  flex: 1;
  min-width: 0;
}

.contact-name {
  display: block;
  font-family: var(--font-mono);
  font-size: 0.85rem;
  color: var(--text-primary);
  font-weight: 500;
}

.contact-status-text {
  display: block;
  font-family: var(--font-mono);
  font-size: 0.65rem;
  color: var(--text-muted);
  margin-top: 2px;
}

.contact-status-text.online {
  color: var(--green-dim);
}

.contact-badge {
  background: var(--green-primary);
  color: var(--bg-primary);
  font-family: var(--font-mono);
  font-size: 0.65rem;
  font-weight: 700;
  min-width: 20px;
  height: 20px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 6px;
}

/* Sidebar Actions */
.sidebar-actions {
  padding: 12px;
  border-top: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.sidebar-action-btn {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  background: transparent;
  border: none;
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  font-family: var(--font-mono);
  font-size: 0.75rem;
  cursor: pointer;
  transition: all var(--transition);
}

.sidebar-action-btn:hover {
  background: var(--bg-hover);
  color: var(--green-primary);
}

.sidebar-action-btn.danger:hover {
  background: var(--danger-dim);
  color: var(--danger);
}

.sidebar-action-btn svg {
  flex-shrink: 0;
}

/* Footer Info */
.sidebar-footer-info {
  padding: 12px 20px;
  border-top: 1px solid var(--border);
}

.connection-indicator {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-mono);
  font-size: 0.6rem;
  color: var(--text-muted);
  letter-spacing: 2px;
}

.conn-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--green-primary);
  box-shadow: 0 0 6px rgba(0, 255, 65, 0.5);
  animation: connPulse 2s ease-in-out infinite;
}

@keyframes connPulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.4; }
}

.connection-indicator.error .conn-dot {
  background: var(--danger);
  box-shadow: 0 0 6px rgba(255, 68, 68, 0.5);
}

.connection-indicator.error span {
  color: var(--danger);
}

/* --- Mobile Menu --- */
.mobile-menu-btn {
  display: none;
  position: fixed;
  top: 14px;
  left: 14px;
  z-index: 50;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--green-primary);
  padding: 8px;
  cursor: pointer;
}

.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  z-index: 25;
  backdrop-filter: blur(4px);
}

/* ============================================================
   CHAT MAIN
   ============================================================ */
.chat-main {
  flex: 1;
  display: flex;
  flex-direction: column;
  background: var(--bg-primary);
  min-width: 0;
}

/* --- Chat Header --- */
.chat-header {
  height: var(--header-height);
  padding: 0 24px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-shrink: 0;
  background: var(--bg-secondary);
}

.chat-header-left {
  display: flex;
  align-items: center;
  gap: 12px;
}

.header-avatar {
  width: 38px;
  height: 38px;
  border-radius: var(--radius-sm);
  background: rgba(0, 229, 255, 0.08);
  border: 1px solid rgba(0, 229, 255, 0.15);
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  flex-shrink: 0;
}

.header-avatar span {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--cyan);
}

.header-status-dot {
  position: absolute;
  bottom: -2px;
  right: -2px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--text-muted);
  border: 2px solid var(--bg-secondary);
  transition: all var(--transition);
}

.header-status-dot.online {
  background: var(--green-primary);
  box-shadow: 0 0 6px rgba(0, 255, 65, 0.5);
}

.header-info h2 {
  font-family: var(--font-mono);
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-primary);
  letter-spacing: 1px;
}

.header-status-text {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  color: var(--text-muted);
}

.header-status-text.online {
  color: var(--green-dim);
}

.chat-header-actions {
  display: flex;
  gap: 4px;
}

.header-action-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  padding: 8px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all var(--transition);
}

.header-action-btn:hover {
  background: var(--danger-dim);
  color: var(--danger);
}

/* --- Messages --- */
.messages-container {
  flex: 1;
  overflow: hidden;
  position: relative;
}

.messages-inner {
  height: 100%;
  overflow-y: auto;
  padding: 20px 24px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

/* Welcome */
.welcome-message {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 60px 20px;
  text-align: center;
  flex: 1;
}

.welcome-icon {
  color: var(--green-dark);
  margin-bottom: 20px;
  opacity: 0.5;
}

.welcome-message h3 {
  font-family: var(--font-mono);
  font-size: 1rem;
  color: var(--text-secondary);
  font-weight: 500;
  letter-spacing: 1px;
  margin-bottom: 8px;
}

.welcome-message p {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--text-muted);
  max-width: 300px;
  line-height: 1.6;
}

/* Message Bubbles */
.message {
  max-width: 65%;
  padding: 12px 16px;
  border-radius: var(--radius-md);
  font-size: 0.875rem;
  line-height: 1.5;
  animation: msgAppear 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  position: relative;
  word-wrap: break-word;
}

@keyframes msgAppear {
  from {
    opacity: 0;
    transform: translateY(8px) scale(0.97);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.message.sent {
  align-self: flex-end;
  background: linear-gradient(135deg, rgba(0, 255, 65, 0.1), rgba(0, 255, 65, 0.05));
  border: 1px solid rgba(0, 255, 65, 0.12);
  color: var(--green-primary);
  border-bottom-right-radius: 3px;
}

.message.received {
  align-self: flex-start;
  background: linear-gradient(135deg, rgba(0, 229, 255, 0.08), rgba(0, 229, 255, 0.03));
  border: 1px solid rgba(0, 229, 255, 0.1);
  color: var(--cyan);
  border-bottom-left-radius: 3px;
}

.msg-text {
  font-family: var(--font-sans);
  margin-bottom: 4px;
}

.msg-image {
  max-width: 280px;
  max-height: 300px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all var(--transition);
  display: block;
  margin-bottom: 4px;
}

.msg-image:hover {
  opacity: 0.85;
  transform: scale(1.02);
}

.msg-meta {
  font-family: var(--font-mono);
  font-size: 0.6rem;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 6px;
}

.message.sent .msg-meta {
  justify-content: flex-end;
}

/* Date separator */
.date-separator {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 0;
}

.date-separator::before,
.date-separator::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border);
}

.date-separator span {
  font-family: var(--font-mono);
  font-size: 0.6rem;
  color: var(--text-muted);
  letter-spacing: 2px;
  white-space: nowrap;
}

/* Scroll button */
.scroll-bottom-btn {
  position: absolute;
  bottom: 16px;
  right: 24px;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: 50%;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--green-primary);
  cursor: pointer;
  box-shadow: var(--shadow-md);
  transition: all var(--transition);
  z-index: 5;
}

.scroll-bottom-btn:hover {
  background: var(--green-subtle);
  transform: translateY(-2px);
}

/* --- Image Preview Bar --- */
.image-preview-bar {
  padding: 12px 24px;
  border-top: 1px solid var(--border);
  background: var(--bg-secondary);
}

.preview-content {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 12px;
  background: var(--bg-tertiary);
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
}

.preview-content img {
  width: 48px;
  height: 48px;
  object-fit: cover;
  border-radius: 4px;
}

.preview-info {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.preview-name {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.preview-size {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  color: var(--text-muted);
}

.preview-remove {
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 4px;
  border-radius: 4px;
  transition: all var(--transition);
}

.preview-remove:hover {
  color: var(--danger);
  background: var(--danger-dim);
}

/* --- Input Area --- */
.chat-input-area {
  padding: 12px 24px 16px;
  border-top: 1px solid var(--border);
  background: var(--bg-secondary);
  flex-shrink: 0;
}

.input-wrapper {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--bg-tertiary);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 4px 8px;
  transition: border-color var(--transition);
}

.input-wrapper:focus-within {
  border-color: var(--border-active);
  box-shadow: 0 0 0 3px rgba(0, 255, 65, 0.05);
}

.input-action-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  padding: 8px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all var(--transition);
  flex-shrink: 0;
}

.input-action-btn:hover {
  color: var(--green-primary);
  background: var(--green-subtle);
}

.input-action-btn.active {
  color: var(--green-primary);
}

.input-wrapper input[type="text"] {
  flex: 1;
  background: transparent;
  border: none;
  color: var(--text-primary);
  padding: 10px 4px;
  font-family: var(--font-sans);
  font-size: 0.9rem;
  outline: none;
}

.input-wrapper input[type="text"]::placeholder {
  color: var(--text-muted);
}

.send-btn {
  background: linear-gradient(135deg, rgba(0, 255, 65, 0.15), rgba(0, 255, 65, 0.08));
  border: 1px solid var(--border-active);
  border-radius: var(--radius-sm);
  color: var(--green-primary);
  padding: 8px 12px;
  cursor: pointer;
  transition: all var(--transition);
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.send-btn:hover {
  background: linear-gradient(135deg, rgba(0, 255, 65, 0.25), rgba(0, 255, 65, 0.12));
  box-shadow: 0 0 15px rgba(0, 255, 65, 0.1);
}

.send-btn:active {
  transform: scale(0.95);
}

/* ============================================================
   MODAL
   ============================================================ */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(8px);
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  animation: fadeIn 0.2s ease;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.modal-card {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 32px;
  max-width: 380px;
  width: 100%;
  text-align: center;
  box-shadow: var(--shadow-lg);
  animation: modalAppear 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes modalAppear {
  from {
    opacity: 0;
    transform: scale(0.9) translateY(10px);
  }
  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

.modal-icon {
  color: var(--danger);
  margin-bottom: 16px;
}

.modal-card h3 {
  font-family: var(--font-mono);
  font-size: 1rem;
  color: var(--text-primary);
  margin-bottom: 8px;
}

.modal-card p {
  font-size: 0.8rem;
  color: var(--text-secondary);
  line-height: 1.5;
  margin-bottom: 24px;
}

.modal-actions {
  display: flex;
  gap: 12px;
}

.modal-btn {
  flex: 1;
  padding: 12px;
  border-radius: var(--radius-sm);
  font-family: var(--font-mono);
  font-size: 0.8rem;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--transition);
  border: 1px solid;
}

.modal-btn.cancel {
  background: transparent;
  border-color: var(--border);
  color: var(--text-secondary);
}

.modal-btn.cancel:hover {
  background: var(--bg-tertiary);
  color: var(--text-primary);
}

.modal-btn.confirm {
  background: var(--danger-dim);
  border-color: rgba(255, 68, 68, 0.3);
  color: var(--danger);
}

.modal-btn.confirm:hover {
  background: rgba(255, 68, 68, 0.25);
  box-shadow: 0 0 15px rgba(255, 68, 68, 0.1);
}

/* ============================================================
   LIGHTBOX
   ============================================================ */
.lightbox {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.9);
  backdrop-filter: blur(10px);
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px;
  cursor: zoom-out;
  animation: fadeIn 0.3s ease;
}

.lightbox img {
  max-width: 90%;
  max-height: 90vh;
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-lg);
  object-fit: contain;
}

.lightbox-close {
  position: absolute;
  top: 20px;
  right: 20px;
  background: rgba(255, 255, 255, 0.1);
  border: none;
  color: white;
  padding: 10px;
  border-radius: 50%;
  cursor: pointer;
  transition: all var(--transition);
}

.lightbox-close:hover {
  background: rgba(255, 255, 255, 0.2);
}

/* ============================================================
   SYSTEM MESSAGE / TOAST
   ============================================================ */
.system-msg {
  text-align: center;
  padding: 6px 16px;
}

.system-msg span {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  color: var(--text-muted);
  background: var(--bg-tertiary);
  padding: 4px 12px;
  border-radius: 20px;
  letter-spacing: 1px;
}

/* Toast notification */
.toast {
  position: fixed;
  bottom: 80px;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 12px 20px;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--green-primary);
  box-shadow: var(--shadow-md);
  z-index: 300;
  animation: toastIn 0.3s ease forwards;
}

.toast.hide {
  animation: toastOut 0.3s ease forwards;
}

@keyframes toastIn {
  to {
    transform: translateX(-50%) translateY(0);
    opacity: 1;
  }
}

@keyframes toastOut {
  to {
    transform: translateX(-50%) translateY(20px);
    opacity: 0;
  }
}

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 768px) {
  .mobile-menu-btn {
    display: flex;
  }

  .sidebar {
    position: fixed;
    left: 0;
    top: 0;
    bottom: 0;
    transform: translateX(-100%);
    z-index: 40;
    box-shadow: var(--shadow-lg);
  }

  .sidebar.open {
    transform: translateX(0);
  }

  .sidebar-overlay.active {
    display: block;
  }

  .chat-header {
    padding-left: 56px;
  }

  .messages-inner {
    padding: 16px;
  }

  .chat-input-area {
    padding: 8px 12px 12px;
  }

  .message {
    max-width: 80%;
  }

  .msg-image {
    max-width: 220px;
  }

  .modal-card {
    margin: 0 12px;
  }
}

@media (max-width: 480px) {
  .login-card {
    padding: 32px 24px;
  }

  .message {
    max-width: 85%;
  }

  .msg-image {
    max-width: 180px;
  }
}
