:root {
  --bg-main: #090d16;
  --bg-card: rgba(17, 24, 39, 0.75);
  --bg-subtle: rgba(255, 255, 255, 0.03);
  --border: rgba(255, 255, 255, 0.08);
  --border-hover: rgba(59, 130, 246, 0.4);
  --primary: #3b82f6;
  --primary-hover: #2563eb;
  --accent: #10b981;
  --accent-hover: #059669;
  --text: #f3f4f6;
  --text-dim: #9ca3af;
  --radius-lg: 16px;
  --radius-md: 12px;
}

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

body {
  background: var(--bg-main);
  color: var(--text);
  font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, sans-serif;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
}

/* Top Navigation Bar - Full Width */
header.navbar {
  width: 100%;
  background: rgba(13, 18, 30, 0.85);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border);
  padding: 14px 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 50;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 22px;
  font-weight: 800;
  color: #fff;
  text-decoration: none;
}

.brand .badge {
  font-size: 11px;
  padding: 3px 8px;
  background: linear-gradient(135deg, #3b82f6, #10b981);
  border-radius: 6px;
  color: #fff;
  font-weight: 700;
  letter-spacing: 0.5px;
}

/* Mode Switcher Tabs */
.mode-switch {
  display: flex;
  background: rgba(0, 0, 0, 0.4);
  padding: 4px;
  border-radius: 10px;
  border: 1px solid var(--border);
  gap: 4px;
}

.mode-tab {
  padding: 8px 22px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  color: var(--text-dim);
  text-decoration: none;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
}

.mode-tab:hover {
  color: #fff;
}

.mode-tab.active-sender {
  background: var(--primary);
  color: #fff;
  box-shadow: 0 2px 10px rgba(59, 130, 246, 0.35);
}

.mode-tab.active-receiver {
  background: var(--accent);
  color: #fff;
  box-shadow: 0 2px 10px rgba(16, 185, 129, 0.35);
}

/* Main Content Area - Full Width Container */
main.main-viewport {
  flex: 1;
  width: 100%;
  max-width: 1280px;
  margin: 0 auto;
  padding: 32px 24px 60px 24px;
  display: flex;
  flex-direction: column;
  gap: 24px;
}

/* Cards */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px;
  backdrop-filter: blur(12px);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.25);
}

/* Room Bar */
.room-bar {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
}

.room-input-group {
  flex: 1;
  min-width: 240px;
  display: flex;
  align-items: center;
  background: rgba(0, 0, 0, 0.4);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 2px 12px;
}

.room-input-group span {
  font-size: 13px;
  color: var(--text-dim);
  font-weight: 600;
  white-space: nowrap;
  margin-right: 8px;
}

.room-input-group input {
  flex: 1;
  background: transparent;
  border: none;
  outline: none;
  color: #fff;
  font-family: 'JetBrains Mono', monospace;
  font-size: 15px;
  padding: 10px 4px;
}

/* Buttons */
.btn {
  padding: 12px 22px;
  border-radius: var(--radius-md);
  border: none;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: all 0.2s ease;
  color: #fff;
  white-space: nowrap;
}

.btn-primary { background: var(--primary); }
.btn-primary:hover { background: var(--primary-hover); }
.btn-accent { background: var(--accent); }
.btn-accent:hover { background: var(--accent-hover); }
.btn-subtle { background: rgba(255, 255, 255, 0.08); border: 1px solid var(--border); }
.btn-subtle:hover { background: rgba(255, 255, 255, 0.14); }
.btn-lg { padding: 16px 32px; font-size: 16px; border-radius: var(--radius-md); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }

/* Drop Zone - Big & Full-width */
.drop-zone {
  border: 2px dashed rgba(255, 255, 255, 0.15);
  border-radius: var(--radius-lg);
  padding: 56px 24px;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s ease;
  background: var(--bg-subtle);
}

.drop-zone:hover, .drop-zone.dragover {
  border-color: var(--primary);
  background: rgba(59, 130, 246, 0.05);
}

.drop-zone .icon {
  font-size: 48px;
  margin-bottom: 12px;
}

.drop-zone h3 {
  font-size: 18px;
  font-weight: 700;
  margin-bottom: 6px;
}

.drop-zone p {
  color: var(--text-dim);
  font-size: 14px;
}

/* Selected File Display */
.file-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 16px 20px;
  margin-top: 16px;
}

.file-info {
  display: flex;
  align-items: center;
  gap: 14px;
  overflow: hidden;
}

.file-icon {
  font-size: 32px;
}

.file-text {
  overflow: hidden;
}

.file-name {
  font-weight: 700;
  font-size: 15px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 480px;
}

.file-size {
  font-size: 13px;
  color: var(--text-dim);
  margin-top: 2px;
}

/* Progress & Metrics */
.progress-wrap {
  width: 100%;
  height: 12px;
  background: rgba(255, 255, 255, 0.06);
  border-radius: 8px;
  overflow: hidden;
  margin: 16px 0 10px 0;
}

.progress-bar {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, #3b82f6, #10b981);
  transition: width 0.15s ease;
}

.progress-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 15px;
  font-weight: 700;
}

.metrics-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
  margin-top: 18px;
}

.metric-item {
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 14px 16px;
  text-align: center;
}

.metric-value {
  font-family: 'JetBrains Mono', monospace;
  font-size: 18px;
  font-weight: 800;
  color: #60a5fa;
}

.metric-label {
  font-size: 12px;
  color: var(--text-dim);
  margin-top: 4px;
}

/* Receiver Hero Box */
.receiver-hero {
  text-align: center;
  padding: 40px 20px;
}

.receiver-hero .icon {
  font-size: 56px;
  margin-bottom: 16px;
  animation: pulse 2s infinite ease-in-out;
}

@keyframes pulse {
  0%, 100% { transform: scale(1); opacity: 0.9; }
  50% { transform: scale(1.08); opacity: 1; }
}

.receiver-hero h3 {
  font-size: 22px;
  font-weight: 800;
  margin-bottom: 8px;
}

.receiver-hero p {
  color: var(--text-dim);
  font-size: 15px;
  max-width: 520px;
  margin: 0 auto 24px auto;
  line-height: 1.5;
}

/* Log Drawer (Collapsible) */
.log-drawer {
  margin-top: 8px;
}

.log-toggle {
  display: flex;
  justify-content: space-between;
  align-items: center;
  cursor: pointer;
  user-select: none;
  font-size: 13px;
  color: var(--text-dim);
  padding: 8px 0;
}

.log-toggle:hover { color: #fff; }

.log-console {
  background: rgba(0, 0, 0, 0.6);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 14px;
  height: 130px;
  overflow-y: auto;
  font-family: 'JetBrains Mono', monospace;
  font-size: 12px;
  color: #cbd5e1;
  display: none;
  margin-top: 10px;
}

.log-console.open { display: block; }
.log-entry { margin-bottom: 4px; line-height: 1.4; }

/* Responsive for Phones & Tablets */
@media (max-width: 768px) {
  header.navbar {
    flex-direction: column;
    gap: 14px;
    padding: 16px;
    align-items: stretch;
  }
  .brand { justify-content: center; }
  .mode-switch { width: 100%; }
  .mode-tab { flex: 1; justify-content: center; padding: 10px 8px; font-size: 13px; }
  main.main-viewport { padding: 16px 14px 40px 14px; gap: 16px; }
  .card { padding: 18px 14px; }
  .room-bar { flex-direction: column; align-items: stretch; }
  .metrics-grid { grid-template-columns: 1fr 1fr; gap: 10px; }
  .metric-value { font-size: 16px; }
  .drop-zone { padding: 36px 16px; }
  .file-name { max-width: 220px; }
}
