*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

:root {
  --primary: #2563eb;
  --primary-dark: #1d4ed8;
  --bg: #f8fafc;
  --surface: #ffffff;
  --border: #e2e8f0;
  --text: #1e293b;
  --text-muted: #64748b;
  --danger: #ef4444;
  --success: #22c55e;
  --radius: 12px;
  --shadow: 0 4px 24px rgba(0,0,0,0.08);
}

body {
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
}

/* ── NAV ── */
nav {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  padding: 0 2rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 1px 8px rgba(0,0,0,0.04);
}

nav .logo {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--primary);
  text-decoration: none;
  letter-spacing: -0.5px;
}

nav a.admin-link {
  font-size: 0.875rem;
  color: var(--text-muted);
  text-decoration: none;
  padding: 0.4rem 1rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  transition: all 0.2s;
}

nav a.admin-link:hover {
  background: var(--bg);
  color: var(--text);
}

/* ── MAIN LAYOUT ── */
main {
  max-width: 860px;
  margin: 0 auto;
  padding: 3rem 1.5rem 4rem;
  display: flex;
  flex-direction: column;
  gap: 2.5rem;
}

/* ── CARD ── */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.card-header {
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 0.625rem;
}

.card-header h2 {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text);
}

.card-header .icon {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.9rem;
}

.card-header .icon.blue { background: #dbeafe; }
.card-header .icon.red  { background: #fee2e2; }

.card-body {
  padding: 1.5rem;
}

/* ── IMAGE DISPLAY ── */
.image-wrapper {
  width: 100%;
  border-radius: 8px;
  overflow: hidden;
  background: var(--bg);
  border: 2px dashed var(--border);
  min-height: 280px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 0.75rem;
  color: var(--text-muted);
  font-size: 0.9rem;
}

.image-wrapper img {
  width: 100%;
  height: auto;
  max-height: 480px;
  object-fit: cover;
  display: block;
  border: none;
}

.image-wrapper .placeholder-icon {
  font-size: 2.5rem;
  opacity: 0.4;
}

/* ── VIDEO WRAPPER ── */
.video-wrapper {
  position: relative;
  padding-bottom: 56.25%;
  height: 0;
  border-radius: 8px;
  overflow: hidden;
  background: #000;
}

.video-wrapper iframe {
  position: absolute;
  top: 0; left: 0;
  width: 100%; height: 100%;
  border: 0;
}

.video-placeholder {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  background: #1e293b;
  color: #94a3b8;
  font-size: 0.9rem;
}

.video-placeholder .yt-icon {
  font-size: 2.5rem;
  opacity: 0.5;
}

/* ── ADMIN ── */
.admin-container {
  max-width: 500px;
  margin: 0 auto;
  padding: 3rem 1.5rem;
}

.admin-title {
  font-size: 1.75rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
  letter-spacing: -0.5px;
}

.admin-subtitle {
  color: var(--text-muted);
  font-size: 0.9rem;
  margin-bottom: 2rem;
}

/* ── FORM ── */
.form-group {
  display: flex;
  flex-direction: column;
  gap: 0.375rem;
  margin-bottom: 1.25rem;
}

label {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text);
}

input[type="text"],
input[type="password"],
input[type="url"] {
  width: 100%;
  padding: 0.625rem 0.875rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 0.95rem;
  color: var(--text);
  background: var(--surface);
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
}

input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(37,99,235,0.12);
}

/* ── FILE UPLOAD ── */
.file-upload-label {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 2rem;
  border: 2px dashed var(--border);
  border-radius: 10px;
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s;
  text-align: center;
  color: var(--text-muted);
  font-size: 0.875rem;
  background: var(--bg);
}

.file-upload-label:hover {
  border-color: var(--primary);
  background: #eff6ff;
  color: var(--primary);
}

.file-upload-label input[type="file"] {
  display: none;
}

.file-upload-label .upload-icon {
  font-size: 1.75rem;
}

.preview-thumb {
  width: 100%;
  max-height: 180px;
  object-fit: cover;
  border-radius: 8px;
  margin-top: 0.75rem;
  display: none;
  border: 1px solid var(--border);
}

/* ── BUTTONS ── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.65rem 1.25rem;
  border: none;
  border-radius: 8px;
  font-size: 0.95rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
  text-decoration: none;
}

.btn-primary {
  background: var(--primary);
  color: #fff;
  width: 100%;
}

.btn-primary:hover {
  background: var(--primary-dark);
}

.btn-danger {
  background: #fee2e2;
  color: var(--danger);
}

.btn-danger:hover {
  background: #fecaca;
}

.btn-secondary {
  background: var(--bg);
  color: var(--text);
  border: 1px solid var(--border);
}

.btn-secondary:hover {
  background: var(--border);
}

/* ── ALERT ── */
.alert {
  padding: 0.75rem 1rem;
  border-radius: 8px;
  font-size: 0.875rem;
  margin-bottom: 1rem;
  display: none;
}

.alert.error   { background: #fee2e2; color: #b91c1c; border: 1px solid #fca5a5; }
.alert.success { background: #dcfce7; color: #15803d; border: 1px solid #86efac; }

/* ── DIVIDER ── */
.divider {
  height: 1px;
  background: var(--border);
  margin: 1.5rem 0;
}

/* ── SECTION LABEL ── */
.section-label {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  margin-bottom: 0.75rem;
}

/* ── LOGOUT ── */
.logout-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem 1rem;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  margin-bottom: 1.5rem;
  font-size: 0.875rem;
  color: var(--text-muted);
}

/* ── RESPONSIVE ── */
@media (max-width: 600px) {
  nav { padding: 0 1rem; }
  main { padding: 1.5rem 1rem 3rem; }
}
