/* ============================================
   OVA STUDIO — CSS
   ============================================ */

.studio-body { background: var(--bg); min-height: 100vh; }

/* ── GATE ── */
.gate {
  position: fixed; inset: 0; z-index: 300;
  background: var(--bg);
  display: flex; align-items: center; justify-content: center;
}
.gate-card {
  background: var(--bg-3); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: 48px 40px;
  max-width: 400px; width: 100%; text-align: center;
  box-shadow: var(--shadow-lg);
}
.gate-logo {
  font-size: 1.6rem; font-weight: 900; letter-spacing: -1px;
  margin-bottom: 24px; display: block;
}
.gate-tag {
  font-size: 0.65rem; font-weight: 700; letter-spacing: 3px;
  color: var(--accent-2); background: rgba(99,102,241,0.12);
  border: 1px solid rgba(99,102,241,0.25);
  padding: 2px 8px; border-radius: 999px; vertical-align: middle;
  font-family: var(--font);
}
.gate-card h2 { font-size: 1.4rem; font-weight: 800; margin-bottom: 8px; }
.gate-card p { color: var(--text-2); font-size: 0.9rem; margin-bottom: 28px; }
.gate-form { display: flex; flex-direction: column; gap: 12px; }
.gate-error { color: var(--red); font-size: 0.82rem; margin-top: 4px; }

/* ── STUDIO NAV ── */
.studio-nav {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 32px;
  background: rgba(8,12,20,0.9); backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  position: sticky; top: 0; z-index: 50;
}
.studio-nav-tag {
  font-size: 0.6rem; font-weight: 700; letter-spacing: 3px;
  color: var(--accent-2); background: rgba(99,102,241,0.12);
  border: 1px solid rgba(99,102,241,0.25);
  padding: 2px 8px; border-radius: 999px; vertical-align: middle; margin-left: 4px;
}
.studio-nav-right { display: flex; align-items: center; gap: 16px; }
.studio-status { display: flex; align-items: center; gap: 8px; font-size: 0.82rem; color: var(--text-2); }

/* ── STUDIO MAIN ── */
.studio-main { max-width: 1280px; margin: 0 auto; padding: 40px 32px; }
.studio-header { margin-bottom: 40px; }
.studio-header h1 { font-size: 1.8rem; font-weight: 800; letter-spacing: -1px; margin-bottom: 8px; }
.studio-header p { color: var(--text-2); font-size: 0.95rem; }

.studio-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; align-items: start; }

.studio-section {
  background: var(--bg-3); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: 28px; margin-bottom: 16px;
}
.studio-section h3 { font-size: 0.85rem; font-weight: 700; text-transform: uppercase; letter-spacing: 1px; color: var(--text-2); margin-bottom: 18px; }

/* ── CONTENT TYPES ── */
.content-types { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.content-type-card { cursor: pointer; }
.content-type-card input { display: none; }
.ctc-inner {
  display: flex; flex-direction: column; align-items: center; gap: 6px;
  padding: 16px 8px; border-radius: var(--radius);
  border: 1px solid var(--border); background: rgba(255,255,255,0.02);
  transition: all 0.2s; text-align: center;
}
.ctc-inner:hover { border-color: var(--border-hover); }
.content-type-card input:checked + .ctc-inner { border-color: var(--accent); background: rgba(99,102,241,0.1); }
.ctc-icon { font-size: 1.4rem; }
.ctc-label { font-size: 0.8rem; font-weight: 600; }
.ctc-desc { font-size: 0.7rem; color: var(--text-3); }

/* ── STUDIO FORM ── */
.studio-form-fields { display: flex; flex-direction: column; gap: 14px; }
.req { color: var(--accent-2); }

/* ── DELIVERY INFO ── */
.delivery-info { display: flex; flex-direction: column; gap: 16px; }
.delivery-item { display: flex; gap: 14px; align-items: flex-start; }
.delivery-icon { font-size: 1.2rem; margin-top: 2px; flex-shrink: 0; }
.delivery-item strong { display: block; font-size: 0.88rem; margin-bottom: 4px; }
.delivery-item p { font-size: 0.8rem; color: var(--text-2); margin: 0; }

.studio-submit { margin-top: 8px; padding: 16px; font-size: 0.95rem; }

/* ── RIGHT PANEL ── */
.studio-right-panel { display: flex; flex-direction: column; gap: 16px; position: sticky; top: 80px; }

.studio-preview-card {
  background: var(--bg-3); border: 1px solid var(--accent);
  border-radius: var(--radius-lg); padding: 24px;
  box-shadow: 0 0 32px rgba(99,102,241,0.12);
}
.preview-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 14px; font-size: 0.8rem; font-weight: 600; color: var(--text-2);
}
.preview-actions { display: flex; gap: 8px; }
.badge-scheduled {
  display: inline-block;
  background: rgba(245,158,11,0.12); border: 1px solid rgba(245,158,11,0.25);
  color: var(--yellow); font-size: 0.78rem; font-weight: 600;
  padding: 4px 12px; border-radius: 999px; margin-bottom: 16px;
}
.preview-content {
  font-size: 0.85rem; line-height: 1.8; color: var(--text-2);
  white-space: pre-wrap; max-height: 480px; overflow-y: auto;
}
.preview-content::-webkit-scrollbar { width: 4px; }
.preview-content::-webkit-scrollbar-thumb { background: var(--border-hover); border-radius: 2px; }

.studio-jobs-card {
  background: var(--bg-3); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: 24px;
}
.jobs-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; }
.jobs-header h3 { font-size: 0.88rem; font-weight: 700; }
.jobs-list { display: flex; flex-direction: column; gap: 10px; }
.jobs-empty { font-size: 0.82rem; color: var(--text-3); text-align: center; padding: 20px 0; }

.job-item {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 14px; border-radius: var(--radius);
  background: rgba(255,255,255,0.03); border: 1px solid var(--border);
  font-size: 0.82rem;
}
.job-info { display: flex; flex-direction: column; gap: 2px; }
.job-title { font-weight: 600; }
.job-meta { color: var(--text-3); font-size: 0.75rem; }
.job-status {
  padding: 3px 10px; border-radius: 999px; font-size: 0.72rem; font-weight: 700;
  white-space: nowrap;
}
.job-status.pending { background: rgba(245,158,11,0.12); color: var(--yellow); border: 1px solid rgba(245,158,11,0.2); }
.job-status.sent { background: rgba(16,185,129,0.1); color: var(--green); border: 1px solid rgba(16,185,129,0.2); }
.job-status.generating { background: rgba(99,102,241,0.1); color: var(--accent-2); border: 1px solid rgba(99,102,241,0.2); }

.studio-tips-card {
  background: var(--bg-3); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: 24px;
}
.studio-tips-card h4 { font-size: 0.85rem; font-weight: 700; margin-bottom: 12px; }
.studio-tips-card ul { list-style: none; display: flex; flex-direction: column; gap: 8px; }
.studio-tips-card li { font-size: 0.8rem; color: var(--text-2); padding-left: 16px; position: relative; }
.studio-tips-card li::before { content: '→'; position: absolute; left: 0; color: var(--accent-2); }

@media (max-width: 1024px) {
  .studio-grid { grid-template-columns: 1fr; }
  .studio-right-panel { position: static; }
  .content-types { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 600px) {
  .studio-main { padding: 24px 16px; }
  .content-types { grid-template-columns: repeat(2, 1fr); }
}

.gate-back {
  display: block; text-align: center; margin-top: 20px;
  font-size: 0.82rem; color: var(--text-3);
  transition: color 0.2s;
}
.gate-back:hover { color: var(--text); }

/* ══════════════════════════════════════════
   STUDIO TABS
══════════════════════════════════════════ */
.studio-tabs {
  display: flex; align-items: center; gap: 4px;
  background: rgba(255,255,255,0.04); border-radius: 10px; padding: 4px;
}
.studio-tab {
  padding: 7px 18px; border-radius: 7px; border: none;
  background: transparent; color: var(--text-2);
  font-size: 13px; font-weight: 600; font-family: var(--font);
  cursor: pointer; transition: all 0.2s;
}
.studio-tab:hover { color: var(--text); }
.studio-tab.active { background: var(--accent); color: #fff; }
.studio-tab-content { }

/* ══════════════════════════════════════════
   ADMIN PANEL
══════════════════════════════════════════ */
.admin-section-title {
  font-size: 11px; font-weight: 700; color: var(--accent);
  text-transform: uppercase; letter-spacing: 0.1em;
  margin: 32px 0 14px;
}

/* Stats bar */
.admin-stats {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  gap: 10px; margin-bottom: 28px;
}
.admin-stat {
  background: var(--bg-3); border: 1px solid var(--border);
  border-radius: 10px; padding: 14px; text-align: center;
}
.admin-stat-val { font-size: 22px; font-weight: 900; margin-bottom: 3px; }
.admin-stat-label { font-size: 10px; color: var(--text-3); text-transform: uppercase; letter-spacing: 0.05em; }

/* Sub-navigation */
.admin-subnav {
  display: flex; align-items: center; gap: 4px; flex-wrap: wrap;
  background: rgba(255,255,255,0.03); border: 1px solid var(--border);
  border-radius: 12px; padding: 6px; margin-bottom: 20px;
}
.admin-subbtn {
  padding: 7px 14px; border-radius: 8px; border: none;
  background: transparent; color: var(--text-2);
  font-size: 12px; font-weight: 600; font-family: var(--font);
  cursor: pointer; transition: all 0.15s; white-space: nowrap;
}
.admin-subbtn:hover { background: rgba(255,255,255,0.05); color: var(--text); }
.admin-subbtn.active { background: rgba(99,102,241,0.15); color: var(--accent-2); }

/* Panel */
.admin-panel { display: none; }
.admin-panel.active { display: block; }

.admin-panel-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 18px; background: rgba(255,255,255,0.03);
  border: 1px solid var(--border); border-radius: 10px 10px 0 0;
  font-size: 13px; font-weight: 700;
}

/* Table */
.admin-table-wrap {
  border: 1px solid var(--border); border-top: none;
  border-radius: 0 0 10px 10px; overflow: hidden; overflow-x: auto;
}
.admin-table-wrap table { width: 100%; border-collapse: collapse; min-width: 500px; }
.admin-table-wrap th {
  padding: 9px 14px; font-size: 11px; font-weight: 700;
  color: var(--text-3); text-transform: uppercase; letter-spacing: 0.05em;
  text-align: left; border-bottom: 1px solid var(--border);
  background: rgba(255,255,255,0.02);
}
.admin-table-wrap td {
  padding: 10px 14px; font-size: 12px;
  border-bottom: 1px solid rgba(255,255,255,0.04);
  vertical-align: middle;
}
.admin-table-wrap tr:last-child td { border-bottom: none; }
.admin-table-wrap tr:hover td { background: rgba(255,255,255,0.02); }
.admin-empty { text-align: center; color: var(--text-3); padding: 24px !important; }

/* Action box */
.admin-action-box {
  background: var(--bg-3); border: 1px solid var(--border);
  border-radius: 10px; padding: 18px 20px; margin-bottom: 12px;
}
.admin-action-box strong { font-size: 13px; font-weight: 700; display: block; margin-bottom: 0; }

.admin-actions-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 12px;
}

.admin-row { display: flex; gap: 8px; align-items: center; margin-top: 10px; flex-wrap: wrap; }
.admin-row .form-input { flex: 1; min-width: 140px; }

.admin-result {
  margin-top: 10px; background: var(--bg);
  border-radius: 7px; padding: 10px 12px;
  font-size: 11px; color: var(--text-2);
  font-family: monospace; white-space: pre-wrap;
  max-height: 160px; overflow-y: auto;
}

/* Buttons */
.studio-btn-sm {
  padding: 7px 14px; background: rgba(255,255,255,0.06);
  border: 1px solid var(--border); border-radius: 7px;
  color: var(--text-2); font-size: 12px; font-weight: 600;
  font-family: var(--font); cursor: pointer; transition: all 0.15s;
  white-space: nowrap;
}
.studio-btn-sm:hover { background: rgba(255,255,255,0.1); color: var(--text); }
.studio-btn-sm.primary { border-color: rgba(99,102,241,0.4); color: var(--accent-2); }
.studio-btn-sm.primary:hover { background: rgba(99,102,241,0.1); }
.studio-btn-sm.danger { border-color: rgba(239,68,68,0.35); color: #f87171; }
.studio-btn-sm.danger:hover { background: rgba(239,68,68,0.08); }
.studio-btn-sm.success { border-color: rgba(74,222,128,0.3); color: #4ade80; }
.studio-btn-sm.success:hover { background: rgba(74,222,128,0.08); }

/* Badges inline */
.ab { display: inline-block; padding: 2px 7px; border-radius: 20px; font-size: 10px; font-weight: 600; }
.ab-active   { background: rgba(74,222,128,0.1); color: #4ade80; }
.ab-blocked  { background: rgba(239,68,68,0.1); color: #f87171; }
.ab-pending  { background: rgba(251,191,36,0.1); color: #fbbf24; }
.ab-delivered{ background: rgba(99,102,241,0.1); color: #818cf8; }
.ab-open     { background: rgba(251,146,60,0.15); color: #fb923c; }
.ab-starter  { background: rgba(99,102,241,0.1); color: #818cf8; }
.ab-pro      { background: rgba(167,139,250,0.1); color: #a78bfa; }
.ab-agency   { background: rgba(251,191,36,0.1); color: #fbbf24; }
.ab-newsletter{ background: rgba(74,222,128,0.1); color: #4ade80; }

@media (max-width: 700px) {
  .studio-tabs { display: none; }
  .admin-stats { grid-template-columns: repeat(2, 1fr); }
  .admin-actions-grid { grid-template-columns: 1fr; }
}
