/* Google Fonts - Inter */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&display=swap');

:root {
  --bg-primary: #030712;
  --bg-secondary: #0b0f19;
  --glass-bg: rgba(17, 24, 39, 0.75);
  --glass-border: rgba(255, 255, 255, 0.08);
  --text-primary: #f3f4f6;
  --text-secondary: #9ca3af;
  --accent-primary: #6366f1;
  --accent-secondary: #818cf8;
  --accent-gradient: linear-gradient(135deg, #6366f1, #a855f7);
  --danger-color: #ef4444;
  --danger-hover: #dc2626;
  --success-color: #10b981;
  --card-shadow: 0 20px 40px -15px rgba(0, 0, 0, 0.7);
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --border-radius-lg: 20px;
  --border-radius-md: 14px;
  --border-radius-sm: 10px;
}

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

body {
  font-family: var(--font-sans);
  background-color: var(--bg-primary);
  background-image: 
    radial-gradient(circle at 10% 20%, rgba(99, 102, 241, 0.08) 0%, transparent 40%),
    radial-gradient(circle at 90% 80%, rgba(168, 85, 247, 0.08) 0%, transparent 40%);
  color: var(--text-primary);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  line-height: 1.5;
  overflow-x: hidden;
}

/* Header */
header {
  background: rgba(3, 7, 18, 0.5);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--glass-border);
  padding: 1.25rem 2rem;
  position: sticky;
  top: 0;
  z-index: 100;
}

.header-container {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.logo-section {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.logo-icon {
  background: var(--accent-gradient);
  color: white;
  width: 40px;
  height: 40px;
  border-radius: var(--border-radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  box-shadow: 0 4px 15px rgba(99, 102, 241, 0.4);
}

.logo-text {
  font-size: 1.5rem;
  font-weight: 800;
  background: var(--accent-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  letter-spacing: -0.025em;
}

.logo-badge {
  background: rgba(99, 102, 241, 0.12);
  color: var(--accent-secondary);
  border: 1px solid rgba(99, 102, 241, 0.25);
  font-size: 0.75rem;
  font-weight: 600;
  padding: 0.15rem 0.6rem;
  border-radius: 9999px;
  margin-left: 0.5rem;
  vertical-align: middle;
}

/* Main Dashboard & Containers */
.dashboard-container {
  display: none; /* Controlled by JS */
  max-width: 1200px;
  width: 100%;
  margin: 2.5rem auto;
  padding: 0 2rem;
  grid-template-columns: 1.2fr 1fr;
  gap: 2.5rem;
  flex: 1;
}

@media (max-width: 968px) {
  .dashboard-container {
    grid-template-columns: 1fr;
    gap: 2rem;
    margin: 1.5rem auto;
    padding: 0 1rem;
  }
}

/* Login Gate styling */
.login-gate-container {
  display: flex;
  align-items: center;
  justify-content: center;
  flex: 1;
  padding: 2rem 1rem;
}

.login-card {
  max-width: 420px;
  width: 100%;
  text-align: center;
  animation: fadeIn 0.4s ease;
}

.login-input-group {
  margin: 1.5rem 0 1.25rem 0;
  position: relative;
}

.login-input {
  width: 100%;
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid var(--glass-border);
  border-radius: var(--border-radius-sm);
  padding: 0.85rem 1.2rem;
  color: var(--text-primary);
  font-size: 1rem;
  outline: none;
  text-align: center;
  transition: all 0.3s ease;
}

.login-input:focus {
  border-color: var(--accent-secondary);
  box-shadow: 0 0 15px rgba(99, 102, 241, 0.15);
}

/* Glass Card */
.glass-card {
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: var(--border-radius-lg);
  padding: 2.25rem;
  box-shadow: var(--card-shadow);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

/* Upload Area */
.upload-zone {
  border: 2px dashed rgba(255, 255, 255, 0.12);
  border-radius: var(--border-radius-md);
  padding: 3.5rem 2rem;
  text-align: center;
  cursor: pointer;
  transition: all 0.3s ease;
  background: rgba(255, 255, 255, 0.005);
}

.upload-zone:hover, .upload-zone.dragover {
  border-color: var(--accent-secondary);
  background: rgba(99, 102, 241, 0.03);
}

.upload-icon {
  font-size: 3rem;
  margin-bottom: 1.25rem;
  color: var(--accent-secondary);
  transition: transform 0.3s ease;
}

.upload-zone:hover .upload-icon {
  transform: translateY(-4px);
}

.upload-text {
  font-size: 1.1rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
  color: var(--text-primary);
}

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

#fileInput {
  display: none;
}

/* Progress Container */
.progress-container {
  margin-top: 1.5rem;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--glass-border);
  border-radius: var(--border-radius-md);
  padding: 1.25rem;
  display: none;
}

.progress-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.75rem;
}

.file-info {
  display: flex;
  flex-direction: column;
  max-width: 70%;
}

.file-name {
  font-weight: 600;
  font-size: 0.95rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

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

.progress-percent {
  font-weight: 700;
  font-size: 1.1rem;
  color: var(--accent-secondary);
}

.progress-bar-wrapper {
  background: rgba(255, 255, 255, 0.08);
  height: 8px;
  border-radius: 999px;
  overflow: hidden;
  margin-bottom: 0.75rem;
}

.progress-bar-fill {
  background: var(--accent-gradient);
  height: 100%;
  width: 0%;
  border-radius: 999px;
  transition: width 0.1s ease;
}

.progress-stats {
  display: flex;
  justify-content: space-between;
  font-size: 0.8rem;
  color: var(--text-secondary);
}

/* Shareable Link Container */
.link-output-container {
  margin-top: 1.5rem;
  display: none;
  animation: fadeIn 0.4s ease;
}

.link-output-box {
  display: flex;
  gap: 0.5rem;
  margin-top: 0.5rem;
}

.link-input {
  flex: 1;
  background: rgba(0, 0, 0, 0.4);
  border: 1px solid var(--glass-border);
  border-radius: var(--border-radius-sm);
  padding: 0.75rem 1rem;
  color: var(--text-primary);
  font-family: monospace;
  font-size: 0.9rem;
  outline: none;
  width: 100%;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.8rem 1.5rem;
  border-radius: var(--border-radius-sm);
  font-weight: 600;
  font-size: 0.95rem;
  cursor: pointer;
  transition: all 0.2s ease;
  border: none;
  outline: none;
}

.btn-primary {
  background: var(--accent-gradient);
  color: white;
  box-shadow: 0 4px 15px rgba(99, 102, 241, 0.25);
}

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

.btn-secondary {
  background: rgba(255, 255, 255, 0.06);
  color: var(--text-primary);
  border: 1px solid var(--glass-border);
}

.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.12);
}

.btn-danger {
  background: rgba(239, 68, 68, 0.08);
  color: var(--danger-color);
  border: 1px solid rgba(239, 68, 68, 0.2);
}

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

/* Right Section - File List */
.list-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.5rem;
}

.list-title {
  font-size: 1.25rem;
  font-weight: 700;
}

.refresh-btn {
  background: none;
  border: none;
  color: var(--text-secondary);
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.25rem;
  font-size: 0.85rem;
  font-weight: 500;
  transition: color 0.2s ease;
}

.refresh-btn:hover {
  color: var(--text-primary);
}

.file-list {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  max-height: 500px;
  overflow-y: auto;
  padding-right: 0.25rem;
}

/* Custom Scrollbar for list */
.file-list::-webkit-scrollbar {
  width: 6px;
}

.file-list::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.01);
  border-radius: 99px;
}

.file-list::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.08);
  border-radius: 99px;
}

.file-list::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.15);
}

.empty-state {
  text-align: center;
  padding: 3.5rem 1rem;
  color: var(--text-secondary);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.75rem;
}

.empty-icon {
  font-size: 2.5rem;
  opacity: 0.4;
}

.file-item {
  background: rgba(255, 255, 255, 0.015);
  border: 1px solid var(--glass-border);
  border-radius: var(--border-radius-md);
  padding: 1.1rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  transition: all 0.2s ease;
}

.file-item:hover {
  background: rgba(255, 255, 255, 0.035);
  border-color: rgba(255, 255, 255, 0.12);
}

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

.file-item-name {
  font-weight: 600;
  font-size: 0.95rem;
  margin-bottom: 0.3rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.file-item-meta {
  font-size: 0.75rem;
  color: var(--text-secondary);
  display: flex;
  gap: 0.75rem;
}

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

.icon-btn {
  width: 36px;
  height: 36px;
  border-radius: var(--border-radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--glass-border);
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.2s ease;
}

.icon-btn:hover {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-primary);
  transform: translateY(-1px);
}

.icon-btn-danger:hover {
  background: rgba(239, 68, 68, 0.12);
  color: var(--danger-color);
  border-color: rgba(239, 68, 68, 0.25);
}

/* Footer */
footer {
  text-align: center;
  padding: 2rem;
  color: var(--text-secondary);
  font-size: 0.85rem;
  border-top: 1px solid var(--glass-border);
  background: rgba(3, 7, 18, 0.3);
  margin-top: auto;
}

/* Download Page Specific Styling */
.download-container {
  max-width: 580px; /* Centered, clean single-card view */
  margin: auto;
  padding: 3rem 1.5rem;
  width: 100%;
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
}

.download-card {
  text-align: center;
  width: 100%;
  padding: 3rem 2.5rem;
}

.download-icon-wrapper {
  background: rgba(99, 102, 241, 0.08);
  color: var(--accent-secondary);
  width: 72px;
  height: 72px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 1.75rem auto;
  border: 1px solid rgba(99, 102, 241, 0.2);
  box-shadow: 0 0 25px rgba(99, 102, 241, 0.1);
}

.download-title {
  font-size: 1.6rem;
  font-weight: 700;
  margin-bottom: 0.75rem;
  word-break: break-all;
  line-height: 1.3;
}

.download-meta-table {
  display: flex;
  justify-content: center;
  gap: 2rem;
  margin: 1.75rem 0 2.25rem 0;
  flex-wrap: wrap;
  border-top: 1px solid var(--glass-border);
  border-bottom: 1px solid var(--glass-border);
  padding: 1.25rem 0;
}

.download-meta-item {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.meta-label {
  font-size: 0.75rem;
  text-transform: uppercase;
  color: var(--text-secondary);
  letter-spacing: 0.05em;
  margin-bottom: 0.25rem;
}

.meta-value {
  font-weight: 600;
  font-size: 1.05rem;
}

.download-actions {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
}

.big-download-btn {
  padding: 1.1rem 2.5rem;
  font-size: 1.1rem;
  border-radius: var(--border-radius-sm);
  width: 100%;
  max-width: 320px;
}

/* Toast Notification styling */
.toast-container {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  z-index: 1000;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.toast {
  background: rgba(17, 24, 39, 0.95);
  border: 1px solid var(--glass-border);
  color: var(--text-primary);
  padding: 1rem 1.5rem;
  border-radius: var(--border-radius-md);
  box-shadow: 0 10px 25px rgba(0,0,0,0.5);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  gap: 0.75rem;
  transform: translateY(100px);
  opacity: 0;
  animation: slideIn 0.3s forwards ease;
  min-width: 280px;
}

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

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

/* Animations */
@keyframes slideIn {
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

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

.spinning {
  animation: spin 1s linear infinite;
}

@keyframes spin {
  100% { transform: rotate(360deg); }
}
