:root {
  --bg: #0f172a;
  --surface: #1e293b;
  --surface-light: #273549;
  --primary: #38bdf8;
  --primary-dark: #0ea5e9;
  --text: #f8fafc;
  --muted: #94a3b8;
  --danger: #f87171;
  --border: rgba(148, 163, 184, 0.2);
  font-family: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: radial-gradient(circle at top, rgba(56, 189, 248, 0.2), transparent 45%), var(--bg);
  color: var(--text);
}

a {
  color: var(--primary);
}

main {
  max-width: 1200px;
  margin: 0 auto;
  padding: 2rem 1.5rem 4rem;
}

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

button,
input,
select,
textarea {
  font: inherit;
}

button {
  padding: 0.75rem 1.25rem;
  border-radius: 0.75rem;
  border: none;
  color: var(--bg);
  background: linear-gradient(120deg, var(--primary), var(--primary-dark));
  cursor: pointer;
  transition: transform 0.1s ease, box-shadow 0.1s ease;
}

button:hover {
  transform: translateY(-1px);
  box-shadow: 0 10px 20px rgba(14, 165, 233, 0.25);
}

button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

button.edit-btn,
button.delete-btn {
  padding: 0.5rem 1rem;
  font-size: 0.9rem;
}

button.delete-btn {
  background: var(--danger);
}

button.delete-btn:hover {
  box-shadow: 0 10px 20px rgba(248, 113, 113, 0.25);
}

input,
select,
textarea {
  width: 100%;
  padding: 0.75rem 1rem;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(148, 163, 184, 0.3);
  border-radius: 0.75rem;
  color: inherit;
}

label {
  display: block;
  margin-bottom: 0.5rem;
  font-weight: 600;
}

.card {
  background: rgba(15, 23, 42, 0.75);
  border: 1px solid rgba(148, 163, 184, 0.2);
  border-radius: 1rem;
  padding: 1.5rem;
  margin-bottom: 1.5rem;
  box-shadow: 0 20px 45px rgba(15, 23, 42, 0.35);
}

.tabs {
  display: flex;
  gap: 1rem;
  margin-bottom: 1rem;
}

.tab-button {
  background: var(--surface);
  color: var(--muted);
  padding: 0.5rem 1.5rem;
  border-radius: 999px;
}

.tab-button.active {
  color: var(--text);
  background: var(--primary-dark);
}

.tab-panel {
  margin-top: 0.5rem;
}

.tab-panel[hidden] {
  display: none;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1rem;
}

.video-player {
  width: 100%;
  border-radius: 1rem;
  overflow: hidden;
  border: 1px solid rgba(148, 163, 184, 0.2);
  background: #000;
}

.video-player video {
  width: 100%;
  display: block;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.35rem 0.75rem;
  border-radius: 999px;
  font-size: 0.85rem;
  background: rgba(56, 189, 248, 0.15);
  color: var(--primary);
}

.muted {
  color: var(--muted);
}

.job-list {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.job-card {
  background: var(--surface);
  border-radius: 0.9rem;
  padding: 1rem 1.25rem;
  border: 1px solid rgba(148, 163, 184, 0.2);
}

.progress-bar {
  height: 10px;
  border-radius: 999px;
  background: rgba(148, 163, 184, 0.25);
  overflow: hidden;
}

.progress-bar span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(120deg, var(--primary), var(--primary-dark));
  transition: width 0.3s ease;
}

.toast {
  position: fixed;
  top: 1.5rem;
  right: 1.5rem;
  background: var(--surface);
  border: 1px solid rgba(56, 189, 248, 0.4);
  color: var(--text);
  padding: 1rem 1.5rem;
  border-radius: 0.75rem;
  box-shadow: 0 15px 30px rgba(15, 23, 42, 0.35);
  z-index: 999;
  display: none;
}

.toast.success {
  border-color: #22c55e;
  background: rgba(34, 197, 94, 0.1);
}

.toast.error {
  border-color: var(--danger);
  background: rgba(248, 113, 113, 0.1);
}

.toast.info {
  border-color: var(--primary);
  background: rgba(56, 189, 248, 0.1);
}

.breadcrumb {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 0.5rem;
  font-size: 0.9rem;
  flex-wrap: wrap;
}

.breadcrumb-item {
  cursor: pointer;
  color: var(--primary);
  transition: color 0.2s;
}

.breadcrumb-item:hover {
  color: var(--primary-dark);
  text-decoration: underline;
}

.breadcrumb-separator {
  color: var(--muted);
}

.folder-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem;
  cursor: pointer;
  border-radius: 0.5rem;
  transition: background 0.2s;
}

.folder-item:hover {
  background: rgba(56, 189, 248, 0.1);
}

.folder-icon {
  font-size: 1.2rem;
}

.file-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.5rem;
  border-bottom: 1px solid rgba(148, 163, 184, 0.2);
}

.modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.7);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2000;
}

.modal[hidden] {
  display: none;
}

.modal-content {
  background: var(--surface);
  padding: 2rem;
  border-radius: 1rem;
  min-width: 400px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}

.modal-content h3 {
  margin: 0 0 1rem 0;
}

.modal-content input {
  width: 100%;
}

/* Resolution rows styling */
.resolution-row {
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.resolution-row:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(56, 189, 248, 0.15);
}

/* Custom scrollbar for resolutions container */
#resolutions-container::-webkit-scrollbar {
  width: 8px;
}

#resolutions-container::-webkit-scrollbar-track {
  background: rgba(148, 163, 184, 0.1);
  border-radius: 4px;
}

#resolutions-container::-webkit-scrollbar-thumb {
  background: rgba(56, 189, 248, 0.3);
  border-radius: 4px;
}

#resolutions-container::-webkit-scrollbar-thumb:hover {
  background: rgba(56, 189, 248, 0.5);
}

@media (max-width: 768px) {
  main {
    padding: 1.5rem 1rem 3rem;
  }

  .tabs {
    flex-wrap: wrap;
  }
  
  .modal-content {
    min-width: 90%;
  }
}
