/* ----------------------------------------------------
   DropVault — Lightweight High-Performance Design System
   Modern Dark Cyberpunk Aesthetics (Zero Scroll Lag)
---------------------------------------------------- */

:root {
  --bg-primary: #090d16;
  --bg-secondary: #0f172a;
  --bg-card: #0e1626;
  --bg-card-hover: #131d31;
  --border-glass: rgba(255, 255, 255, 0.08);
  --border-glass-hover: rgba(6, 182, 212, 0.4);
  
  --color-cyan: #06b6d4;
  --color-indigo: #6366f1;
  --color-fuchsia: #d946ef;
  --color-emerald: #10b981;
  --color-rose: #f43f5e;
  
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-mono: 'JetBrains Mono', 'Fira Code', monospace;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

/* Strictly ensure hidden elements are not displayed */
.hidden {
  display: none !important;
}

body {
  font-family: var(--font-sans);
  background-color: var(--bg-primary);
  color: #f1f5f9;
  overflow-x: hidden;
  position: relative;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Fast Lightweight Background Gradient (GPU friendly, zero blur) */
.bg-mesh {
  background: radial-gradient(circle at 50% 0%, #111a2e 0%, #090d16 65%);
  background-attachment: scroll;
}

/* Sleek Fixed Navigation */
.glass-nav {
  background: #090d16;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

/* Core Vault Cards (Fast Solid Surfaces) */
.vault-card {
  background: var(--bg-card);
  border: 1px solid var(--border-glass);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.35);
  transition: border-color 0.2s ease, transform 0.2s ease;
  position: relative;
}

.vault-card:hover {
  border-color: rgba(6, 182, 212, 0.35);
}

.card-glow {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, rgba(6, 182, 212, 0.8), rgba(99, 102, 241, 0.8), transparent);
}

/* Interactive Mode Switcher Tabs */
.mode-tab {
  display: inline-flex;
  align-items: center;
  padding: 8px 16px;
  border-radius: 10px;
  color: #94a3b8;
  font-size: 0.8125rem;
  font-weight: 600;
  transition: all 0.15s ease;
  border: 1px solid transparent;
  background: transparent;
  cursor: pointer;
}

.mode-tab:hover {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.05);
}

.mode-tab.active {
  background: rgba(6, 182, 212, 0.15);
  color: #38bdf8;
  border-color: rgba(6, 182, 212, 0.4);
}

/* Code Snippet Styles */
pre code.hljs {
  padding: 1.25rem !important;
  border-radius: 0.75rem;
  background: #070a12 !important;
  border: 1px solid rgba(255, 255, 255, 0.06);
  font-family: var(--font-mono) !important;
  font-size: 0.825rem !important;
  line-height: 1.6 !important;
  max-height: 480px;
  overflow-x: auto;
}

/* Live Chat Room & WhatsApp-Style Messaging */
.chat-room-container {
  display: flex;
  flex-direction: column;
  height: 480px;
  background: #080d18;
  border-radius: 1rem;
  border: 1px solid rgba(255, 255, 255, 0.08);
  overflow: hidden;
}

.chat-messages-stream {
  flex: 1;
  overflow-y: auto;
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  background: radial-gradient(circle at 50% 50%, #0d1424 0%, #080d18 100%);
}

.chat-bubble {
  max-width: 80%;
  padding: 8px 14px;
  border-radius: 14px;
  font-size: 0.825rem;
  line-height: 1.5;
  position: relative;
  word-break: break-word;
}

.chat-bubble-me {
  align-self: flex-end;
  background: linear-gradient(135deg, #0284c7, #4f46e5);
  color: #ffffff;
  border-bottom-right-radius: 4px;
  box-shadow: 0 2px 8px rgba(2, 132, 199, 0.3);
}

.chat-bubble-other {
  align-self: flex-start;
  background: #151f33;
  color: #f1f5f9;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-bottom-left-radius: 4px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.chat-sender-name {
  font-size: 0.6875rem;
  font-weight: 700;
  color: #38bdf8;
  margin-bottom: 2px;
}

.chat-msg-time {
  font-size: 0.625rem;
  opacity: 0.7;
  text-align: right;
  margin-top: 4px;
  font-family: var(--font-mono);
}

/* Delete-for-everyone button on chat bubbles */
.chat-del-btn {
  position: absolute;
  top: -8px;
  right: -8px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  font-size: 9px;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(15, 23, 42, 0.92);
  color: #f87171;
  border: 1px solid rgba(248, 113, 113, 0.4);
  cursor: pointer;
  padding: 0;
  opacity: 0;
  transition: opacity 0.15s ease, transform 0.15s ease;
  z-index: 5;
}

.chat-bubble:hover .chat-del-btn {
  opacity: 0.85;
}

.chat-del-btn:hover {
  opacity: 1 !important;
  transform: scale(1.2);
}

/* Touch devices have no hover — keep the button faintly visible */
@media (hover: none) {
  .chat-del-btn {
    opacity: 0.55;
  }
}

.chat-card-preview {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px;
  background: #090e1a;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  transition: all 0.2s ease;
}

.chat-card-preview:hover {
  border-color: rgba(6, 182, 212, 0.4);
  background: #111a2d;
}

/* File Attachment Cards in Feed */
.file-attachment-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  border-radius: 12px;
  background: #090e1a;
  border: 1px solid rgba(255, 255, 255, 0.08);
  transition: border-color 0.15s ease;
}

.file-attachment-card:hover {
  border-color: rgba(6, 182, 212, 0.4);
}

/* Image Gallery Grid in Drop Cards */
.drop-image-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 14px;
}

.drop-image-thumbnail {
  position: relative;
  overflow: hidden;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: #070a12;
  aspect-ratio: 16 / 10;
  cursor: pointer;
}

.drop-image-thumbnail img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.25s ease;
}

.drop-image-thumbnail:hover img {
  transform: scale(1.04);
}

.drop-image-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.85) 0%, transparent 60%);
  opacity: 0;
  transition: opacity 0.2s ease;
  display: flex;
  align-items: flex-end;
  padding: 12px;
}

.drop-image-thumbnail:hover .drop-image-overlay {
  opacity: 1;
}

/* Real-Time Emoji Reaction Buttons */
.reaction-btn {
  display: inline-flex;
  align-items: center;
  padding: 5px 12px;
  border-radius: 20px;
  background: #0c1322;
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: #cbd5e1;
  font-size: 0.75rem;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.15s ease, background-color 0.15s ease, border-color 0.15s ease;
  user-select: none;
}

.reaction-btn:hover {
  background: #152037;
  border-color: rgba(6, 182, 212, 0.5);
  transform: translateY(-1px);
}

.reaction-btn.has-reacted {
  background: rgba(6, 182, 212, 0.18);
  border-color: rgba(6, 182, 212, 0.5);
  color: #38bdf8;
}

/* File Attachment Queue Pill (inside upload box) */
.queue-pill {
  display: inline-flex;
  align-items: center;
  padding: 6px 12px;
  background: #111a2e;
  border: 1px solid rgba(6, 182, 212, 0.4);
  border-radius: 10px;
  font-size: 0.75rem;
  color: #e2e8f0;
}

/* Snipping Tool Fullscreen Overlay */
.snip-overlay {
  position: fixed;
  inset: 0;
  z-index: 10000;
  background: rgba(0, 0, 0, 0.92);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  user-select: none;
  cursor: crosshair;
}

.snip-overlay.hidden {
  display: none !important;
}

.snip-toolbar {
  position: absolute;
  top: 20px;
  z-index: 10001;
  background: #0f172a;
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 14px;
  padding: 8px 16px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.8);
  display: flex;
  align-items: center;
  gap: 12px;
}

.snip-canvas-wrap {
  position: relative;
  max-width: 95vw;
  max-height: 88vh;
  display: flex;
  align-items: center;
  justify-content: center;
}

.snip-canvas-wrap canvas {
  max-width: 100%;
  max-height: 85vh;
  object-fit: contain;
  border-radius: 8px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.6);
}

.snip-selection-box {
  position: absolute;
  border: 2px dashed #06b6d4;
  background: rgba(6, 182, 212, 0.12);
  box-shadow: 0 0 15px rgba(6, 182, 212, 0.4);
  pointer-events: none;
}

.snip-dim-mask {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
  pointer-events: none;
}

/* Modals */
.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: rgba(4, 7, 13, 0.85);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

.modal-backdrop.hidden {
  display: none !important;
}

.modal-card {
  background: #0d131f;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 1.25rem;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.7);
}

/* Fullscreen Drag & Drop Overlay */
.drag-drop-overlay {
  position: fixed;
  inset: 0;
  z-index: 9998;
  background: rgba(3, 7, 18, 0.9);
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
}

.drag-drop-overlay.hidden {
  display: none !important;
}

.drag-drop-modal {
  padding: 3rem;
  border: 2px dashed #06b6d4;
  border-radius: 2rem;
  background: #0c1322;
  display: flex;
  flex-direction: column;
  align-items: center;
}

/* Toasts */
.toast-msg {
  padding: 12px 18px;
  border-radius: 12px;
  background: #10192b;
  border: 1px solid rgba(255, 255, 255, 0.12);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.5);
  color: #ffffff;
  font-size: 0.8125rem;
  font-weight: 500;
  display: flex;
  align-items: center;
  space-x: 10px;
  pointer-events: auto;
}

/* New Drop Ingress Animation */
.drop-new-ingress {
  animation: dropIngress 0.3s ease-out;
}

@keyframes dropIngress {
  0% {
    opacity: 0;
    transform: translateY(-12px);
  }
  100% {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Custom Scrollbars */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: #070a10;
}

::-webkit-scrollbar-thumb {
  background: #1e293b;
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: #334155;
}

/* Chat PIN popup — wrong PIN feedback */
.chat-pin-error {
  border-color: rgba(248, 113, 113, 0.7) !important;
  box-shadow: 0 0 0 3px rgba(248, 113, 113, 0.15);
  animation: pinShake 0.3s ease;
}

@keyframes pinShake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-5px); }
  75% { transform: translateX(5px); }
}
