/* ===========================================
   ADMIN PANEL STYLES
   =========================================== */

/* Login */
.login-screen {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.login-box {
  width: 100%;
  max-width: 420px;
  background: linear-gradient(135deg, rgba(45, 10, 71, 0.95) 0%, rgba(26, 5, 38, 0.95) 100%);
  border: 1px solid rgba(46, 232, 156, 0.25);
  border-radius: 16px;
  padding: 48px 36px;
  text-align: center;
  backdrop-filter: blur(20px);
  box-shadow: 0 30px 80px rgba(0,0,0,0.6), 0 0 0 1px rgba(46, 232, 156, 0.1), 0 0 60px rgba(147, 51, 234, 0.3);
  animation: loginIn 0.4s ease-out;
  position: relative;
}

@keyframes loginIn {
  from { transform: translateY(20px); }
  to { transform: translateY(0); }
}

.login-box::before {
  content: '';
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 60%;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--neon), transparent);
}

.login-logo {
  width: 88px;
  height: 88px;
  border-radius: 50%;
  margin-bottom: 24px;
  box-shadow: 0 0 40px rgba(46, 232, 156, 0.4);
  animation: logoGlow 3s ease-in-out infinite;
}

@keyframes logoGlow {
  0%, 100% { box-shadow: 0 0 30px rgba(46, 232, 156, 0.4); }
  50% { box-shadow: 0 0 50px rgba(46, 232, 156, 0.7); }
}

.login-title {
  font-family: var(--font-display);
  font-size: 42px;
  letter-spacing: 2px;
  color: var(--neon);
  text-shadow: 0 0 20px var(--neon-glow);
  margin-bottom: 8px;
}

.login-sub {
  color: var(--text-dim);
  font-size: 14px;
  margin-bottom: 32px;
}

.login-form {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.login-form input {
  padding: 16px 20px;
  background: rgba(8, 2, 14, 0.6);
  border: 1px solid rgba(147, 51, 234, 0.3);
  border-radius: 8px;
  color: var(--white);
  font-family: var(--font-body);
  font-size: 15px;
  text-align: center;
  letter-spacing: 4px;
  outline: none;
  transition: all 0.2s;
}

.login-form input:focus {
  border-color: var(--neon);
  box-shadow: 0 0 20px rgba(46, 232, 156, 0.2);
}

.login-form .btn {
  justify-content: center;
}

.login-error {
  padding: 12px;
  background: rgba(255, 0, 80, 0.1);
  border: 1px solid rgba(255, 0, 80, 0.3);
  color: #ff4080;
  border-radius: 6px;
  font-size: 13px;
}

.login-back {
  display: inline-block;
  margin-top: 24px;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 2px;
  color: var(--text-muted);
  text-decoration: none;
  transition: color 0.2s;
}

.login-back:hover { color: var(--neon); }

/* Admin layout */
.admin-main {
  max-width: 1400px;
  margin: 0 auto;
  padding: 48px 32px 80px;
}

.admin-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  margin-bottom: 40px;
  flex-wrap: wrap;
  gap: 20px;
}

/* Stats */
.admin-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 18px;
  margin-bottom: 40px;
}

.admin-stat-card {
  background: linear-gradient(135deg, rgba(45, 10, 71, 0.6) 0%, rgba(8, 2, 14, 0.6) 100%);
  border: 1px solid rgba(147, 51, 234, 0.25);
  border-radius: 12px;
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  position: relative;
  overflow: hidden;
}

.admin-stat-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, var(--neon), transparent);
}

.admin-stat-label {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 2px;
  color: var(--text-muted);
}

.admin-stat-value {
  font-family: var(--font-display);
  font-size: 44px;
  line-height: 1;
  color: var(--neon);
  text-shadow: 0 0 20px var(--neon-glow);
}

/* Form panel */
.form-panel {
  background: rgba(45, 10, 71, 0.4);
  border: 1px solid rgba(46, 232, 156, 0.3);
  border-radius: 16px;
  padding: 32px;
  margin-bottom: 32px;
  animation: heroIn 0.4s ease-out;
}

.form-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 24px;
  padding-bottom: 20px;
  border-bottom: 1px solid rgba(147, 51, 234, 0.2);
}

.form-header h2 {
  font-family: var(--font-display);
  font-size: 32px;
  letter-spacing: 1px;
  color: var(--white);
}

.icon-btn {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  background: transparent;
  border: 1px solid rgba(147, 51, 234, 0.3);
  color: var(--text-dim);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
}

.icon-btn:hover {
  color: var(--neon);
  border-color: var(--neon);
}

.video-form {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.field label {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 2px;
  color: var(--text-dim);
  font-weight: 700;
}

.field .req { color: var(--neon); }

.field input, .field textarea {
  padding: 14px 16px;
  background: rgba(8, 2, 14, 0.6);
  border: 1px solid rgba(147, 51, 234, 0.25);
  border-radius: 8px;
  color: var(--white);
  font-family: var(--font-body);
  font-size: 14px;
  outline: none;
  transition: all 0.2s;
  resize: vertical;
}

.field input:focus, .field textarea:focus {
  border-color: var(--neon);
  box-shadow: 0 0 0 3px rgba(46, 232, 156, 0.1);
}

.field small {
  font-size: 11px;
  color: var(--text-muted);
  font-family: var(--font-mono);
}

.form-actions {
  display: flex;
  gap: 12px;
  justify-content: flex-end;
  padding-top: 12px;
  border-top: 1px solid rgba(147, 51, 234, 0.15);
}

.form-error {
  padding: 12px 16px;
  background: rgba(255, 0, 80, 0.1);
  border: 1px solid rgba(255, 0, 80, 0.3);
  color: #ff4080;
  border-radius: 8px;
  font-size: 13px;
}

/* List */
.admin-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.admin-row {
  background: rgba(45, 10, 71, 0.4);
  border: 1px solid rgba(147, 51, 234, 0.2);
  border-radius: 12px;
  padding: 16px;
  display: grid;
  grid-template-columns: 140px 1fr auto;
  gap: 20px;
  align-items: center;
  transition: all 0.2s;
  animation: cardIn 0.3s ease-out backwards;
}

.admin-row:hover {
  border-color: rgba(46, 232, 156, 0.4);
  transform: translateX(4px);
}

.admin-row-thumb {
  width: 140px;
  aspect-ratio: 16/9;
  background: var(--purple-deep);
  border-radius: 6px;
  overflow: hidden;
  position: relative;
}

.admin-row-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.admin-row-info {
  min-width: 0;
}

.admin-row-title {
  font-family: var(--font-display);
  font-size: 20px;
  letter-spacing: 0.3px;
  line-height: 1.2;
  margin-bottom: 6px;
  color: var(--white);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.admin-row-meta {
  display: flex;
  gap: 14px;
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-muted);
  flex-wrap: wrap;
}

.admin-row-meta span {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.admin-row-actions {
  display: flex;
  gap: 8px;
}

.action-btn {
  width: 38px;
  height: 38px;
  border-radius: 8px;
  background: rgba(147, 51, 234, 0.1);
  border: 1px solid rgba(147, 51, 234, 0.25);
  color: var(--text-dim);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
}

.action-btn:hover { background: rgba(46, 232, 156, 0.15); color: var(--neon); border-color: var(--neon); }
.action-btn.danger:hover { background: rgba(255, 0, 80, 0.15); color: #ff4080; border-color: #ff4080; }

.loading, .empty {
  text-align: center;
  padding: 60px 20px;
  color: var(--text-dim);
  font-family: var(--font-mono);
  letter-spacing: 1px;
}

/* Danger button */
.btn-danger {
  background: #ff0050;
  color: var(--white);
}

.btn-danger:hover {
  background: #ff2070;
  transform: translateY(-2px);
}

/* Confirm modal */
.confirm-modal {
  position: fixed;
  inset: 0;
  z-index: 1100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  animation: fadeIn 0.2s;
}

.confirm-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(8, 2, 14, 0.85);
  backdrop-filter: blur(8px);
}

.confirm-box {
  position: relative;
  background: var(--purple-deep);
  border: 1px solid rgba(255, 0, 80, 0.3);
  border-radius: 16px;
  padding: 32px;
  max-width: 420px;
  width: 100%;
  text-align: center;
  animation: modalIn 0.3s ease-out;
}

.confirm-box h3 {
  font-family: var(--font-display);
  font-size: 28px;
  letter-spacing: 1px;
  margin-bottom: 12px;
}

.confirm-box p {
  color: var(--text-dim);
  margin-bottom: 24px;
}

.confirm-actions {
  display: flex;
  gap: 12px;
  justify-content: center;
}

/* Toast */
.toast {
  position: fixed;
  bottom: 32px;
  right: 32px;
  z-index: 2000;
  background: var(--purple-deep);
  border: 1px solid var(--neon);
  color: var(--white);
  padding: 14px 20px;
  border-radius: 8px;
  font-family: var(--font-mono);
  font-size: 13px;
  box-shadow: var(--shadow-neon);
  transform: translateX(calc(100% + 50px));
  transition: transform 0.3s ease-out;
  max-width: 360px;
}

.toast.show { transform: translateX(0); }
.toast.error { border-color: #ff0050; box-shadow: 0 0 30px rgba(255, 0, 80, 0.4); }

/* TABLET: 768-1024px */
@media (max-width: 1024px) {
  .admin-main { padding: 36px 24px 60px; }
  .admin-stats { grid-template-columns: repeat(3, 1fr); gap: 14px; }
  .admin-stat-value { font-size: 36px; }
}

/* MOBILE: ≤768px */
@media (max-width: 768px) {
  .admin-main { padding: 28px 16px 60px; }
  .admin-header {
    flex-direction: column;
    align-items: stretch;
    gap: 16px;
    margin-bottom: 28px;
  }
  .admin-header .btn { width: 100%; justify-content: center; }
  .section-title { font-size: clamp(34px, 8vw, 48px); }

  /* nav links: keep on single line */
  .header .nav-link { white-space: nowrap; padding: 6px 10px; font-size: 10px; }

  .admin-stats {
    grid-template-columns: 1fr;
    gap: 12px;
    margin-bottom: 28px;
  }
  .admin-stat-card { padding: 18px; }
  .admin-stat-value { font-size: 36px; }

  .form-panel { padding: 20px 18px; }
  .form-header h2 { font-size: 24px; }
  .form-actions { flex-direction: column-reverse; }
  .form-actions .btn { width: 100%; justify-content: center; }

  .admin-row {
    grid-template-columns: 1fr;
    gap: 14px;
  }
  .admin-row-thumb { width: 100%; max-width: 240px; }
  .admin-row-actions { justify-content: flex-end; }

  .login-box { padding: 36px 24px; }
  .login-title { font-size: 36px; }
  .login-logo { width: 72px; height: 72px; }

  .toast {
    left: 16px;
    right: 16px;
    bottom: 16px;
    max-width: none;
  }

  .confirm-box { padding: 24px; }
  .confirm-actions { flex-direction: column-reverse; }
  .confirm-actions .btn { width: 100%; justify-content: center; }
}

#logout-btn {
  background: transparent;
  border: none;
  cursor: pointer;
}
