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

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
  background: #0f0f0f;
  color: #e0e0e0;
  min-height: 100vh;
}

a { color: #7c8aff; text-decoration: none; }
a:hover { text-decoration: underline; }

/* Login */
#login-view {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
}

.login-box {
  background: #1a1a1a;
  border: 1px solid #2a2a2a;
  border-radius: 12px;
  padding: 40px;
  width: 360px;
}

.login-box h1 {
  font-size: 20px;
  margin-bottom: 24px;
  color: #fff;
}

.login-box input {
  width: 100%;
  padding: 10px 14px;
  background: #111;
  border: 1px solid #333;
  border-radius: 8px;
  color: #e0e0e0;
  font-size: 14px;
  margin-bottom: 16px;
}

.login-box input:focus {
  outline: none;
  border-color: #7c8aff;
}

.login-box .error {
  color: #ff5555;
  font-size: 13px;
  margin-bottom: 12px;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  border: none;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.15s;
}

.btn-primary {
  background: #7c8aff;
  color: #fff;
}
.btn-primary:hover { background: #6b79ee; }

.btn-danger {
  background: #3a1a1a;
  color: #ff5555;
}
.btn-danger:hover { background: #4a2020; }

.btn-secondary {
  background: #2a2a2a;
  color: #ccc;
}
.btn-secondary:hover { background: #333; }

.btn-sm {
  padding: 5px 10px;
  font-size: 12px;
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* Dashboard */
#dashboard-view {
  display: none;
  max-width: 1100px;
  margin: 0 auto;
  padding: 24px;
}

header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 28px;
}

header h1 {
  font-size: 20px;
  color: #fff;
}

/* Sections */
.section {
  background: #1a1a1a;
  border: 1px solid #2a2a2a;
  border-radius: 12px;
  padding: 20px;
  margin-bottom: 20px;
}

.section h2 {
  font-size: 15px;
  color: #999;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 16px;
}

/* Upload */
.upload-area {
  border: 2px dashed #333;
  border-radius: 8px;
  padding: 40px;
  text-align: center;
  cursor: pointer;
  transition: border-color 0.2s;
  position: relative;
}

.upload-area:hover,
.upload-area.dragover {
  border-color: #7c8aff;
}

.upload-area input[type="file"] {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
}

.upload-area p {
  color: #888;
  font-size: 14px;
}

.progress-bar {
  width: 100%;
  height: 6px;
  background: #222;
  border-radius: 3px;
  margin-top: 12px;
  overflow: hidden;
  display: none;
}

.progress-bar .fill {
  height: 100%;
  background: #7c8aff;
  border-radius: 3px;
  width: 0%;
  transition: width 0.3s;
}

.upload-status {
  margin-top: 10px;
  font-size: 13px;
  color: #888;
}

/* Real-Debrid */
.rd-row {
  display: flex;
  gap: 8px;
  margin-bottom: 12px;
}

.rd-row input {
  flex: 1;
  padding: 8px 12px;
  background: #111;
  border: 1px solid #333;
  border-radius: 8px;
  color: #e0e0e0;
  font-size: 14px;
}

.rd-row input:focus {
  outline: none;
  border-color: #7c8aff;
}

.rd-info {
  background: #111;
  border: 1px solid #2a2a2a;
  border-radius: 8px;
  padding: 12px;
  font-size: 13px;
  margin-bottom: 12px;
  display: none;
}

.rd-info .name { color: #fff; font-weight: 500; }
.rd-info .size { color: #888; margin-left: 8px; }

.rd-downloads {
  margin-top: 12px;
}

.rd-download-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 0;
  border-bottom: 1px solid #222;
  font-size: 13px;
}

.rd-download-item:last-child { border-bottom: none; }

.rd-download-item .name { flex: 1; color: #ccc; }
.rd-download-item .status { color: #888; }
.rd-download-item .status.completed { color: #55ff55; }
.rd-download-item .status.error { color: #ff5555; }

/* File table */
.file-table {
  width: 100%;
  border-collapse: collapse;
}

.file-table th {
  text-align: left;
  font-size: 12px;
  color: #666;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding: 8px 10px;
  border-bottom: 1px solid #2a2a2a;
}

.file-table td {
  padding: 10px;
  font-size: 13px;
  border-bottom: 1px solid #1f1f1f;
}

.file-table tr:hover td {
  background: #1f1f1f;
}

.file-name { color: #fff; word-break: break-all; }
.file-size { color: #888; white-space: nowrap; }
.file-date { color: #666; white-space: nowrap; }
.file-actions {
  display: flex;
  gap: 6px;
  white-space: nowrap;
}

.empty-state {
  text-align: center;
  padding: 40px;
  color: #555;
  font-size: 14px;
}

/* Toast */
.toast {
  position: fixed;
  bottom: 24px;
  right: 24px;
  background: #2a2a2a;
  border: 1px solid #3a3a3a;
  border-radius: 8px;
  padding: 10px 16px;
  font-size: 13px;
  color: #e0e0e0;
  z-index: 1000;
  animation: fadeIn 0.2s;
}

.toast.success { border-color: #2a5a2a; }
.toast.error { border-color: #5a2a2a; color: #ff8888; }

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}
