@font-face {
  font-family: "Vazirmatn";
  src: url("/static/assets/fonts/Vazirmatn-Regular.woff2") format("woff2");
  font-weight: normal;
  font-style: normal;
}

:root {
  --bg: #0b1020;
  --bg2: #121a31;
  --panel: rgba(20, 28, 52, 0.85);
  --panel-2: rgba(17, 24, 43, 0.9);
  --line: #263252;
  --text: #edf2ff;
  --muted: #a7b3d1;
  --accent: #6a7cff;
  --accent-2: #8c5bff;
  --success: #2ecc71;
  --warning: #f39c12;
  --danger: #ff5b79;
  --shadow: 0 20px 50px rgba(0, 0, 0, 0.35);
  --radius: 22px;
}

* {
  box-sizing: border-box;
}

html, body {
  margin: 0;
  padding: 0;
  background:
    radial-gradient(circle at top right, rgba(106,124,255,.18), transparent 25%),
    radial-gradient(circle at bottom left, rgba(140,91,255,.12), transparent 25%),
    var(--bg);
  color: var(--text);
  font-family: "Vazirmatn", Tahoma, sans-serif;
  min-height: 100%;
}

body {
  min-height: 100vh;
}

.app-shell {
  display: grid;
  grid-template-columns: 300px 1fr;
  min-height: 100vh;
}

.sidebar {
  background: linear-gradient(180deg, rgba(10,14,28,.96), rgba(16,22,42,.96));
  border-left: 1px solid rgba(255,255,255,.04);
  padding: 24px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.brand-block {
  display: flex;
  gap: 14px;
  align-items: center;
  margin-bottom: 28px;
}

.brand-logo {
  width: 72px;
  height: 72px;
  border-radius: 18px;
  background: #fff;
  object-fit: contain;
  padding: 8px;
}

.brand-text h1 {
  margin: 0;
  font-size: 20px;
}

.brand-text p {
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.side-nav {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.nav-btn {
  width: 100%;
  border: 1px solid transparent;
  background: rgba(255,255,255,.03);
  color: var(--text);
  border-radius: 16px;
  padding: 14px 16px;
  text-align: right;
  cursor: pointer;
  transition: .2s ease;
  font-size: 14px;
}

.nav-btn:hover {
  border-color: rgba(255,255,255,.08);
  background: rgba(255,255,255,.06);
}

.nav-btn.active {
  background: linear-gradient(135deg, rgba(106,124,255,.24), rgba(140,91,255,.24));
  border-color: rgba(106,124,255,.4);
}

.sidebar-footer {
  margin-top: 30px;
  color: var(--muted);
  font-size: 12px;
}

.main-panel {
  padding: 26px;
}

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
}

.topbar-left h2 {
  margin: 0;
  font-size: 28px;
}

.topbar-left p {
  margin: 6px 0 0;
  color: var(--muted);
}

.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(46, 204, 113, 0.1);
  color: #bff3d3;
  border: 1px solid rgba(46, 204, 113, 0.25);
  border-radius: 999px;
  padding: 10px 16px;
  font-size: 13px;
}

.hero-panel {
  background: linear-gradient(135deg, rgba(106,124,255,.15), rgba(140,91,255,.09));
  border: 1px solid rgba(255,255,255,.05);
  box-shadow: var(--shadow);
  border-radius: var(--radius);
  padding: 24px;
  margin-bottom: 22px;
}

.hero-content h3 {
  margin: 0 0 10px;
  font-size: 22px;
}

.hero-content p {
  margin: 0;
  color: var(--muted);
  max-width: 900px;
  line-height: 1.9;
}

.content-layout {
  display: grid;
  grid-template-columns: 1.4fr .9fr;
  gap: 22px;
}

.left-column,
.right-column {
  display: flex;
  flex-direction: column;
  gap: 22px;
}

.tab-content {
  display: none;
  flex-direction: column;
  gap: 22px;
}

.tab-content.active {
  display: flex;
}

.card {
  background: var(--panel);
  border: 1px solid rgba(255,255,255,.05);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 22px;
  backdrop-filter: blur(10px);
}

.card-header {
  margin-bottom: 18px;
}

.card-header h3 {
  margin: 0;
  font-size: 18px;
}

.card-header p {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 16px;
}

label {
  font-size: 13px;
  color: #d9e2ff;
}

input,
textarea,
select {
  width: 100%;
  background: rgba(8, 12, 25, .75);
  color: var(--text);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 14px 14px;
  font-family: inherit;
  outline: none;
  transition: .2s ease;
}

input:focus,
textarea:focus,
select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 4px rgba(106,124,255,.12);
}

textarea {
  resize: vertical;
  min-height: 120px;
  line-height: 1.8;
}

.grid-2 {
  display: grid;
  grid-template-columns: repeat(2, minmax(0,1fr));
  gap: 16px;
}

.grid-3 {
  display: grid;
  grid-template-columns: repeat(3, minmax(0,1fr));
  gap: 16px;
}

.button-row {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 12px;
}

.primary-btn,
.secondary-btn,
.ghost-btn {
  border: none;
  border-radius: 16px;
  padding: 14px 20px;
  cursor: pointer;
  font-family: inherit;
  font-size: 14px;
  transition: .2s ease;
}

.primary-btn {
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #fff;
  box-shadow: 0 10px 30px rgba(106,124,255,.25);
}

.primary-btn:hover {
  transform: translateY(-1px);
  filter: brightness(1.05);
}

.secondary-btn {
  background: rgba(255,255,255,.06);
  color: var(--text);
  border: 1px solid rgba(255,255,255,.07);
}

.ghost-btn {
  background: transparent;
  color: var(--muted);
  border: 1px dashed rgba(255,255,255,.14);
}

.preview-card video {
  width: 100%;
  min-height: 260px;
  background: #000;
  border-radius: 20px;
}

.preview-player {
  position: relative;
}

.empty-state {
  margin-top: 12px;
  color: var(--muted);
  text-align: center;
  padding: 20px;
  border: 1px dashed rgba(255,255,255,.1);
  border-radius: 16px;
}

.meta-box {
  margin-top: 18px;
  background: rgba(255,255,255,.03);
  border-radius: 16px;
  padding: 14px;
  border: 1px solid rgba(255,255,255,.05);
}

.meta-row {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 7px 0;
  border-bottom: 1px solid rgba(255,255,255,.06);
}

.meta-row:last-child {
  border-bottom: none;
}

.logs-card {
  min-height: 260px;
}

.status-log {
  background: rgba(7, 10, 20, .72);
  border: 1px solid rgba(255,255,255,.05);
  border-radius: 16px;
  min-height: 180px;
  max-height: 340px;
  overflow: auto;
  padding: 14px;
  font-size: 13px;
  line-height: 1.8;
  color: #d5dcf8;
}

.log-line {
  padding: 6px 0;
  border-bottom: 1px dashed rgba(255,255,255,.06);
}

.list-panel {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.job-item {
  background: rgba(255,255,255,.03);
  border: 1px solid rgba(255,255,255,.05);
  border-radius: 16px;
  padding: 14px;
}

.job-item h4 {
  margin: 0 0 6px;
}

.job-item p {
  margin: 4px 0;
  color: var(--muted);
  font-size: 13px;
}

.config-viewer {
  background: rgba(8, 12, 25, .75);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 16px;
  white-space: pre-wrap;
  line-height: 1.9;
  color: #d6e0ff;
  min-height: 220px;
}

@media (max-width: 1280px) {
  .content-layout {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 1024px) {
  .app-shell {
    grid-template-columns: 1fr;
  }

  .sidebar {
    border-left: none;
    border-bottom: 1px solid rgba(255,255,255,.05);
  }

  .grid-3 {
    grid-template-columns: repeat(2, minmax(0,1fr));
  }
}

@media (max-width: 680px) {
  .main-panel {
    padding: 16px;
  }

  .grid-2,
  .grid-3 {
    grid-template-columns: 1fr;
  }

  .button-row {
    flex-direction: column;
  }
}
