:root {
  --primary: #6366f1;
  --primary-dark: #4f46e5;
  --primary-light: #818cf8;
  --secondary: #ec4899;
  --background: #0f172a;
  --surface: #1e293b;
  --surface-light: #334155;
  --text: #f1f5f9;
  --text-muted: #94a3b8;
  --border: #334155;
  --shadow: rgba(0, 0, 0, 0.3);
  --gradient: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

* {
  box-sizing: border-box;
}

body {
  font-family: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Arial, sans-serif;
  margin: 0;
  background: var(--background);
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.top-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(30, 41, 59, 0.8);
  backdrop-filter: blur(10px);
  color: var(--text);
  padding: 1rem 2rem;
  position: sticky;
  top: 0;
  z-index: 100;
  border-bottom: 1px solid var(--border);
  box-shadow: 0 4px 6px -1px var(--shadow);
}

.top-bar h1 {
  margin: 0;
  font-size: 1.5rem;
  font-weight: 700;
  background: var(--gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.top-bar h1 a {
  color: inherit;
  text-decoration: none;
  background: inherit;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.top-bar nav {
  display: flex;
  gap: 0.5rem;
  align-items: center;
}

.top-bar nav a {
  color: var(--text-muted);
  text-decoration: none;
  padding: 0.5rem 1rem;
  border-radius: 0.5rem;
  transition: all 0.3s ease;
  font-weight: 500;
  font-size: 0.95rem;
}

.top-bar nav a:hover {
  color: var(--text);
  background: var(--surface-light);
  transform: translateY(-1px);
}

main {
  padding: 2rem;
  max-width: 1400px;
  margin: 0 auto;
  width: 100%;
  flex: 1;
}

footer {
  text-align: center;
  font-size: 0.875rem;
  color: var(--text-muted);
  padding: 2rem;
  border-top: 1px solid var(--border);
  background: rgba(30, 41, 59, 0.5);
  backdrop-filter: blur(10px);
}

.video-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 1.5rem;
  list-style: none;
  padding: 0;
  margin: 2rem 0;
}

.video-list li {
  background: var(--surface);
  border-radius: 1rem;
  overflow: hidden;
  border: 1px solid var(--border);
  transition: all 0.3s ease;
  display: flex;
  flex-direction: column;
  box-shadow: 0 4px 6px -1px var(--shadow);
}

.video-list li:hover {
  transform: translateY(-4px);
  box-shadow: 0 20px 25px -5px var(--shadow), 0 10px 10px -5px var(--shadow);
  border-color: var(--primary);
}

.video-info {
  padding: 1.25rem;
  flex: 1;
}

.video-name {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 0.5rem;
  word-break: break-word;
}

.video-icon {
  width: 100%;
  height: 180px;
  background: linear-gradient(135deg, rgba(102, 126, 234, 0.1) 0%, rgba(118, 75, 162, 0.1) 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 4rem;
  border-bottom: 1px solid var(--border);
}

.button {
  padding: 0.75rem 1.5rem;
  background: var(--gradient);
  color: var(--text) !important;
  border-radius: 0.75rem;
  font-size: 0.95rem;
  font-weight: 600;
  text-decoration: none;
  display: inline-block;
  transition: all 0.3s ease;
  border: none;
  cursor: pointer;
  box-shadow: 0 4px 6px -1px var(--shadow);
}

.button:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 15px -3px var(--shadow);
  opacity: 0.9;
}

.button-full {
  width: 100%;
  text-align: center;
  margin: 0.5rem 0;
}

.form-card {
  display: grid;
  gap: 1.25rem;
  background: var(--surface);
  padding: 2rem;
  border-radius: 1rem;
  max-width: 500px;
  box-shadow: 0 10px 15px -3px var(--shadow);
  border: 1px solid var(--border);
}

label {
  font-weight: 600;
  color: var(--text);
  font-size: 0.95rem;
  margin-bottom: 0.5rem;
  display: block;
}

input[type="password"],
input[type="file"] {
  padding: 0.875rem;
  border: 1px solid var(--border);
  border-radius: 0.75rem;
  background: var(--background);
  color: var(--text);
  font-size: 1rem;
  transition: all 0.3s ease;
  width: 100%;
}

input[type="password"]:focus,
input[type="file"]:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

input[type="file"]::file-selector-button {
  padding: 0.5rem 1rem;
  background: var(--surface-light);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 0.5rem;
  cursor: pointer;
  transition: all 0.3s ease;
  margin-right: 1rem;
}

input[type="file"]::file-selector-button:hover {
  background: var(--primary);
}

.upload-section {
  max-width: 960px;
  margin: 0 auto;
}

.upload-subtitle {
  color: var(--text-muted);
  margin-bottom: 1.5rem;
  max-width: 720px;
}

.upload-form {
  display: grid;
  gap: 1.5rem;
  background: var(--surface);
  padding: 2rem;
  border-radius: 1rem;
  border: 1px solid var(--border);
  box-shadow: 0 10px 15px -3px var(--shadow);
}

.upload-grid {
  display: grid;
  gap: 1.5rem;
  grid-template-columns: minmax(0, 1fr);
}

@media (min-width: 768px) {
  .upload-grid {
    grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr);
  }
}

.upload-dropzone {
  position: relative;
  border: 2px dashed rgba(99, 102, 241, 0.6);
  border-radius: 1rem;
  padding: 2rem;
  text-align: center;
  background: rgba(99, 102, 241, 0.08);
  transition: all 0.3s ease;
  cursor: pointer;
  outline: none;
}

.upload-dropzone:hover,
.upload-dropzone:focus-visible {
  border-color: var(--primary);
  box-shadow: 0 10px 20px -5px var(--shadow);
  transform: translateY(-2px);
}

.upload-dropzone.is-dragover {
  border-color: var(--secondary);
  background: rgba(236, 72, 153, 0.12);
}

.upload-dropzone.is-disabled {
  opacity: 0.6;
  pointer-events: none;
  transform: none;
}

.dropzone-content {
  display: grid;
  gap: 0.75rem;
  justify-items: center;
}

.dropzone-icon {
  font-size: 2.5rem;
}

.dropzone-button {
  background: none;
  border: none;
  color: var(--primary-light);
  font-weight: 600;
  cursor: pointer;
  padding: 0;
}

.dropzone-button:hover {
  color: var(--primary);
  text-decoration: underline;
}

.dropzone-hint {
  color: var(--text-muted);
  font-size: 0.875rem;
  margin: 0;
}

.upload-details {
  background: var(--surface-light);
  border: 1px solid var(--border);
  border-radius: 1rem;
  padding: 1.5rem;
  display: grid;
  gap: 1rem;
  box-shadow: 0 6px 12px -4px var(--shadow);
}

.upload-details h3 {
  margin: 0;
  font-size: 1.1rem;
  color: var(--text);
}

.upload-meta {
  display: grid;
  gap: 0.75rem;
  margin: 0;
}

.upload-meta div {
  display: flex;
  justify-content: space-between;
  font-size: 0.95rem;
}

.upload-meta dt {
  color: var(--text-muted);
  font-weight: 500;
}

.upload-meta dd {
  margin: 0;
  font-weight: 600;
  color: var(--text);
  text-align: right;
}

.form-field {
  display: grid;
  gap: 0.5rem;
}

.field-hint {
  margin: 0;
  font-size: 0.85rem;
  color: var(--text-muted);
}

.upload-progress {
  width: 100%;
  height: 12px;
  background: rgba(99, 102, 241, 0.1);
  border-radius: 999px;
  overflow: hidden;
  border: 1px solid rgba(99, 102, 241, 0.2);
}

.upload-progress-bar {
  height: 100%;
  width: 0%;
  background: var(--gradient);
  transition: width 0.2s ease;
}

.upload-progress-label {
  font-size: 0.85rem;
  color: var(--text-muted);
  text-align: right;
}

.upload-status {
  min-height: 1.25rem;
  font-size: 0.95rem;
  color: var(--text-muted);
  margin: 0;
}

.upload-status--error {
  color: #fca5a5;
}

.upload-status--success {
  color: #86efac;
}

.upload-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.button-secondary {
  background: transparent;
  color: var(--text-muted) !important;
  border: 1px solid var(--border);
  box-shadow: none;
}

.button-secondary:hover {
  color: var(--text) !important;
  background: var(--surface-light);
}

.upload-guidelines {
  margin: 0;
  padding-left: 1.2rem;
  color: var(--text-muted);
  font-size: 0.9rem;
  display: grid;
  gap: 0.35rem;
}

button {
  padding: 0.875rem 1.5rem;
  background: var(--gradient);
  color: var(--text);
  border: none;
  border-radius: 0.75rem;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 4px 6px -1px var(--shadow);
}

button:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 15px -3px var(--shadow);
  opacity: 0.9;
}

.flash-container {
  margin-bottom: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.flash {
  padding: 1rem 1.25rem;
  border-radius: 0.75rem;
  font-weight: 500;
  border: 1px solid;
  backdrop-filter: blur(10px);
  animation: slideIn 0.3s ease;
}

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

.flash-info {
  background: rgba(59, 130, 246, 0.1);
  color: #93c5fd;
  border-color: rgba(59, 130, 246, 0.3);
}

.flash-error {
  background: rgba(239, 68, 68, 0.1);
  color: #fca5a5;
  border-color: rgba(239, 68, 68, 0.3);
}

.flash-success {
  background: rgba(34, 197, 94, 0.1);
  color: #86efac;
  border-color: rgba(34, 197, 94, 0.3);
}

.callout {
  margin-top: 2rem;
  background: rgba(168, 85, 247, 0.1);
  padding: 1.5rem;
  border-radius: 1rem;
  border: 1px solid rgba(168, 85, 247, 0.3);
  backdrop-filter: blur(10px);
}

.callout p {
  margin: 0;
  color: var(--text);
}

.callout a {
  color: var(--primary-light);
  text-decoration: none;
  font-weight: 600;
  transition: color 0.3s ease;
}

.callout a:hover {
  color: var(--primary);
  text-decoration: underline;
}

.log-table {
  width: 100%;
  border-collapse: collapse;
  background: var(--surface);
  border-radius: 1rem;
  overflow: hidden;
  box-shadow: 0 10px 15px -3px var(--shadow);
  border: 1px solid var(--border);
}

.log-table th,
.log-table td {
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--border);
  text-align: left;
  font-size: 0.95rem;
}

.log-table thead {
  background: rgba(99, 102, 241, 0.1);
}

.log-table thead th {
  font-weight: 700;
  color: var(--primary-light);
  text-transform: uppercase;
  font-size: 0.875rem;
  letter-spacing: 0.05em;
}

.log-table tbody tr {
  transition: background 0.2s ease;
}

.log-table tbody tr:hover {
  background: var(--surface-light);
}

.log-table tbody tr:last-child td {
  border-bottom: none;
}

.video-player {
  width: 100%;
  max-height: 70vh;
  border-radius: 1rem;
  background: #000;
  box-shadow: 0 20px 25px -5px var(--shadow), 0 10px 10px -5px var(--shadow);
  border: 1px solid var(--border);
}

h2 {
  font-size: 2rem;
  font-weight: 700;
  margin-bottom: 1.5rem;
  background: var(--gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

section {
  margin-bottom: 3rem;
}

section p {
  color: var(--text-muted);
  line-height: 1.7;
}

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

  .top-bar {
    flex-direction: column;
    gap: 1rem;
    padding: 1rem;
  }

  .top-bar nav {
    width: 100%;
    justify-content: center;
  }

  main {
    padding: 1rem;
  }
}
