:root {
  --bg-primary: #0f0f13;
  --bg-secondary: #1a1a24;
  --bg-tertiary: #252532;
  --accent: #6366f1;
  --accent-hover: #818cf8;
  --success: #22c55e;
  --danger: #ef4444;
  --text-primary: #f1f1f4;
  --text-secondary: #9898a6;
  --border: #2d2d3d;
  --shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
}

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

body {
  font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
  background: var(--bg-primary);
  color: var(--text-primary);
  min-height: 100vh;
  line-height: 1.6;
}

.container {
  max-width: 800px;
  margin: 0 auto;
  padding: 2rem;
}

header {
  text-align: center;
  margin-bottom: 2rem;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid var(--border);
}

header h1 {
  font-size: 2rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
  background: linear-gradient(135deg, var(--accent) 0%, #a855f7 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.status {
  font-size: 0.9rem;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
}

.status::before {
  content: '';
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--danger);
  animation: pulse 2s infinite;
}

.status.connected::before {
  background: var(--success);
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

.upload-section {
  margin-bottom: 2rem;
}

.upload-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.25rem;
  background: var(--bg-secondary);
  border: 2px dashed var(--border);
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.3s ease;
}

.upload-btn:hover {
  border-color: var(--accent);
  background: var(--bg-tertiary);
}

.upload-btn span {
  font-size: 1rem;
  font-weight: 500;
  color: var(--text-secondary);
}

section {
  margin-bottom: 2rem;
}

section h2 {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 1rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.file-list, .transfer-list {
  background: var(--bg-secondary);
  border-radius: 12px;
  padding: 0.5rem;
  min-height: 60px;
}

.file-list .empty, .transfer-list .empty {
  color: var(--text-secondary);
  text-align: center;
  padding: 1rem;
  font-size: 0.9rem;
}

.file-item, .transfer-item {
  display: flex;
  align-items: center;
  padding: 0.75rem 1rem;
  background: var(--bg-tertiary);
  border-radius: 8px;
  margin: 0.5rem;
  gap: 1rem;
}

.file-item:hover {
  background: #2f2f42;
}

.file-icon {
  font-size: 1.5rem;
  flex-shrink: 0;
}

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

.file-name {
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.file-size {
  font-size: 0.85rem;
  color: var(--text-secondary);
}

.file-actions {
  display: flex;
  gap: 0.5rem;
  flex-shrink: 0;
}

.btn {
  padding: 0.5rem 1rem;
  border: none;
  border-radius: 6px;
  font-size: 0.85rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-download {
  background: var(--accent);
  color: white;
}

.btn-download:hover {
  background: var(--accent-hover);
}

.btn-download:disabled {
  background: var(--border);
  cursor: not-allowed;
}

.btn-remove {
  background: transparent;
  color: var(--danger);
  border: 1px solid var(--danger);
}

.btn-remove:hover {
  background: var(--danger);
  color: white;
}

/* Cancel button */
.btn-cancel {
  background: transparent;
  color: var(--danger);
  border: 1px solid var(--danger);
  padding: 0.4rem 0.6rem;
  font-size: 0.8rem;
  flex-shrink: 0;
}

.btn-cancel:hover {
  background: var(--danger);
  color: white;
}

/* Transfer items */
.transfer-item {
  flex-wrap: wrap;
  position: relative;
}

.transfer-info {
  flex: 1;
  min-width: 200px;
}

.transfer-name {
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.transfer-status {
  font-size: 0.85rem;
  color: var(--text-secondary);
}

.progress-container {
  width: 100%;
  margin-top: 0.5rem;
}

.progress-bar {
  height: 6px;
  background: var(--bg-primary);
  border-radius: 3px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--accent), #a855f7);
  border-radius: 3px;
  transition: width 0.3s ease;
}

.progress-text {
  display: flex;
  justify-content: space-between;
  font-size: 0.75rem;
  color: var(--text-secondary);
  margin-top: 0.25rem;
}

/* Owner badge */
.owner-badge {
  font-size: 0.7rem;
  padding: 0.2rem 0.5rem;
  background: var(--accent);
  color: white;
  border-radius: 4px;
  margin-left: 0.5rem;
}

/* Modal */
.modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.7);
  justify-content: center;
  align-items: center;
  z-index: 1000;
}

.modal-content {
  background: var(--bg-secondary);
  border-radius: 16px;
  padding: 1.5rem;
  max-width: 450px;
  width: 90%;
  max-height: 80vh;
  overflow-y: auto;
}

.modal-content h3 {
  margin-bottom: 1rem;
  font-size: 1.2rem;
  color: var(--text-primary);
}

.modal-files {
  background: var(--bg-tertiary);
  border-radius: 8px;
  padding: 0.75rem;
  margin-bottom: 1.5rem;
  max-height: 150px;
  overflow-y: auto;
}

.modal-file-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem;
  font-size: 0.9rem;
}

.modal-file-item .file-icon {
  font-size: 1.2rem;
}

.modal-file-item .file-name {
  flex: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.modal-file-item .file-size {
  color: var(--text-secondary);
  font-size: 0.8rem;
}

.modal-setting {
  margin-bottom: 1.5rem;
}

.modal-setting label {
  display: block;
  margin-bottom: 0.75rem;
  color: var(--text-primary);
  font-weight: 500;
}

.channel-selector {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.channel-selector input[type="range"] {
  flex: 1;
  height: 6px;
  -webkit-appearance: none;
  background: var(--bg-tertiary);
  border-radius: 3px;
  outline: none;
}

.channel-selector input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 20px;
  height: 20px;
  background: var(--accent);
  border-radius: 50%;
  cursor: pointer;
  transition: transform 0.2s;
}

.channel-selector input[type="range"]::-webkit-slider-thumb:hover {
  transform: scale(1.1);
}

.channel-selector span {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--accent);
  min-width: 2rem;
  text-align: center;
}

.setting-hint {
  margin-top: 0.5rem;
  font-size: 0.85rem;
  color: var(--text-secondary);
}

.modal-actions {
  display: flex;
  gap: 0.75rem;
  justify-content: flex-end;
}

.btn-secondary {
  background: var(--bg-tertiary);
  color: var(--text-primary);
}

.btn-secondary:hover {
  background: var(--border);
}

.btn-primary {
  background: var(--accent);
  color: white;
}

.btn-primary:hover {
  background: var(--accent-hover);
}

/* Channel badge in file list */
.channel-badge {
  font-size: 0.7rem;
  padding: 0.15rem 0.4rem;
  background: var(--accent);
  color: white;
  border-radius: 4px;
  margin-left: 0.5rem;
}

/* Responsive */
@media (max-width: 600px) {
  .container {
    padding: 1rem;
  }
  
  header h1 {
    font-size: 1.5rem;
  }
  
  .file-item {
    flex-wrap: wrap;
  }
  
  .file-actions {
    width: 100%;
    margin-top: 0.5rem;
  }
  
  .btn {
    flex: 1;
  }
  
  .modal-content {
    padding: 1rem;
  }
}

