/* ─────────────────────────────────────────────
   nixia-panel.css  –  Login + Admin panel
   ───────────────────────────────────────────── */

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

html, body {
  margin: 0; padding: 0;
  min-height: 100%;
  font-family: 'Barlow', sans-serif;
  background: #080b10;
  color: #e8eaf0;
  font-size: 15px;
  line-height: 1.5;
}

/* ══ AUTH / LOGIN ══ */
.auth-wrap {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: radial-gradient(ellipse at 50% 0%, rgba(0,100,255,.12) 0%, transparent 70%), #080b10;
}

.auth-card {
  width: 100%;
  max-width: 400px;
  background: rgba(255,255,255,.04);
  border: 1px solid rgba(255,255,255,.09);
  border-radius: 18px;
  padding: 36px 32px;
  display: flex;
  flex-direction: column;
  gap: 22px;
  box-shadow: 0 24px 80px rgba(0,0,0,.6);
}

.auth-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 1.15em;
  font-weight: 700;
  letter-spacing: .01em;
}

.auth-title {
  margin: 0;
  font-size: 1.5em;
  font-weight: 700;
  color: #fff;
}

/* ══ FORM FIELDS ══ */
.field {
  display: flex;
  flex-direction: column;
  gap: 7px;
}
.field-label {
  font-size: .83em;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .06em;
  opacity: .55;
}
.field-optional {
  font-weight: 400;
  text-transform: none;
  letter-spacing: 0;
  opacity: .6;
}
.field-input {
  background: rgba(255,255,255,.06);
  border: 1px solid rgba(255,255,255,.12);
  border-radius: 10px;
  color: #fff;
  font-family: 'Barlow', sans-serif;
  font-size: .95em;
  padding: 11px 14px;
  outline: none;
  transition: border-color .15s, background .15s;
  width: 100%;
}
.field-input::placeholder { color: rgba(255,255,255,.22); }
.field-input:focus {
  border-color: rgba(0,150,255,.6);
  background: rgba(0,80,200,.08);
}

/* ══ BUTTONS ══ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 10px 20px;
  border: none;
  border-radius: 10px;
  font-family: 'Barlow', sans-serif;
  font-size: .88em;
  font-weight: 600;
  cursor: pointer;
  transition: opacity .14s, transform .12s;
  text-decoration: none;
  white-space: nowrap;
}
.btn:hover  { opacity: .88; transform: translateY(-1px); }
.btn:active { transform: scale(.97); }

.btn--primary {
  background: linear-gradient(135deg, #0055cc 0%, #0099ff 100%);
  color: #fff;
}
.btn--danger {
  background: rgba(255,60,60,.15);
  border: 1px solid rgba(255,60,60,.3);
  color: #ff6060;
}
.btn--danger:hover { background: rgba(255,60,60,.22); opacity: 1; }
.btn--full { width: 100%; }
.btn--sm   { padding: 7px 14px; font-size: .8em; }

/* ══ ALERTS ══ */
.alert {
  padding: 10px 14px;
  border-radius: 8px;
  font-size: .87em;
  font-weight: 500;
}
.alert--error {
  background: rgba(255,60,60,.12);
  border: 1px solid rgba(255,60,60,.25);
  color: #ff7070;
}

/* ══ PANEL LAYOUT ══ */
.panel-layout {
  display: flex;
  min-height: 100vh;
}

/* ── Sidebar ── */
.sidebar {
  width: 220px;
  flex-shrink: 0;
  background: rgba(255,255,255,.03);
  border-right: 1px solid rgba(255,255,255,.07);
  display: flex;
  flex-direction: column;
  padding: 24px 0;
  position: sticky;
  top: 0;
  height: 100vh;
}
.sidebar-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 20px 24px;
  font-size: 1em;
  font-weight: 700;
  border-bottom: 1px solid rgba(255,255,255,.06);
  margin-bottom: 12px;
}
.sidebar-nav { flex: 1; padding: 0 10px; }
.sidebar-link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 9px;
  font-size: .88em;
  font-weight: 500;
  text-decoration: none;
  color: rgba(255,255,255,.5);
  transition: background .14s, color .14s;
  cursor: pointer;
}
.sidebar-link svg { width: 17px; height: 17px; flex-shrink: 0; }
.sidebar-link:hover               { background: rgba(255,255,255,.06); color: #fff; }
.sidebar-link--active             { background: rgba(0,120,255,.15); color: #fff; }
.sidebar-bottom {
  padding: 12px 10px 0;
  border-top: 1px solid rgba(255,255,255,.06);
}
.sidebar-link--logout { color: rgba(255,80,80,.7); }
.sidebar-link--logout:hover { color: #ff6060; background: rgba(255,60,60,.08); }

/* ── Main content ── */
.panel-main {
  flex: 1;
  padding: 32px 36px;
  max-width: 900px;
  overflow-y: auto;
}
.panel-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 28px;
}
.panel-title {
  margin: 0 0 4px;
  font-size: 1.6em;
  font-weight: 700;
  color: #fff;
}
.panel-sub { margin: 0; font-size: .85em; opacity: .4; }

/* ══ CARD ══ */
.card {
  background: rgba(255,255,255,.04);
  border: 1px solid rgba(255,255,255,.08);
  border-radius: 14px;
  overflow: hidden;
  margin-bottom: 28px;
}
.card-head {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 16px 20px;
  font-size: .88em;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .05em;
  opacity: .55;
  border-bottom: 1px solid rgba(255,255,255,.06);
}
.card-head svg { width: 16px; height: 16px; }
.card--create  { padding-bottom: 4px; }

.create-form {
  padding: 18px 20px 20px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.create-fields {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}
@media (max-width: 640px) {
  .create-fields { grid-template-columns: 1fr; }
  .panel-main    { padding: 20px 16px; }
  .sidebar       { display: none; }
}

/* ══ EMBEDS GRID ══ */
.embeds-grid {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.embed-card {
  background: rgba(255,255,255,.04);
  border: 1px solid rgba(255,255,255,.08);
  border-radius: 14px;
  padding: 18px 20px;
  display: flex;
  flex-direction: column;
  gap: 13px;
  transition: border-color .14s;
}
.embed-card:hover { border-color: rgba(0,150,255,.25); }

.embed-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}
.embed-card-title {
  font-weight: 600;
  font-size: 1em;
  color: #fff;
}
.embed-card-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: .73em;
  font-weight: 600;
  letter-spacing: .04em;
}
.badge--id   { background: rgba(0,150,255,.12); border: 1px solid rgba(0,150,255,.25); color: #50b8ff; }
.badge--date { background: rgba(255,255,255,.06); border: 1px solid rgba(255,255,255,.1); color: rgba(255,255,255,.4); }

.embed-url-row {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.embed-url-label {
  font-size: .74em;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .06em;
  opacity: .4;
}
.embed-url-box {
  display: flex;
  align-items: center;
  gap: 6px;
}
.embed-url-input {
  flex: 1;
  background: rgba(0,0,0,.25);
  border: 1px solid rgba(255,255,255,.09);
  border-radius: 8px;
  color: rgba(255,255,255,.7);
  font-family: 'Barlow', monospace;
  font-size: .82em;
  padding: 8px 12px;
  outline: none;
  cursor: pointer;
  min-width: 0;
  transition: border-color .14s;
}
.embed-url-input:focus { border-color: rgba(0,150,255,.4); color: #fff; }

.btn-copy, .btn-preview {
  background: rgba(255,255,255,.07);
  border: 1px solid rgba(255,255,255,.1);
  border-radius: 8px;
  color: rgba(255,255,255,.6);
  padding: 8px 10px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  flex-shrink: 0;
  transition: background .14s, color .14s;
}
.btn-copy:hover, .btn-preview:hover { background: rgba(255,255,255,.13); color: #fff; }

.embed-card-footer {
  display: flex;
  justify-content: flex-end;
  padding-top: 4px;
  border-top: 1px solid rgba(255,255,255,.05);
}

/* ══ EMPTY STATE ══ */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  padding: 60px 20px;
  text-align: center;
  opacity: .3;
  font-size: .9em;
}
.empty-state p { margin: 0; }

/* ══ LIBRARY TABLE ══ */
.ic-btn {
  background: rgba(255,255,255,.06);
  border: 1px solid rgba(255,255,255,.1);
  border-radius: 7px;
  color: rgba(255,255,255,.55);
  padding: 6px 8px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  text-decoration: none;
  transition: background .13s, color .13s;
}
.ic-btn:hover { background: rgba(255,255,255,.12); color: #fff; }

/* ══ EDITOR – TYPE BUTTONS ══ */
.type-btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 9px 18px;
  background: rgba(255,255,255,.05);
  border: 1px solid rgba(255,255,255,.12);
  border-radius: 9px;
  color: rgba(255,255,255,.55);
  cursor: pointer;
  font-family: 'Barlow', sans-serif;
  font-size: .84em;
  font-weight: 600;
  transition: background .14s, border-color .14s, color .14s;
}
.type-btn:hover { background: rgba(255,255,255,.09); color: #fff; }

/* Type active states */
.type-btn--mp4  { border-color: rgba(0,150,255,.5);  color: #4499ff; background: rgba(0,150,255,.12); }
.type-btn--hls  { border-color: rgba(0,200,150,.5);  color: #00c896; background: rgba(0,200,150,.12); }
.type-btn--dash { border-color: rgba(153,96,255,.5); color: #9960ff; background: rgba(153,96,255,.12); }
.type-btn--st   { border-color: rgba(255,149,0,.5);  color: #ff9500; background: rgba(255,149,0,.12); }

/* ══ EDITOR – DYNAMIC ROWS ══ */
.dyn-row {
  background: rgba(0,0,0,.18);
  border: 1px solid rgba(255,255,255,.07);
  border-radius: 10px;
  padding: 14px 16px;
  transition: border-color .14s;
}
.dyn-row:hover { border-color: rgba(255,255,255,.13); }

/* Grid layouts for each row type */
.dyn-row--source {
  display: grid;
  grid-template-columns: 135px 95px 1fr 175px 85px 36px;
  gap: 10px;
  align-items: end;
}
.dyn-row--sub {
  display: grid;
  grid-template-columns: 160px 75px 1fr 85px 36px;
  gap: 10px;
  align-items: end;
}
.dyn-row--audio {
  display: grid;
  grid-template-columns: 160px 75px 1fr 36px;
  gap: 10px;
  align-items: end;
}

@media (max-width: 860px) {
  .dyn-row--source { grid-template-columns: 1fr 1fr; }
  .dyn-row--sub    { grid-template-columns: 1fr 1fr; }
  .dyn-row--audio  { grid-template-columns: 1fr 1fr; }
}

/* ══ EDITOR – ADD ROW BUTTON ══ */
.add-row-btn {
  background: rgba(255,255,255,.04);
  border: 1px dashed rgba(255,255,255,.14);
  border-radius: 9px;
  color: rgba(255,255,255,.45);
  padding: 10px 16px;
  cursor: pointer;
  font-size: .84em;
  font-family: 'Barlow', sans-serif;
  display: flex;
  align-items: center;
  gap: 7px;
  width: 100%;
  justify-content: center;
  transition: background .14s, color .14s, border-color .14s;
}
.add-row-btn:hover {
  background: rgba(255,255,255,.08);
  border-color: rgba(255,255,255,.28);
  color: #fff;
}

/* ══ EDITOR – REMOVE ROW BUTTON ══ */
.btn-remove-row {
  background: rgba(255,60,60,.1);
  border: 1px solid rgba(255,60,60,.2);
  border-radius: 7px;
  color: #ff6060;
  padding: 0;
  width: 36px;
  height: 36px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: background .14s;
}
.btn-remove-row:hover { background: rgba(255,60,60,.2); }

/* ══ EDITOR – SELECT FIELD ══ */
select.field-input {
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='rgba(255,255,255,.35)' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 34px;
}

/* ══ EDITOR – STREAMTAPE PANEL ══ */
.st-panel {
  background: rgba(255,149,0,.06);
  border: 1px solid rgba(255,149,0,.2);
  border-radius: 10px;
  padding: 16px 18px;
  margin-bottom: 12px;
}
.st-panel-label {
  font-size: .75em;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .07em;
  color: #ff9500;
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  gap: 6px;
}
.st-panel-hint {
  font-size: .76em;
  opacity: .38;
  margin-top: 8px;
}
.st-panel-hint code {
  background: rgba(255,255,255,.07);
  padding: 1px 5px;
  border-radius: 4px;
  font-family: monospace;
}

/* ══ RESPONSIVE ══ */
@media (max-width: 900px) {
  .panel-main { padding: 18px 16px !important; }
}
@media (max-width: 640px) {
  .type-btn   { padding: 8px 12px; font-size: .8em; }
}
