/* ─── APP SHELL ─── */

.app-page {
  background: var(--bg);
  min-height: 100vh;
}

.app-nav {
  background: var(--bg-elevated);
  border-bottom: 1px solid #222;
  padding: 0;
  position: sticky;
  top: 0;
  z-index: 100;
}

.app-nav .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 60px;
}

.nav-brand {
  font-family: var(--font-display);
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--fg);
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 10px;
}

.admin-tag {
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1px;
  padding: 3px 8px;
  background: var(--accent);
  color: #fff;
  border-radius: 4px;
}

.nav-right {
  display: flex;
  align-items: center;
  gap: 16px;
}

.nav-user {
  color: var(--fg-muted);
  font-size: 0.875rem;
}

.app-main {
  padding: 40px 0 80px;
}

/* ─── BUTTONS ─── */

.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 10px 20px;
  border-radius: 8px;
  font-family: var(--font-body);
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  border: none;
  text-decoration: none;
  transition: all 0.15s;
  white-space: nowrap;
}

.btn-primary {
  background: var(--gradient);
  color: #fff;
}

.btn-primary:hover {
  opacity: 0.9;
  transform: translateY(-1px);
}

.btn-ghost {
  background: transparent;
  color: var(--fg-muted);
  border: 1px solid #333;
}

.btn-ghost:hover {
  border-color: #555;
  color: var(--fg);
}

.btn-sm {
  padding: 6px 12px;
  font-size: 0.8rem;
}

.btn-block {
  width: 100%;
  justify-content: center;
}

/* ─── PAGE HEADER ─── */

.page-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 32px;
  flex-wrap: wrap;
}

.page-title {
  font-family: var(--font-display);
  font-size: clamp(1.5rem, 3vw, 2rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-bottom: 4px;
}

.page-sub {
  color: var(--fg-muted);
  font-size: 0.9rem;
}

.section-heading {
  font-family: var(--font-display);
  font-size: 1.25rem;
  font-weight: 600;
  margin-bottom: 16px;
  letter-spacing: -0.01em;
}

/* ─── ALERTS ─── */

.alert {
  padding: 12px 16px;
  border-radius: 8px;
  font-size: 0.9rem;
  margin-bottom: 24px;
  border: 1px solid;
}

.alert-error {
  background: rgba(255, 61, 0, 0.1);
  border-color: rgba(255, 61, 0, 0.3);
  color: #ff6d00;
}

.alert-success {
  background: rgba(0, 200, 100, 0.1);
  border-color: rgba(0, 200, 100, 0.25);
  color: #00c864;
}

/* ─── STATUS BADGES ─── */

.status-badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  border-radius: 100px;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.status-pending {
  background: rgba(255, 200, 0, 0.12);
  color: #ffc800;
  border: 1px solid rgba(255, 200, 0, 0.3);
}

.status-editing {
  background: rgba(0, 140, 255, 0.12);
  color: #4da6ff;
  border: 1px solid rgba(0, 140, 255, 0.3);
}

.status-ready {
  background: rgba(0, 200, 100, 0.12);
  color: #00c864;
  border: 1px solid rgba(0, 200, 100, 0.3);
}

/* ─── EMPTY STATE ─── */

.empty-state {
  text-align: center;
  padding: 80px 24px;
}

.empty-icon {
  font-size: 3rem;
  margin-bottom: 16px;
}

.empty-state h3 {
  font-family: var(--font-display);
  font-size: 1.25rem;
  font-weight: 600;
  margin-bottom: 8px;
}

.empty-state p {
  color: var(--fg-muted);
  font-size: 0.9rem;
}

/* ─── VIDEO GRID ─── */

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

.video-card {
  background: var(--bg-card);
  border: 1px solid #222;
  border-radius: var(--radius);
  overflow: hidden;
  transition: border-color 0.2s;
}

.video-card:hover {
  border-color: #333;
}

.video-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px 0;
}

.video-icon {
  font-size: 1.5rem;
}

.video-card-body {
  padding: 12px 20px 20px;
}

.video-name {
  font-family: var(--font-display);
  font-size: 0.95rem;
  font-weight: 600;
  margin-bottom: 6px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.video-meta {
  color: var(--fg-muted);
  font-size: 0.8rem;
}

.video-notes {
  color: var(--fg-muted);
  font-size: 0.85rem;
  margin-top: 10px;
  padding: 10px;
  background: var(--bg-elevated);
  border-radius: 6px;
}

/* ─── AUTH ─── */

.auth-page {
  background: var(--bg);
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px 16px;
}

.auth-wrap {
  width: 100%;
  max-width: 420px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 32px;
}

.auth-brand {
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--fg);
  text-decoration: none;
}

.auth-card {
  width: 100%;
  background: var(--bg-elevated);
  border: 1px solid #222;
  border-radius: var(--radius);
  padding: 40px;
}

.auth-title {
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: 6px;
}

.auth-sub {
  color: var(--fg-muted);
  font-size: 0.9rem;
  margin-bottom: 28px;
}

.auth-form {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.auth-footer {
  text-align: center;
  margin-top: 24px;
  color: var(--fg-muted);
  font-size: 0.875rem;
}

.auth-footer a {
  color: var(--accent);
  text-decoration: none;
  font-weight: 600;
}

.auth-footer a:hover { text-decoration: underline; }

/* ─── FORMS ─── */

.form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.form-group label {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--fg-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.form-hint {
  font-weight: 400;
  text-transform: none;
  letter-spacing: 0;
  color: #555;
}

.form-group input,
.form-select,
.form-textarea,
.form-input {
  background: var(--bg-card);
  border: 1px solid #333;
  border-radius: 8px;
  color: var(--fg);
  font-family: var(--font-body);
  font-size: 0.95rem;
  padding: 10px 14px;
  width: 100%;
  transition: border-color 0.15s;
}

.form-group input:focus,
.form-select:focus,
.form-textarea:focus,
.form-input:focus {
  outline: none;
  border-color: var(--accent);
}

.form-group input::placeholder { color: #444; }

/* ─── UPLOAD CARD ─── */

.upload-card {
  background: var(--bg-elevated);
  border: 1px solid #222;
  border-radius: var(--radius);
  padding: 32px;
}

.drop-zone {
  border: 2px dashed #333;
  border-radius: 10px;
  padding: 48px 24px;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s;
}

.drop-zone:hover,
.drop-zone.drag-over {
  border-color: var(--accent);
  background: var(--accent-glow);
}

.drop-icon { font-size: 2.5rem; margin-bottom: 12px; }

.drop-zone h3 {
  font-family: var(--font-display);
  font-size: 1.1rem;
  font-weight: 600;
  margin-bottom: 4px;
}

.drop-zone p { color: var(--fg-muted); font-size: 0.9rem; }

.drop-hint {
  margin-top: 12px;
  font-size: 0.8rem !important;
  color: #555 !important;
}

.file-preview {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px;
  background: var(--bg-card);
  border-radius: 10px;
  border: 1px solid #333;
}

.file-preview-icon { font-size: 1.5rem; }

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

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

.file-preview-size {
  color: var(--fg-muted);
  font-size: 0.8rem;
}

.upload-progress { margin-top: 16px; }

.progress-bar {
  height: 4px;
  background: #222;
  border-radius: 2px;
  overflow: hidden;
  margin-bottom: 8px;
}

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

.progress-text {
  color: var(--fg-muted);
  font-size: 0.85rem;
  text-align: center;
}

/* ─── ADMIN STATS ─── */

.admin-stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-bottom: 40px;
}

.admin-stat-card {
  background: var(--bg-elevated);
  border: 1px solid #222;
  border-radius: var(--radius);
  padding: 24px;
  text-align: center;
}

.admin-stat-num {
  font-family: var(--font-display);
  font-size: 2rem;
  font-weight: 700;
  background: var(--gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.admin-stat-label {
  color: var(--fg-muted);
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-top: 4px;
}

/* ─── ADMIN TABLE ─── */

.admin-table-wrap {
  overflow-x: auto;
  border-radius: var(--radius);
  border: 1px solid #222;
}

.admin-table {
  width: 100%;
  border-collapse: collapse;
}

.admin-table th {
  background: var(--bg-elevated);
  padding: 12px 16px;
  text-align: left;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--fg-muted);
  border-bottom: 1px solid #222;
}

.admin-table td {
  padding: 14px 16px;
  font-size: 0.9rem;
  border-bottom: 1px solid #1a1a1a;
  vertical-align: middle;
}

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

.admin-table tr:hover td { background: var(--bg-elevated); }

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

.file-cell-icon { font-size: 1.2rem; }

.file-cell-name {
  font-weight: 600;
  font-size: 0.875rem;
  max-width: 200px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.file-cell-meta, .date-cell {
  color: var(--fg-muted);
  font-size: 0.8rem;
}

/* ─── MODAL ─── */

.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.75);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 200;
  padding: 16px;
}

.modal-card {
  background: var(--bg-elevated);
  border: 1px solid #333;
  border-radius: var(--radius);
  padding: 36px;
  width: 100%;
  max-width: 480px;
}

.modal-title {
  font-family: var(--font-display);
  font-size: 1.25rem;
  font-weight: 700;
  margin-bottom: 24px;
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  margin-top: 24px;
}

/* ─── RESPONSIVE ─── */

@media (max-width: 768px) {
  .admin-stats { grid-template-columns: repeat(2, 1fr); }
  .page-header { flex-direction: column; }
  .auth-card { padding: 28px 20px; }
}

@media (max-width: 480px) {
  .admin-stats { grid-template-columns: repeat(2, 1fr); }
  .video-grid { grid-template-columns: 1fr; }
}
