@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&family=JetBrains+Mono:wght@400;500&display=swap');

:root {
  --bg-primary: #0a0a0f;
  --bg-secondary: #12121a;
  --bg-card: #1a1a2e;
  --bg-card-hover: #22223a;
  --neon-green: #00ff88;
  --neon-cyan: #00ccff;
  --neon-purple: #b400ff;
  --text-primary: #e0e0e0;
  --text-secondary: #8888aa;
  --text-muted: #555577;
  --border-color: #2a2a3e;
  --border-glow: rgba(0, 255, 136, 0.3);
  --shadow-glow: 0 0 20px rgba(0, 255, 136, 0.1);
  --radius: 12px;
  --radius-sm: 8px;
}

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

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

::selection {
  background: var(--neon-green);
  color: var(--bg-primary);
}

::-webkit-scrollbar {
  width: 8px;
}
::-webkit-scrollbar-track {
  background: var(--bg-secondary);
}
::-webkit-scrollbar-thumb {
  background: var(--border-color);
  border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
  background: var(--neon-green);
}

.container {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 24px;
}

header {
  background: var(--bg-secondary);
  border-bottom: 1px solid var(--border-color);
  padding: 20px 0;
  position: sticky;
  top: 0;
  z-index: 100;
  backdrop-filter: blur(20px);
}

header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.logo {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
}

.logo-icon {
  width: 40px;
  height: 40px;
  background: linear-gradient(135deg, var(--neon-green), var(--neon-cyan));
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  font-weight: 800;
  color: var(--bg-primary);
}

.logo-text {
  font-size: 20px;
  font-weight: 700;
  background: linear-gradient(135deg, var(--neon-green), var(--neon-cyan));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.logo-sub {
  font-size: 12px;
  color: var(--text-muted);
  font-weight: 400;
  -webkit-text-fill-color: var(--text-muted);
}

h1 {
  font-size: 32px;
  font-weight: 800;
  margin-bottom: 8px;
}

h1 span {
  background: linear-gradient(135deg, var(--neon-green), var(--neon-cyan));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.subtitle {
  color: var(--text-secondary);
  font-size: 16px;
  margin-bottom: 32px;
}

.categorias-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 20px;
  margin-bottom: 40px;
}

.categoria-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  padding: 24px;
  text-decoration: none;
  color: var(--text-primary);
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
}

.categoria-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--neon-green), var(--neon-cyan));
  opacity: 0;
  transition: opacity 0.3s;
}

.categoria-card:hover {
  background: var(--bg-card-hover);
  border-color: var(--neon-green);
  transform: translateY(-4px);
  box-shadow: var(--shadow-glow);
}

.categoria-card:hover::before {
  opacity: 1;
}

.categoria-icon {
  width: 48px;
  height: 48px;
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 28px;
}

.categoria-name {
  font-size: 18px;
  font-weight: 700;
  margin-bottom: 4px;
}

.categoria-count {
  font-size: 13px;
  color: var(--text-muted);
  font-family: 'JetBrains Mono', monospace;
}

.page-title {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 24px;
}

.page-title a {
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 14px;
  transition: color 0.2s;
}

.page-title a:hover {
  color: var(--neon-green);
}

.page-title .sep {
  color: var(--text-muted);
  font-family: 'JetBrains Mono', monospace;
}

.section-title {
  margin: 24px 0 12px;
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--neon-green);
}

.upload-subdir-select {
  margin: 12px 0;
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--text-secondary);
  font-size: 0.9rem;
}

.upload-subdir-select select {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  color: var(--text-primary);
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  cursor: pointer;
}

.upload-subdir-select select:focus {
  border-color: var(--neon-green);
  outline: none;
}

.archivos-lista {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.archivo-item {
  display: flex;
  align-items: center;
  gap: 16px;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 14px 18px;
  transition: all 0.2s;
}

.archivo-item:hover {
  border-color: var(--border-glow);
  background: var(--bg-card-hover);
}

.archivo-icon {
  width: 36px;
  height: 36px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.archivo-icon svg {
  width: 28px;
  height: 28px;
}

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

.archivo-name {
  font-weight: 500;
  font-size: 15px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.archivo-meta {
  display: flex;
  gap: 16px;
  font-size: 12px;
  color: var(--text-muted);
  font-family: 'JetBrains Mono', monospace;
  margin-top: 2px;
}

.archivo-size {
  color: var(--neon-cyan);
}

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

.archivo-dl {
  display: flex;
  align-items: center;
  gap: 6px;
  background: transparent;
  border: 1px solid var(--border-color);
  color: var(--neon-green);
  padding: 8px 16px;
  border-radius: var(--radius-sm);
  font-family: 'Inter', sans-serif;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  transition: all 0.2s;
  flex-shrink: 0;
}

.archivo-dl:hover {
  background: var(--neon-green);
  color: var(--bg-primary);
  border-color: var(--neon-green);
  box-shadow: 0 0 20px rgba(0, 255, 136, 0.3);
}

.archivo-dl svg {
  width: 16px;
  height: 16px;
}

.archivo-del {
  display: flex;
  align-items: center;
  gap: 6px;
  background: transparent;
  border: 1px solid var(--border-color);
  color: #ff3355;
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  font-family: 'Inter', sans-serif;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  transition: all 0.2s;
  flex-shrink: 0;
  margin-left: 4px;
}

.archivo-del:hover {
  background: #ff3355;
  color: white;
  border-color: #ff3355;
  box-shadow: 0 0 20px rgba(255, 51, 85, 0.3);
}

.archivo-del svg {
  width: 16px;
  height: 16px;
}

.empty-state {
  text-align: center;
  padding: 60px 20px;
  color: var(--text-muted);
}

.empty-state svg {
  width: 64px;
  height: 64px;
  margin-bottom: 16px;
  opacity: 0.3;
}

.empty-state p {
  font-size: 16px;
}

.upload-trigger-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  background: linear-gradient(135deg, var(--neon-green), #00cc77);
  color: var(--bg-primary);
  border: none;
  padding: 10px 20px;
  border-radius: var(--radius-sm);
  font-family: 'Inter', sans-serif;
  font-weight: 600;
  font-size: 14px;
  cursor: pointer;
  transition: all 0.3s;
}

.upload-trigger-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 0 30px rgba(0, 255, 136, 0.4);
}

.upload-trigger-btn svg {
  width: 18px;
  height: 18px;
}

.drop-zone {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.85);
  backdrop-filter: blur(8px);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}

.drop-zone.active {
  display: flex;
}

.drop-zone-inner {
  background: var(--bg-card);
  border: 2px dashed var(--border-color);
  border-radius: var(--radius);
  padding: 60px 40px;
  text-align: center;
  max-width: 500px;
  width: 90%;
  transition: all 0.3s;
}

.drop-zone-inner.dragover {
  border-color: var(--neon-green);
  box-shadow: 0 0 40px rgba(0, 255, 136, 0.15);
  background: var(--bg-card-hover);
}

.drop-zone-inner svg {
  width: 64px;
  height: 64px;
  margin-bottom: 16px;
  opacity: 0.5;
}

.drop-zone-inner.dragover svg {
  opacity: 1;
}

.drop-zone-inner h3 {
  font-size: 20px;
  margin-bottom: 8px;
}

.drop-zone-inner p {
  color: var(--text-secondary);
  font-size: 14px;
  margin-bottom: 20px;
}

.drop-zone-inner .btn-select {
  background: var(--neon-green);
  color: var(--bg-primary);
  border: none;
  padding: 10px 24px;
  border-radius: var(--radius-sm);
  font-family: 'Inter', sans-serif;
  font-weight: 600;
  font-size: 14px;
  cursor: pointer;
  transition: all 0.2s;
}

.drop-zone-inner .btn-select:hover {
  box-shadow: 0 0 20px rgba(0, 255, 136, 0.4);
}

.drop-zone-inner .btn-close {
  background: transparent;
  border: 1px solid var(--border-color);
  color: var(--text-secondary);
  padding: 10px 24px;
  border-radius: var(--radius-sm);
  font-family: 'Inter', sans-serif;
  font-size: 14px;
  cursor: pointer;
  margin-left: 8px;
  transition: all 0.2s;
}

.drop-zone-inner .btn-close:hover {
  border-color: var(--text-muted);
  color: var(--text-primary);
}

.upload-progress {
  display: none;
  margin-top: 20px;
}

.upload-progress.active {
  display: block;
}

.progress-global {
  margin-bottom: 16px;
}

.progress-global-bar {
  height: 6px;
  background: var(--border-color);
  border-radius: 3px;
  overflow: hidden;
  margin-top: 6px;
}

.progress-global-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--neon-green), var(--neon-cyan));
  border-radius: 3px;
  width: 0%;
  transition: width 0.3s;
}

.progress-global-text {
  font-size: 12px;
  color: var(--text-muted);
  font-family: 'JetBrains Mono', monospace;
}

.progress-items {
  max-height: 200px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.progress-item {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 8px 12px;
  background: var(--bg-primary);
  border-radius: var(--radius-sm);
}

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

.progress-item-name {
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.progress-item-status {
  font-family: 'JetBrains Mono', monospace;
  flex-shrink: 0;
}

.progress-item-bar {
  height: 4px;
  background: var(--border-color);
  border-radius: 2px;
  overflow: hidden;
}

.progress-item-fill {
  height: 100%;
  background: var(--neon-green);
  border-radius: 2px;
  width: 0%;
  transition: width 0.2s;
}

.progress-item-fill.done {
  background: var(--neon-green);
}

.progress-item-fill.error {
  background: #ff3355;
}

.progress-item-fill.cancelled {
  background: #666;
}

.btn-cancel-item {
  background: none;
  border: none;
  color: #ff3355;
  font-size: 14px;
  cursor: pointer;
  padding: 0 4px;
  line-height: 1;
  flex-shrink: 0;
  transition: color 0.2s;
}

.btn-cancel-item:hover {
  color: #ff6688;
}

.btn-cancel-all {
  background: transparent;
  border: 1px solid #ff3355;
  color: #ff3355;
  padding: 4px 12px;
  border-radius: var(--radius-sm);
  font-family: 'Inter', sans-serif;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  margin-left: 12px;
}

.btn-cancel-all:hover {
  background: #ff3355;
  color: white;
}

.toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  z-index: 2000;
}

.toast {
  padding: 12px 20px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 500;
  animation: slideIn 0.3s ease;
  max-width: 360px;
}

.toast.success {
  background: var(--neon-green);
  color: var(--bg-primary);
}

.toast.error {
  background: #ff3355;
  color: white;
}

@keyframes slideIn {
  from {
    transform: translateX(100%);
    opacity: 0;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}

.btn-logout {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  background: transparent;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  text-decoration: none;
  transition: all 0.2s;
  flex-shrink: 0;
}

.btn-logout:hover {
  border-color: #ff3355;
  color: #ff3355;
  box-shadow: 0 0 15px rgba(255, 51, 85, 0.2);
}

.btn-logout svg {
  width: 18px;
  height: 18px;
}

@media (max-width: 768px) {
  .categorias-grid {
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 12px;
  }

  .logo-text {
    font-size: 16px;
  }

  h1 {
    font-size: 24px;
  }

  .archivo-item {
    flex-wrap: wrap;
  }

  .archivo-dl {
    width: 100%;
    justify-content: center;
    margin-top: 8px;
  }
}
