/* ============================================
   UploadHub - Complete Styles
   ============================================ */

:root {
  --bg-primary: #f0f2f5;
  --bg-secondary: #ffffff;
  --bg-card: #ffffff;
  --text-primary: #1a1a2e;
  --text-secondary: #6b7280;
  --text-muted: #9ca3af;
  --border-color: #e5e7eb;
  --border-light: #f3f4f6;
  --accent: #6366f1;
  --accent-light: #eef2ff;
  --accent-hover: #4f46e5;
  --danger: #ef4444;
  --danger-light: #fef2f2;
  --danger-hover: #dc2626;
  --success: #10b981;
  --success-light: #d1fae5;
  --warning: #f59e0b;
  --warning-light: #fef3c7;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -2px rgba(0, 0, 0, 0.1);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -4px rgba(0, 0, 0, 0.1);
  --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.1);
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 20px;
  --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  --font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

[data-theme="dark"] {
  --bg-primary: #0f0f1a;
  --bg-secondary: #1a1a2e;
  --bg-card: #1e1e36;
  --text-primary: #e8e8f0;
  --text-secondary: #a0a0b8;
  --text-muted: #6b6b80;
  --border-color: #2d2d4a;
  --border-light: #252540;
  --accent-light: #1e1e3f;
  --success-light: #064e3b;
  --danger-light: #450a0a;
  --warning-light: #451a03;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.4);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.4);
  --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.4);
}

/* ============================================
   Reset & Base
   ============================================ */

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

html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--font);
  background-color: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.6;
  min-height: 100vh;
  transition: var(--transition);
}

.container {
  max-width: 960px;
  margin: 0 auto;
  padding: 0 20px;
}

/* ============================================
   Header
   ============================================ */

.header {
  background: var(--bg-secondary);
  border-bottom: 1px solid var(--border-color);
  padding: 16px 0;
  position: sticky;
  top: 0;
  z-index: 100;
  backdrop-filter: blur(12px);
  background: rgba(255, 255, 255, 0.8);
  transition: var(--transition);
}

[data-theme="dark"] .header {
  background: rgba(26, 26, 46, 0.8);
}

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

.logo {
  display: flex;
  align-items: center;
  gap: 10px;
}

.logo i {
  font-size: 28px;
  color: var(--accent);
  background: var(--accent-light);
  padding: 8px;
  border-radius: var(--radius-sm);
}

.logo h1 {
  font-size: 22px;
  font-weight: 800;
  background: linear-gradient(135deg, var(--accent), #8b5cf6);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.header-actions {
  display: flex;
  gap: 8px;
}

.theme-toggle {
  background: var(--border-light);
  border: 1px solid var(--border-color);
  color: var(--text-secondary);
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: var(--transition);
  font-size: 18px;
}

.theme-toggle:hover {
  background: var(--accent-light);
  color: var(--accent);
  border-color: var(--accent);
  transform: rotate(15deg);
}

/* ============================================
   Upload Zone
   ============================================ */

.upload-section {
  margin: 32px 0;
}

.upload-zone {
  background: var(--bg-card);
  border: 2px dashed var(--border-color);
  border-radius: var(--radius-xl);
  padding: 50px 30px;
  text-align: center;
  cursor: pointer;
  transition: var(--transition);
  position: relative;
  overflow: hidden;
}

.upload-zone::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at center, var(--accent-light), transparent 70%);
  opacity: 0;
  transition: var(--transition);
}

.upload-zone:hover {
  border-color: var(--accent);
  background: var(--accent-light);
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
}

.upload-zone:hover::before {
  opacity: 1;
}

.upload-zone.dragover {
  border-color: var(--accent);
  background: var(--accent-light);
  transform: scale(1.01);
  box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.15), var(--shadow-xl);
}

.upload-zone.dragover .upload-icon {
  animation: bounce 0.6s ease infinite;
}

.upload-zone-content {
  position: relative;
  z-index: 1;
}

.upload-icon-wrapper {
  position: relative;
  display: inline-block;
  margin-bottom: 20px;
}

.upload-icon {
  font-size: 64px;
  color: var(--accent);
  transition: var(--transition);
}

.upload-ripple {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 80px;
  height: 80px;
  transform: translate(-50%, -50%);
  border-radius: 50%;
  border: 2px solid var(--accent);
  opacity: 0.3;
  animation: ripple 2s ease-out infinite;
}

.upload-zone h2 {
  font-size: 24px;
  font-weight: 700;
  margin-bottom: 8px;
  color: var(--text-primary);
}

.upload-subtitle {
  color: var(--text-secondary);
  font-size: 15px;
  margin-bottom: 24px;
}

.upload-info {
  color: var(--text-muted);
  font-size: 13px;
  margin-top: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.upload-info i {
  font-size: 14px;
}

/* ============================================
   Buttons
   ============================================ */

.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 24px;
  border: none;
  border-radius: var(--radius-sm);
  font-family: var(--font);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
  text-decoration: none;
}

.btn-primary {
  background: linear-gradient(135deg, var(--accent), #8b5cf6);
  color: white;
  box-shadow: 0 4px 14px rgba(99, 102, 241, 0.3);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(99, 102, 241, 0.4);
}

.btn-secondary {
  background: var(--border-light);
  color: var(--text-primary);
  border: 1px solid var(--border-color);
}

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

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

.btn-danger:hover {
  background: var(--danger-hover);
  transform: translateY(-1px);
}

.btn-sm {
  padding: 8px 16px;
  font-size: 13px;
}

.btn-icon {
  width: 36px;
  height: 36px;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: transparent;
  color: var(--text-secondary);
  border: 1px solid var(--border-color);
}

.btn-icon:hover {
  background: var(--danger-light);
  color: var(--danger);
  border-color: var(--danger);
}

/* ============================================
   Progress Section
   ============================================ */

.progress-section {
  margin-bottom: 32px;
  animation: slideDown 0.4s ease;
}

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

.section-header h3 {
  font-size: 16px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--text-primary);
}

.section-header h3 i {
  color: var(--accent);
}

.progress-container {
  background: var(--bg-card);
  border-radius: var(--radius-md);
  padding: 16px;
  border: 1px solid var(--border-color);
}

.progress-item {
  margin-bottom: 12px;
}

.progress-item:last-child {
  margin-bottom: 0;
}

.progress-info {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}

.progress-filename {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-primary);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 70%;
}

.progress-status {
  font-size: 12px;
  color: var(--text-muted);
}

.progress-bar-wrapper {
  display: flex;
  align-items: center;
  gap: 12px;
}

.progress-bar {
  flex: 1;
  height: 6px;
  background: var(--border-light);
  border-radius: 10px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--accent), #8b5cf6);
  border-radius: 10px;
  width: 0%;
  transition: width 0.3s ease;
  position: relative;
}

.progress-fill::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.3), transparent);
  animation: shimmer 1.5s infinite;
}

.progress-percent {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
  min-width: 40px;
  text-align: right;
}

.progress-item.complete .progress-fill {
  background: linear-gradient(90deg, var(--success), #34d399);
}

.progress-item.complete .progress-fill::after {
  animation: none;
}

.progress-item.complete .progress-status {
  color: var(--success);
}

.progress-item.error .progress-fill {
  background: var(--danger);
}

.progress-item.error .progress-fill::after {
  animation: none;
}

.progress-item.error .progress-status {
  color: var(--danger);
}

/* ============================================
   Files Section
   ============================================ */

.files-section {
  margin-bottom: 48px;
}

.files-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.file-count {
  font-size: 13px;
  color: var(--text-muted);
  font-weight: 500;
}

.files-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
}

/* Empty State */
.empty-state {
  grid-column: 1 / -1;
  text-align: center;
  padding: 60px 20px;
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-color);
}

.empty-icon {
  width: 80px;
  height: 80px;
  margin: 0 auto 20px;
  background: var(--accent-light);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 32px;
  color: var(--accent);
}

.empty-state h3 {
  font-size: 18px;
  font-weight: 600;
  margin-bottom: 8px;
  color: var(--text-primary);
}

.empty-state p {
  color: var(--text-secondary);
  font-size: 14px;
}

/* File Card */
.file-card {
  background: var(--bg-card);
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
  overflow: hidden;
  transition: var(--transition);
  animation: fadeInUp 0.4s ease;
}

.file-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
  border-color: var(--accent);
}

.file-preview {
  width: 100%;
  height: 180px;
  object-fit: cover;
  display: block;
  background: var(--border-light);
  cursor: pointer;
}

.file-preview-placeholder {
  width: 100%;
  height: 180px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, var(--accent-light), var(--border-light));
  gap: 8px;
}

.file-preview-placeholder i {
  font-size: 48px;
  color: var(--accent);
  opacity: 0.6;
}

.file-preview-placeholder span {
  font-size: 12px;
  color: var(--text-muted);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.file-info {
  padding: 14px;
}

.file-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 6px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.file-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}

.file-size {
  font-size: 12px;
  color: var(--text-muted);
}

.file-date {
  font-size: 11px;
  color: var(--text-muted);
}

.file-actions {
  display: flex;
  gap: 8px;
}

.file-actions .btn {
  flex: 1;
  justify-content: center;
  font-size: 12px;
  padding: 8px 12px;
}

.file-actions .btn-download {
  background: var(--accent-light);
  color: var(--accent);
}

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

/* ============================================
   Lightbox
   ============================================ */

.lightbox {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.9);
  z-index: 1000;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 40px;
  backdrop-filter: blur(8px);
}

.lightbox.active {
  display: flex;
  animation: fadeIn 0.3s ease;
}

.lightbox-image {
  max-width: 90vw;
  max-height: 90vh;
  object-fit: contain;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-xl);
}

.lightbox-close {
  position: absolute;
  top: 20px;
  right: 20px;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: rgba(255,255,255,0.1);
  border: 1px solid rgba(255,255,255,0.2);
  color: white;
  font-size: 20px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition);
}

.lightbox-close:hover {
  background: rgba(255,255,255,0.2);
  transform: rotate(90deg);
}

/* ============================================
   Modal / Confirm Dialog
   ============================================ */

.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: 2000;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
  backdrop-filter: blur(4px);
}

.modal-overlay.active {
  display: flex;
  animation: fadeIn 0.2s ease;
}

.modal {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  padding: 32px;
  max-width: 400px;
  width: 100%;
  text-align: center;
  box-shadow: var(--shadow-xl);
  animation: scaleIn 0.3s ease;
}

.modal-icon {
  width: 64px;
  height: 64px;
  margin: 0 auto 16px;
  background: var(--danger-light);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 28px;
  color: var(--danger);
}

.modal-title {
  font-size: 20px;
  font-weight: 700;
  margin-bottom: 8px;
}

.modal-message {
  font-size: 14px;
  color: var(--text-secondary);
  margin-bottom: 24px;
  line-height: 1.5;
}

.modal-actions {
  display: flex;
  gap: 12px;
  justify-content: center;
}

.modal-actions .btn {
  min-width: 120px;
  justify-content: center;
}

/* ============================================
   Toast Notifications
   ============================================ */

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

.toast {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 18px;
  border-radius: var(--radius-sm);
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  box-shadow: var(--shadow-lg);
  animation: slideIn 0.3s ease;
  font-size: 14px;
  font-weight: 500;
}

.toast.toast-success {
  border-left: 4px solid var(--success);
}

.toast.toast-error {
  border-left: 4px solid var(--danger);
}

.toast.toast-info {
  border-left: 4px solid var(--accent);
}

.toast i {
  font-size: 18px;
}

.toast.toast-success i {
  color: var(--success);
}

.toast.toast-error i {
  color: var(--danger);
}

.toast.toast-info i {
  color: var(--accent);
}

.toast .toast-close {
  margin-left: auto;
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 16px;
  padding: 2px;
}

/* ============================================
   Animations
   ============================================ */

@keyframes bounce {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-8px); }
}

@keyframes ripple {
  0% { transform: translate(-50%, -50%) scale(1); opacity: 0.3; }
  100% { transform: translate(-50%, -50%) scale(1.8); opacity: 0; }
}

@keyframes shimmer {
  0% { transform: translateX(-100%); }
  100% { transform: translateX(100%); }
}

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

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

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

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

@keyframes scaleIn {
  from { opacity: 0; transform: scale(0.9); }
  to { opacity: 1; transform: scale(1); }
}

/* ============================================
   Responsive
   ============================================ */

@media (max-width: 768px) {
  .upload-zone {
    padding: 30px 20px;
  }

  .upload-zone h2 {
    font-size: 20px;
  }

  .upload-icon {
    font-size: 48px;
  }

  .files-grid {
    grid-template-columns: 1fr;
  }

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

  .files-actions {
    width: 100%;
    justify-content: space-between;
  }

  .lightbox {
    padding: 16px;
  }

  .modal {
    padding: 24px;
  }

  .toast-container {
    left: 16px;
    right: 16px;
    bottom: 16px;
    max-width: none;
  }
}

@media (max-width: 480px) {
  .upload-zone {
    padding: 24px 16px;
  }

  .upload-zone h2 {
    font-size: 18px;
  }

  .upload-icon {
    font-size: 40px;
  }

  .logo h1 {
    font-size: 18px;
  }

  .file-preview {
    height: 140px;
  }

  .file-preview-placeholder {
    height: 140px;
  }
}
