/* ============================================================
   SendDrop — Core Styles
   Cyberpunk / neon aesthetic for a P2P file sharing app
   ============================================================ */

/* ----- Reset & Base ----- */

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

:root {
  /* Neon palette */
  --neon-cyan: #00f0ff;
  --neon-pink: #e94560;
  --neon-purple: #b24eff;
  --neon-green: #00ff88;
  --neon-yellow: #ffaa00;

  /* Surfaces */
  --bg-deep: #0a0a1a;
  --bg-card: rgba(16, 24, 48, 0.85);
  --bg-card-hover: rgba(20, 32, 64, 0.92);
  --bg-input: rgba(10, 16, 32, 0.9);

  /* Text */
  --text-primary: #e8e8ff;
  --text-secondary: #8888aa;
  --text-dim: #555577;

  /* Borders */
  --border-default: rgba(0, 240, 255, 0.2);
  --border-hover: rgba(0, 240, 255, 0.6);

  /* Sizing */
  --container-max: 900px;
  --radius: 6px;
  --radius-lg: 10px;

  /* Shadows / glows */
  --glow-cyan: 0 0 8px rgba(0, 240, 255, 0.4), 0 0 20px rgba(0, 240, 255, 0.15);
  --glow-pink: 0 0 8px rgba(233, 69, 96, 0.4), 0 0 20px rgba(233, 69, 96, 0.15);
  --glow-purple: 0 0 8px rgba(178, 78, 255, 0.4), 0 0 20px rgba(178, 78, 255, 0.15);
  --glow-green: 0 0 8px rgba(0, 255, 136, 0.4), 0 0 20px rgba(0, 255, 136, 0.15);
}

html {
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: 'Courier New', Consolas, Monaco, 'Liberation Mono', monospace;
  background: var(--bg-deep);
  color: var(--text-primary);
  min-height: 100vh;
  overflow-x: hidden;
  line-height: 1.5;
}


/* ----- Particle Canvas (background layer) ----- */

#particles {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  pointer-events: none;
}


/* ----- App Container ----- */

#app {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 0 20px;
}


/* ----- Header ----- */

.header {
  padding: 24px 0 16px;
  text-align: center;
}

.title {
  font-size: 2.4rem;
  font-weight: 700;
  letter-spacing: 0.3em;
  color: var(--neon-cyan);
  text-shadow:
    0 0 7px rgba(0, 240, 255, 0.8),
    0 0 20px rgba(0, 240, 255, 0.5),
    0 0 42px rgba(0, 240, 255, 0.3),
    0 0 80px rgba(0, 240, 255, 0.15);
  margin-bottom: 16px;
  cursor: default;
  user-select: none;
  position: relative;
}

.room-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 16px;
  background: var(--bg-card);
  border: 1px solid var(--border-default);
  border-radius: var(--radius);
  flex-wrap: wrap;
}

.room-info {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.room-label {
  color: var(--text-secondary);
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  flex-shrink: 0;
}

.room-name {
  color: var(--neon-cyan);
  font-weight: 700;
  font-size: 0.9rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.room-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}


/* ----- Views (shared) ----- */

.view {
  flex: 1;
  display: flex;
  flex-direction: column;
  padding: 20px 0;
}

.view[hidden] {
  display: none;
}

.view-header {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 20px;
}

.view-title {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--text-primary);
}

.neon-text {
  color: var(--neon-cyan);
  text-shadow: 0 0 6px rgba(0, 240, 255, 0.5);
}


/* ----- Lobby: Peer Grid ----- */

.peer-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 16px;
  padding: 8px 0;
}

.peer-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 24px 16px;
  background: var(--bg-card);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-lg);
  cursor: pointer;
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
  user-select: none;
}

.peer-card:hover {
  border-color: var(--neon-cyan);
  background: var(--bg-card-hover);
  transform: scale(1.05);
  box-shadow: var(--glow-cyan);
}

.peer-card:active {
  transform: scale(0.98);
}

.peer-card .peer-icon {
  width: 64px;
  height: 64px;
  stroke: var(--neon-cyan);
  opacity: 0.85;
  transition: opacity 0.3s ease;
}

.peer-card:hover .peer-icon {
  opacity: 1;
}

.peer-card .peer-name {
  font-size: 0.85rem;
  color: var(--text-primary);
  text-align: center;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 100%;
}

/* Ripple effect container */
.peer-card .ripple {
  position: absolute;
  border-radius: 50%;
  background: rgba(0, 240, 255, 0.3);
  pointer-events: none;
}


/* ----- Lobby: Empty State ----- */

.empty-state {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 60px 20px;
  text-align: center;
}

.empty-icon {
  stroke: var(--text-dim);
  opacity: 0.6;
}

.empty-text {
  font-size: 1rem;
  color: var(--text-secondary);
}

.empty-hint {
  font-size: 0.8rem;
  color: var(--text-dim);
}


/* ----- Send View: Drop Zone ----- */

.drop-zone {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 48px 24px;
  border: 2px dashed var(--neon-cyan);
  border-radius: var(--radius-lg);
  background: transparent;
  cursor: pointer;
  transition: all 0.3s ease;
  text-align: center;
  position: relative;
}

.drop-zone:hover,
.drop-zone.dragover {
  border-style: solid;
  background: rgba(0, 240, 255, 0.05);
  box-shadow: inset 0 0 30px rgba(0, 240, 255, 0.08), var(--glow-cyan);
}

.drop-icon {
  stroke: var(--neon-cyan);
  opacity: 0.7;
  transition: opacity 0.3s ease;
}

.drop-zone:hover .drop-icon,
.drop-zone.dragover .drop-icon {
  opacity: 1;
}

.drop-text {
  font-size: 0.95rem;
  color: var(--text-primary);
}

.drop-hint {
  font-size: 0.75rem;
  color: var(--text-dim);
}


/* ----- Send View: File Queue ----- */

.file-queue {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 16px;
}

.file-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  background: var(--bg-card);
  border: 1px solid var(--border-default);
  border-radius: var(--radius);
  transition: border-color 0.3s ease;
}

.file-item .file-icon-small {
  width: 24px;
  height: 24px;
  stroke: var(--neon-purple);
  flex-shrink: 0;
}

.file-item .file-info {
  flex: 1;
  min-width: 0;
}

.file-item .file-name {
  font-size: 0.85rem;
  color: var(--text-primary);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.file-item .file-size {
  font-size: 0.7rem;
  color: var(--text-dim);
}

.file-item .file-status {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  flex-shrink: 0;
}

.file-item .file-status.queued { color: var(--text-dim); }
.file-item .file-status.sending { color: var(--neon-cyan); }
.file-item .file-status.complete { color: var(--neon-green); }
.file-item .file-status.failed { color: var(--neon-pink); }

.file-item .btn-remove-file {
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
  color: var(--text-dim);
  transition: color 0.2s ease;
}

.file-item .btn-remove-file:hover {
  color: var(--neon-pink);
}


/* ----- Receive View ----- */

.receive-info {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 24px;
  padding: 32px 16px;
  background: var(--bg-card);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-lg);
}

.file-preview {
  display: flex;
  align-items: center;
  gap: 16px;
}

.file-preview .file-icon {
  width: 48px;
  height: 48px;
  stroke: var(--neon-purple);
  flex-shrink: 0;
}

.file-details .file-name {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-primary);
  word-break: break-all;
}

.file-details .file-meta {
  font-size: 0.8rem;
  color: var(--text-secondary);
  margin-top: 4px;
}

.receive-actions {
  display: flex;
  gap: 12px;
}


/* ----- Progress Bar ----- */

.progress-section {
  margin-top: 20px;
}

.progress-section[hidden] {
  display: none;
}

.progress-info {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 8px;
  font-size: 0.8rem;
  gap: 12px;
  flex-wrap: wrap;
}

.progress-text {
  color: var(--neon-cyan);
  font-weight: 700;
}

.progress-speed {
  color: var(--text-secondary);
}

.progress-eta {
  color: var(--text-dim);
}

.progress-track {
  width: 100%;
  height: 8px;
  background: rgba(0, 240, 255, 0.1);
  border-radius: 4px;
  overflow: hidden;
  position: relative;
}

.progress-fill {
  height: 100%;
  border-radius: 4px;
  background: linear-gradient(90deg, var(--neon-cyan), var(--neon-purple), var(--neon-cyan));
  background-size: 200% 100%;
  transition: width 0.3s ease;
  position: relative;
}


/* ----- Buttons ----- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px 20px;
  font-family: inherit;
  font-size: 0.85rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  border-radius: var(--radius);
  border: 1px solid;
  background: transparent;
  cursor: pointer;
  transition: all 0.3s ease;
  user-select: none;
  white-space: nowrap;
}

.btn:active {
  transform: translateY(1px);
}

.btn-icon {
  flex-shrink: 0;
}

/* Small button variant */
.btn-sm {
  padding: 6px 12px;
  font-size: 0.75rem;
}

/* Icon-only button */
.btn-icon-only {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 8px;
  background: transparent;
  border: 1px solid var(--border-default);
  border-radius: var(--radius);
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.3s ease;
}

.btn-icon-only:hover {
  color: var(--neon-cyan);
  border-color: var(--neon-cyan);
  box-shadow: var(--glow-cyan);
}

/* Primary — cyan */
.btn-primary {
  color: var(--neon-cyan);
  border-color: var(--neon-cyan);
}

.btn-primary:hover {
  background: rgba(0, 240, 255, 0.15);
  box-shadow: var(--glow-cyan);
}

/* Secondary — purple */
.btn-secondary {
  color: var(--neon-purple);
  border-color: var(--neon-purple);
}

.btn-secondary:hover {
  background: rgba(178, 78, 255, 0.15);
  box-shadow: var(--glow-purple);
}

/* Danger — pink/red */
.btn-danger {
  color: var(--neon-pink);
  border-color: var(--neon-pink);
}

.btn-danger:hover {
  background: rgba(233, 69, 96, 0.15);
  box-shadow: var(--glow-pink);
}

/* Accept — green */
.btn-accept {
  color: var(--neon-green);
  border-color: var(--neon-green);
}

.btn-accept:hover {
  background: rgba(0, 255, 136, 0.15);
  box-shadow: var(--glow-green);
}


/* ----- Modal ----- */

.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 500;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}

.modal-overlay[hidden] {
  display: none;
}

.modal {
  width: 90%;
  max-width: 400px;
  background: var(--bg-card);
  border: 1px solid var(--neon-cyan);
  border-radius: var(--radius-lg);
  padding: 24px;
  box-shadow: var(--glow-cyan);
}

.modal-title {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--neon-cyan);
  margin-bottom: 20px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.modal-body {
  margin-bottom: 20px;
}

.input-label {
  display: block;
  font-size: 0.75rem;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 8px;
}

.input-field {
  width: 100%;
  padding: 10px 12px;
  font-family: inherit;
  font-size: 0.9rem;
  color: var(--text-primary);
  background: var(--bg-input);
  border: none;
  border-bottom: 2px solid var(--border-default);
  border-radius: 2px;
  outline: none;
  transition: border-color 0.3s ease;
}

.input-field:focus {
  border-bottom-color: var(--neon-cyan);
}

.input-field::placeholder {
  color: var(--text-dim);
}

.input-hint {
  font-size: 0.7rem;
  color: var(--text-dim);
  margin-top: 6px;
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}


/* ----- Toast Notifications ----- */

.toast-container {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 600;
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
}

.toast {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  background: var(--bg-card);
  border-radius: var(--radius);
  border-left: 3px solid var(--neon-cyan);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
  font-size: 0.85rem;
  color: var(--text-primary);
  pointer-events: auto;
  max-width: 340px;
}

.toast.toast-success {
  border-left-color: var(--neon-green);
}

.toast.toast-error {
  border-left-color: var(--neon-pink);
}

.toast.toast-warning {
  border-left-color: var(--neon-yellow);
}


/* ----- Footer ----- */

.footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 0 16px;
  font-size: 0.75rem;
  color: var(--text-dim);
  border-top: 1px solid rgba(255, 255, 255, 0.05);
  margin-top: auto;
}

.status-indicator {
  display: flex;
  align-items: center;
  gap: 8px;
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}

.status-dot.connected {
  background: var(--neon-green);
  box-shadow: 0 0 6px rgba(0, 255, 136, 0.6);
}

.status-dot.disconnected {
  background: var(--neon-pink);
  box-shadow: 0 0 6px rgba(233, 69, 96, 0.6);
}

.status-text {
  color: var(--text-secondary);
}

.security-badge {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--text-dim);
}

.security-badge svg {
  stroke: var(--neon-green);
  opacity: 0.7;
}


/* ----- Hidden SVG Icons Container ----- */

#svg-icons {
  display: none;
}


/* ----- Utility Classes ----- */

.hidden {
  display: none !important;
}


/* ----- Responsive ----- */

@media (max-width: 600px) {
  .header {
    padding: 16px 0 12px;
  }

  .title {
    font-size: 1.6rem;
    letter-spacing: 0.2em;
  }

  .room-bar {
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
  }

  .room-info {
    justify-content: center;
  }

  .room-actions {
    justify-content: center;
    flex-wrap: wrap;
  }

  .peer-grid {
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 12px;
  }

  .peer-card {
    padding: 18px 12px;
  }

  .peer-card .peer-icon {
    width: 48px;
    height: 48px;
  }

  .drop-zone {
    padding: 32px 16px;
  }

  .view-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
  }

  .file-preview {
    flex-direction: column;
    text-align: center;
  }

  .receive-actions {
    width: 100%;
  }

  .receive-actions .btn {
    flex: 1;
  }

  .toast-container {
    top: 10px;
    right: 10px;
    left: 10px;
  }

  .toast {
    max-width: 100%;
  }

  .footer {
    flex-direction: column;
    gap: 8px;
    text-align: center;
  }

  .modal {
    width: 95%;
    padding: 20px;
  }
}

@media (max-width: 360px) {
  .title {
    font-size: 1.3rem;
    letter-spacing: 0.15em;
  }

  .peer-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}
