/* =========================================================
   Admin panel styles — sits on top of styles.css.
   Reuses palette: dark green #1f3d29, cream #f3ecd7,
   brown #8a542a, orange #e8a33d.
   ========================================================= */

.admin-body { background: #ece5cf; min-height: 100vh; }

.admin-header { background: #1f3d29; }

.btn-outline-dark {
  background: transparent;
  color: #1f3d29;
  border-color: #1f3d29;
}
.btn-outline-dark:hover { background: #1f3d29; color: #f5efe0; }

/* ---------- LOGIN ---------- */
.login-view {
  min-height: calc(100vh - 74px);
  display: grid;
  place-items: center;
  padding: 40px 20px;
}

.login-card {
  background: #faf5e6;
  border-radius: 12px;
  padding: 44px 40px;
  width: 100%;
  max-width: 440px;
  box-shadow: 0 18px 50px rgba(31, 61, 41, 0.12);
}

.login-card .section-title { font-size: 38px; margin-bottom: 6px; }
.login-card .section-sub { margin-bottom: 26px; }

#login-form {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.field span {
  font-family: "Barlow Condensed", sans-serif;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1.6px;
  font-size: 13px;
  color: #3a4a35;
}
.field input {
  font: inherit;
  padding: 12px 14px;
  border-radius: 6px;
  border: 1.5px solid #d6cfb4;
  background: #fff;
  color: #14241a;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.field input:focus {
  outline: none;
  border-color: #1f3d29;
  box-shadow: 0 0 0 3px rgba(232, 163, 61, 0.25);
}

.login-error {
  background: #fdecec;
  border: 1px solid #f0bcbc;
  color: #8c2424;
  padding: 10px 12px;
  border-radius: 6px;
  font-size: 14px;
}

#login-form .btn-primary {
  align-self: flex-start;
  margin-top: 4px;
}

/* ---------- ADMIN PANEL ---------- */
.admin-view {
  padding: 40px 0 80px;
}

.panel {
  background: #faf5e6;
  border-radius: 12px;
  padding: 32px;
  margin-bottom: 28px;
  box-shadow: 0 6px 24px rgba(31, 61, 41, 0.06);
}

.panel-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  flex-wrap: wrap;
  margin-bottom: 22px;
}
.panel-head .section-title { font-size: clamp(28px, 3vw, 40px); margin-bottom: 4px; }
.panel-head .section-sub { margin-bottom: 0; max-width: 600px; }

.panel-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.storage-note {
  font-size: 13px;
  color: #5a5a4a;
  margin: 6px 0 18px;
  background: rgba(31, 61, 41, 0.06);
  padding: 8px 12px;
  border-radius: 6px;
  display: inline-block;
}

.empty-msg {
  color: #5a5a4a;
  font-style: italic;
  padding: 18px 0;
}

/* ---------- THUMB GRID ---------- */
.thumb-grid {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 14px;
}

.thumb {
  background: #fff;
  border-radius: 10px;
  overflow: hidden;
  border: 1.5px solid #ddd5b8;
  display: flex;
  flex-direction: column;
}

.thumb-img {
  aspect-ratio: 4 / 3;
  background-size: cover;
  background-position: center;
  background-color: #2a2a2a;
}

.thumb-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  padding: 8px 10px;
  background: #f3ecd7;
}

.thumb-name {
  font-size: 12px;
  color: #3a4a35;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  flex: 1;
}

.thumb-actions {
  display: flex;
  gap: 4px;
}

.thumb-actions button {
  border: none;
  background: #1f3d29;
  color: #f5efe0;
  width: 26px;
  height: 26px;
  border-radius: 5px;
  font-size: 13px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s ease;
}
.thumb-actions button:hover { background: #2a5238; }
.thumb-actions button[data-action="delete"] { background: #8a2a2a; }
.thumb-actions button[data-action="delete"]:hover { background: #a83333; }

/* ---------- VIDEO MANAGERS ---------- */
.video-managers {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 28px;
}

.video-manager {
  background: #fff;
  border-radius: 10px;
  padding: 22px;
  border: 1.5px solid #ddd5b8;
}

.video-manager h3 {
  font-family: "Barlow Condensed", sans-serif;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 1px;
  font-size: 19px;
  color: #1f3d29;
  margin: 0 0 14px;
}

.preview {
  background: #0d1810;
  border-radius: 8px;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  position: relative;
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.preview.is-empty {
  color: #b0b0a0;
  font-style: italic;
  font-size: 14px;
}
.preview iframe,
.preview video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
  background: #000;
}

.tabs {
  display: flex;
  gap: 4px;
  margin-bottom: 12px;
  border-bottom: 1.5px solid #ddd5b8;
}
.tab {
  font-family: "Barlow Condensed", sans-serif;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1.2px;
  font-size: 13px;
  background: transparent;
  color: #5a5a4a;
  border: none;
  padding: 10px 14px;
  cursor: pointer;
  border-bottom: 3px solid transparent;
  margin-bottom: -1.5px;
  transition: color 0.15s ease, border-color 0.15s ease;
}
.tab.is-active {
  color: #1f3d29;
  border-bottom-color: #e8a33d;
}
.tab:hover { color: #1f3d29; }

.tab-panel {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 14px;
}
.tab-panel input[type="url"] {
  font: inherit;
  padding: 11px 13px;
  border-radius: 6px;
  border: 1.5px solid #d6cfb4;
  background: #fff;
}
.tab-panel input[type="url"]:focus {
  outline: none;
  border-color: #1f3d29;
  box-shadow: 0 0 0 3px rgba(232, 163, 61, 0.25);
}
.tab-panel .btn { align-self: flex-start; }

.file-pick {
  align-self: flex-start;
  cursor: pointer;
}

.hint {
  display: block;
  color: #5a5a4a;
  font-size: 12.5px;
  line-height: 1.5;
}

.clear-btn {
  margin-top: 6px;
  font-size: 13px !important;
  padding: 10px 16px !important;
}

/* ---------- BEFORE / AFTER MANAGERS ---------- */
.ba-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 28px;
}

.ba-card {
  background: #fff;
  border-radius: 10px;
  padding: 22px;
  border: 1.5px solid #ddd5b8;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.ba-card h3 {
  font-family: "Barlow Condensed", sans-serif;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 1px;
  font-size: 19px;
  color: #1f3d29;
  margin: 0;
}

.ba-preview {
  aspect-ratio: 16 / 9;
  border-radius: 8px;
  background-color: #0d1810;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #b0b0a0;
  font-style: italic;
  font-size: 14px;
  text-align: center;
  padding: 0 20px;
}
.ba-preview:not(.is-empty) { color: transparent; }

@media (max-width: 800px) {
  .ba-grid { grid-template-columns: 1fr; }
}

/* ---------- TOAST ---------- */
.toast {
  position: fixed;
  left: 50%;
  bottom: 26px;
  transform: translateX(-50%);
  background: #1f3d29;
  color: #f5efe0;
  padding: 12px 22px;
  border-radius: 999px;
  font-size: 14px;
  font-weight: 500;
  box-shadow: 0 12px 30px rgba(0,0,0,0.25);
  z-index: 100;
  max-width: 90vw;
  text-align: center;
}
.toast[data-kind="error"] { background: #8a2a2a; }

/* ---------- RESPONSIVE ---------- */
@media (max-width: 800px) {
  .video-managers { grid-template-columns: 1fr; }
  .panel { padding: 22px 18px; }
}
