:root {
  --bg-gradient: radial-gradient(circle at top left, #1e1b4b, #0f172a, #020617);
  --panel-bg: rgba(15, 23, 42, 0.65);
  --border-color: rgba(255, 255, 255, 0.08);
  --accent-color: #3b82f6;
  --accent-hover: #2563eb;
  --text-primary: #f8fafc;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;
  --shadow-lg: 0 10px 25px -5px rgba(0, 0, 0, 0.5), 0 8px 10px -6px rgba(0, 0, 0, 0.5);
  --card-glow: 0 0 20px rgba(59, 130, 246, 0.15);
}

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

body {
  font-family: 'Outfit', system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background: var(--bg-gradient);
  color: var(--text-primary);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

header {
  padding: 1.5rem 2rem;
  border-bottom: 1px solid var(--border-color);
  backdrop-filter: blur(12px);
  background: rgba(15, 23, 42, 0.4);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.logo {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 1.5rem;
  font-weight: 700;
  background: linear-gradient(135deg, #3b82f6, #8b5cf6);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

main {
  flex: 1;
  max-width: 1200px;
  width: 100%;
  margin: 0 auto;
  padding: 2rem;
  display: flex;
  flex-direction: column;
  gap: 2rem;
}

.dashboard-layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2rem;
}

@media (max-width: 1024px) {
  .dashboard-layout {
    grid-template-columns: 1fr;
  }
}

.card {
  background: var(--panel-bg);
  backdrop-filter: blur(16px);
  border: 1px solid var(--border-color);
  border-radius: 16px;
  padding: 1.75rem;
  box-shadow: var(--shadow-lg);
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 4px;
  background: linear-gradient(90deg, var(--accent-color), transparent);
}

.hidden {
  display: none !important;
}

.drop-zone-container {
  min-height: 250px;
  display: flex;
  flex: 1;
}

.drop-zone {
  flex: 1;
  border: 2px dashed rgba(16, 185, 129, 0.3);
  border-radius: 12px;
  background: rgba(0, 0, 0, 0.25);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  padding: 2rem;
  cursor: pointer;
  text-align: center;
  transition: all 0.25s ease;
}

.drop-zone:hover, .drop-zone.dragover {
  border-color: var(--accent-color);
  background: rgba(59, 130, 246, 0.05);
  box-shadow: var(--card-glow);
}

.drop-icon {
  color: var(--text-secondary);
  transition: transform 0.2s ease, color 0.2s ease;
}

.drop-zone:hover .drop-icon, .drop-zone.dragover .drop-icon {
  transform: translateY(-4px);
  color: var(--accent-color);
}

.browse-link {
  color: var(--accent-color);
  text-decoration: underline;
  font-weight: 600;
}

.file-name-display {
  font-size: 0.85rem;
  color: var(--text-muted);
  word-break: break-all;
  max-width: 100%;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-bottom: 1rem;
}

select {
  width: 100%;
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 0.75rem 1rem;
  color: #3b82f6;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.95rem;
  outline: none;
  transition: all 0.2s ease;
}

select option {
  background: #0f172a;
  color: #f8fafc;
}

select:focus {
  border-color: var(--accent-color);
  box-shadow: var(--card-glow);
}

.preview-container {
  border: 1px solid var(--border-color);
  border-radius: 12px;
  background: rgba(0, 0, 0, 0.3);
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  flex: 1;
}

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

.preview-header h3 {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--text-primary);
}

.media-preview {
  display: flex;
  justify-content: center;
  align-items: center;
  background: rgba(0, 0, 0, 0.4);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 1rem;
  min-height: 180px;
  max-height: 350px;
  overflow: hidden;
}

.media-preview img, .media-preview canvas {
  max-width: 100%;
  max-height: 320px;
  object-fit: contain;
  border-radius: 4px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.5);
}

.file-info-details {
  font-size: 0.9rem;
  color: var(--text-secondary);
  background: rgba(255, 255, 255, 0.02);
  padding: 0.75rem;
  border-radius: 6px;
  border: 1px solid rgba(255, 255, 255, 0.03);
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.file-info-row {
  display: flex;
  justify-content: space-between;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  padding-bottom: 0.25rem;
}

.file-info-row:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

.file-info-label {
  color: var(--text-muted);
}

.file-info-value {
  font-weight: 600;
  font-family: 'JetBrains Mono', monospace;
  color: var(--text-primary);
}

.btn-bar {
  display: flex;
  gap: 1rem;
  justify-content: flex-end;
  margin-top: auto;
}

.btn-primary {
  background: var(--accent-color);
  color: #fff;
  border: none;
  padding: 0.75rem 1.5rem;
  font-size: 1rem;
  font-weight: 600;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s ease;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}

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

.btn-primary:disabled {
  background: var(--text-muted);
  cursor: not-allowed;
  opacity: 0.7;
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-color);
  color: var(--text-primary);
  padding: 0.75rem 1.5rem;
  font-size: 1rem;
  font-weight: 600;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s ease;
}

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

.loader {
  border: 3px solid rgba(255, 255, 255, 0.1);
  border-radius: 50%;
  border-top: 3px solid var(--accent-color);
  width: 24px;
  height: 24px;
  -webkit-animation: spin 1s linear infinite;
  animation: spin 1s linear infinite;
}

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

.seo-section {
  color: var(--text-secondary);
  line-height: 1.7;
}

.seo-section h2 {
  color: var(--text-primary);
  margin-bottom: 1rem;
  font-size: 1.5rem;
}

.seo-section p {
  margin-bottom: 1rem;
}

footer {
  border-top: 1px solid var(--border-color);
  background: rgba(15, 23, 42, 0.8);
  backdrop-filter: blur(12px);
  padding: 3rem 2rem 1.5rem 2rem;
  margin-top: auto;
}

.footer-grid {
  max-width: 1200px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 2.5rem;
  margin-bottom: 3rem;
}

@media (max-width: 768px) {
  .footer-grid {
    grid-template-columns: 1fr;
  }
}

.footer-col h3 {
  font-size: 1.1rem;
  font-weight: 700;
  margin-bottom: 1.25rem;
  color: var(--text-primary);
}

.footer-col ul {
  list-style: none;
}

.footer-col ul li {
  margin-bottom: 0.75rem;
}

.footer-col ul li a {
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 0.95rem;
  transition: color 0.2s ease;
}

.footer-col ul li a:hover {
  color: var(--accent-color);
}

.footer-bottom {
  max-width: 1200px;
  margin: 0 auto;
  padding-top: 1.5rem;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
}

.footer-bottom p {
  font-size: 0.85rem;
  color: var(--text-muted);
}

.lang-selector {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.lang-link {
  font-size: 0.8rem;
  color: var(--text-muted);
  text-decoration: none;
  text-transform: uppercase;
  padding: 0.2rem 0.4rem;
  border-radius: 4px;
  border: 1px solid transparent;
  transition: all 0.2s ease;
}

.lang-link:hover, .lang-link.active {
  color: var(--accent-color);
  border-color: rgba(59, 130, 246, 0.2);
  background: rgba(59, 130, 246, 0.05);
}

@media (max-width: 768px) {
  header {
    margin-bottom: 2.5rem !important;
  }
  .dashboard-layout,
  main,
  .footer-grid,
  .card {
    display: flex !important;
    flex-direction: column !important;
    width: 100% !important;
  }
  .dashboard-layout {
    margin-bottom: 2.5rem !important;
  }
  .dashboard-layout > * {
    width: 100% !important;
    margin-bottom: 1.5rem;
  }
}

/* File list & queue cards */
.queue-container {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

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

.queue-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.75rem;
}

.queue-item {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 1rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
}

@media (max-width: 640px) {
  .queue-item {
    flex-direction: column;
    align-items: stretch;
    gap: 0.75rem;
  }
}

.item-info {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.item-thumbnail {
  width: 50px;
  height: 50px;
  border-radius: 6px;
  border: 1px solid var(--border-color);
  object-fit: cover;
  background: #000;
}

.item-details {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

.item-name {
  font-weight: 600;
  font-size: 0.95rem;
  word-break: break-all;
}

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

.item-status {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.badge {
  padding: 0.25rem 0.5rem;
  border-radius: 4px;
  font-size: 0.75rem;
  font-weight: 600;
}

.badge-pending {
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-secondary);
}

.badge-success {
  background: rgba(16, 185, 129, 0.15);
  color: #3b82f6;
}

.badge-error {
  background: rgba(239, 68, 68, 0.15);
  color: #ef4444;
}

.action-bar {
  display: flex;
  justify-content: flex-end;
  gap: 1rem;
}


.btn-icon {
  background: transparent;
  color: var(--accent-color);
  border: 1px solid var(--accent-color);
  border-radius: 4px;
  padding: 0.2rem 0.4rem;
  cursor: pointer !important;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
}
.btn-icon:hover {
  background: var(--accent-color);
  color: #fff;
}

