/* ============================================================
   Admin Panel Styles
   ============================================================ */

.admin-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 56px;
  padding: 0 24px;
  background: #111;
  border-bottom: 1px solid var(--border-light);
  position: sticky;
  top: 0;
  z-index: 100;
}

.admin-nav__left { display: flex; align-items: center; gap: 12px; }
.admin-nav__sep  { color: var(--border); font-size: 18px; }
.admin-nav__title { font-size: 14px; font-weight: 600; color: var(--text); }
.admin-nav__back  { font-size: 13px; color: var(--text-muted); display: flex; align-items: center; gap: 4px; transition: color var(--transition); }
.admin-nav__back:hover { color: var(--text); }
.admin-nav__right { display: flex; align-items: center; gap: 12px; }
.admin-nav__user  { font-size: 12px; color: var(--text-muted); }
.admin-nav__logout {
  font-size: 12px;
  color: var(--text-muted);
  padding: 6px 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius-full);
  transition: color var(--transition), border-color var(--transition);
}
.admin-nav__logout:hover { color: var(--text); border-color: #555; }

.admin-body { max-width: 1100px; margin: 0 auto; padding: 32px 24px; }

.admin-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
}

.admin-header__title { font-size: 20px; font-weight: 700; color: var(--text); }
.admin-header__count { font-size: 13px; color: var(--text-muted); margin-top: 2px; }

.btn-add {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  background: var(--red);
  color: #fff;
  border-radius: var(--radius-lg);
  font-size: 13px;
  font-weight: 600;
  transition: background var(--transition);
  border: none;
  cursor: pointer;
}

.btn-add:hover { background: var(--red-hover); }

/* Table */
.video-table {
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-xl);
  overflow: hidden;
}

.video-table__head {
  display: grid;
  grid-template-columns: 100px 1fr 100px 120px 80px;
  gap: 12px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border-light);
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
}

.video-table__row {
  display: grid;
  grid-template-columns: 100px 1fr 100px 120px 80px;
  gap: 12px;
  padding: 12px 16px;
  align-items: center;
  border-bottom: 1px solid var(--border-light);
  transition: background var(--transition);
}

.video-table__row:last-child { border-bottom: none; }
.video-table__row:hover { background: var(--bg-hover); }

.video-table__thumb {
  width: 100px;
  aspect-ratio: 16/9;
  border-radius: var(--radius-sm);
  overflow: hidden;
  background: #111;
}

.video-table__thumb img { width: 100%; height: 100%; object-fit: cover; }

.video-table__title { font-size: 13px; font-weight: 500; color: var(--text); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.video-table__id    { font-size: 11px; color: var(--text-dim); margin-top: 2px; }
.video-table__views { font-size: 12px; color: var(--text-muted); }
.video-table__date  { font-size: 12px; color: var(--text-muted); }
.video-table__actions { display: flex; gap: 4px; }

.btn-icon {
  width: 30px;
  height: 30px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  transition: color var(--transition), background var(--transition);
  border: none;
  background: none;
  cursor: pointer;
}

.btn-icon:hover { background: var(--bg-hover); color: var(--text); }
.btn-icon.delete:hover { color: #ff4444; }

/* Form Modal */
.form-modal-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 300;
  background: rgba(0,0,0,0.85);
  backdrop-filter: blur(4px);
  align-items: center;
  justify-content: center;
  padding: 16px;
}

.form-modal-backdrop.open { display: flex; }

.form-modal {
  width: 100%;
  max-width: 540px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  overflow: hidden;
  animation: modalIn 0.2s ease;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
}

.form-modal__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border-light);
  flex-shrink: 0;
}

.form-modal__title { font-size: 15px; font-weight: 600; color: var(--text); }

.form-modal__body { padding: 20px; overflow-y: auto; flex: 1; }

.form-group { margin-bottom: 16px; }

.form-label {
  display: block;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  margin-bottom: 6px;
}

.form-input, .form-textarea, .form-select {
  width: 100%;
  padding: 9px 12px;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  font-size: 13px;
  outline: none;
  transition: border-color var(--transition);
}

.form-input:focus, .form-textarea:focus, .form-select:focus { border-color: var(--red); }
.form-textarea { resize: vertical; min-height: 80px; }
.form-select { color-scheme: dark; }

.form-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }

.form-actions {
  display: flex;
  gap: 10px;
  margin-top: 20px;
}

.btn-cancel {
  flex: 1;
  padding: 10px;
  background: var(--bg-hover);
  color: var(--text);
  border-radius: var(--radius-lg);
  font-size: 13px;
  font-weight: 500;
  border: none;
  cursor: pointer;
  transition: background var(--transition);
}

.btn-cancel:hover { background: #3f3f3f; }

.btn-submit {
  flex: 1;
  padding: 10px;
  background: var(--red);
  color: #fff;
  border-radius: var(--radius-lg);
  font-size: 13px;
  font-weight: 600;
  border: none;
  cursor: pointer;
  transition: background var(--transition);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.btn-submit:hover { background: var(--red-hover); }
.btn-submit:disabled { opacity: 0.6; cursor: not-allowed; }

.thumb-preview {
  width: 100%;
  aspect-ratio: 16/9;
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--bg-input);
  margin-top: 8px;
}

.thumb-preview img { width: 100%; height: 100%; object-fit: cover; }

/* Login Page */
.login-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: var(--bg);
}

.login-card {
  width: 100%;
  max-width: 380px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: 32px;
}

.login-card__icon {
  width: 56px;
  height: 56px;
  background: rgba(255,0,0,0.15);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  margin: 0 auto 16px;
}

.login-card__title { font-size: 20px; font-weight: 700; text-align: center; margin-bottom: 4px; }
.login-card__sub   { font-size: 13px; color: var(--text-muted); text-align: center; margin-bottom: 24px; }

.login-error {
  background: rgba(255,0,0,0.1);
  border: 1px solid rgba(255,0,0,0.3);
  color: #ff6b6b;
  padding: 10px 14px;
  border-radius: var(--radius);
  font-size: 13px;
  margin-bottom: 16px;
}

.btn-login {
  width: 100%;
  padding: 12px;
  background: var(--red);
  color: #fff;
  border-radius: var(--radius-lg);
  font-size: 14px;
  font-weight: 600;
  border: none;
  cursor: pointer;
  transition: background var(--transition);
  margin-top: 8px;
}

.btn-login:hover { background: var(--red-hover); }

.login-back {
  display: block;
  text-align: center;
  margin-top: 16px;
  font-size: 13px;
  color: var(--text-muted);
  transition: color var(--transition);
}

.login-back:hover { color: var(--text); }

/* Delete confirm */
.confirm-modal {
  width: 100%;
  max-width: 360px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: 24px;
  animation: modalIn 0.2s ease;
}

.confirm-modal__icon {
  width: 44px;
  height: 44px;
  background: rgba(255,0,0,0.12);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 12px;
}

.confirm-modal__title { font-size: 16px; font-weight: 600; margin-bottom: 6px; }
.confirm-modal__text  { font-size: 13px; color: var(--text-muted); margin-bottom: 20px; line-height: 1.5; }

/* Responsive hide */
@media (max-width: 768px) {
  .video-table__head,
  .video-table__row { grid-template-columns: 80px 1fr 70px; }
  .video-table__head .col-date,
  .video-table__row  .col-date { display: none; }
}

/* ── Admin Nav Links (Profile / Admins / Settings) ───────────────────── */
.admin-nav__link {
  color: var(--text-muted);
  text-decoration: none;
  font-size: 13px;
  padding: 4px 10px;
  border-radius: 6px;
  transition: background .15s, color .15s;
}
.admin-nav__link:hover {
  background: rgba(255,255,255,.08);
  color: var(--text);
}

/* ── Admin Container ──────────────────────────────────────────────────── */
.admin-container {
  max-width: 960px;
  margin: 2rem auto;
  padding: 0 1.5rem;
}

/* ── Admin Section Card ───────────────────────────────────────────────── */
.admin-section {
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-xl);
  padding: 1.5rem;
}
.admin-section__title {
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
  margin: 0 0 1.25rem;
  padding-bottom: .75rem;
  border-bottom: 1px solid var(--border-light);
}

/* ── Toast / Alert ────────────────────────────────────────────────────── */
.admin-toast {
  padding: .75rem 1rem;
  border-radius: var(--radius);
  font-size: 14px;
  font-weight: 500;
}
.admin-toast--success {
  background: rgba(0,200,100,.15);
  border: 1px solid rgba(0,200,100,.35);
  color: #4caf82;
}
.admin-toast--error {
  background: rgba(255,60,60,.12);
  border: 1px solid rgba(255,60,60,.3);
  color: #f87171;
}

/* ── Primary Button ───────────────────────────────────────────────────── */
.btn-primary {
  background: var(--red);
  color: #fff;
  border: none;
  border-radius: var(--radius-lg);
  padding: 10px 20px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: background .15s;
}
.btn-primary:hover { background: var(--red-hover); }

/* ── Small Table Action Buttons ──────────────────────────────────────── */
.btn-delete-small {
  background: rgba(255,60,60,.15);
  color: #f87171;
  border: 1px solid rgba(255,60,60,.3);
  border-radius: 6px;
  padding: 4px 10px;
  font-size: 12px;
  cursor: pointer;
  transition: background .15s;
}
.btn-delete-small:hover { background: rgba(255,60,60,.3); }

.btn-edit-small {
  background: rgba(60,166,255,.12);
  color: #3ea6ff;
  border: 1px solid rgba(60,166,255,.3);
  border-radius: 6px;
  padding: 4px 10px;
  font-size: 12px;
  text-decoration: none;
  display: inline-block;
  transition: background .15s;
}
.btn-edit-small:hover { background: rgba(60,166,255,.25); }

/* ── Admin Table (for admins.php) ─────────────────────────────────────── */
.admin-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
  color: var(--text-muted);
}
.admin-table th {
  text-align: left;
  padding: .5rem .75rem;
  color: var(--text-dim, #666);
  font-weight: 500;
  border-bottom: 1px solid var(--border-light);
}
.admin-table td {
  padding: .6rem .75rem;
  border-bottom: 1px solid var(--border-light);
  vertical-align: middle;
}
.admin-table tr:last-child td { border-bottom: none; }
