﻿/* ===== Jetboard Hub Admin PANEL STYLES ===== */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&family=JetBrains+Mono:wght@400;700&display=swap');

:root {
  --bg: #06060f;
  --bg2: #0a0a1a;
  --bg3: #0d0d22;
  --sidebar-bg: #080818;
  --card: rgba(255,255,255,0.03);
  --card-hover: rgba(255,255,255,0.06);
  --border: rgba(255,255,255,0.08);
  --border-light: rgba(255,255,255,0.05);
  --primary: #00d4ff;
  --primary-glow: rgba(0,212,255,0.2);
  --secondary: #7c3aed;
  --gold: #f59e0b;
  --green: #10b981;
  --red: #ef4444;
  --orange: #f97316;
  --text: #f1f5f9;
  --text2: #94a3b8;
  --text3: #475569;
  --font: 'Inter', sans-serif;
  --font-mono: 'JetBrains Mono', monospace;
  --radius: 12px;
  --radius-sm: 8px;
  --sidebar-w: 260px;
  --header-h: 64px;
}

*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }
html { height: 100%; }
body { font-family: var(--font); background: var(--bg); color: var(--text); height: 100%; -webkit-font-smoothing: antialiased; overflow: hidden; }
::-webkit-scrollbar { width: 4px; height: 4px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 2px; }
a { color: inherit; text-decoration: none; }

/* ===== LAYOUT ===== */
.admin-layout { display: flex; height: 100vh; }

/* ===== SIDEBAR ===== */
.sidebar {
  width: var(--sidebar-w); height: 100vh; background: var(--sidebar-bg);
  border-right: 1px solid var(--border); display: flex; flex-direction: column;
  position: fixed; left: 0; top: 0; z-index: 100; overflow-y: auto; flex-shrink: 0;
  transition: transform 0.3s ease;
}
.sidebar-logo {
  padding: 20px 20px 16px; border-bottom: 1px solid var(--border-light);
  display: flex; align-items: center; gap: 10px;
}
.sidebar-logo-icon {
  width: 36px; height: 36px; border-radius: 8px;
  background: linear-gradient(135deg, #00d4ff, #7c3aed);
  display: flex; align-items: center; justify-content: center; font-size: 18px; flex-shrink: 0;
}
.sidebar-logo-text { font-size: 16px; font-weight: 700; }
.sidebar-logo-text span { font-size: 11px; color: var(--text3); display: block; margin-top: 1px; }
.sidebar-nav { padding: 12px 0; flex: 1; }
.nav-section { padding: 0 12px; margin-bottom: 4px; }
.nav-section-label { font-size: 10px; font-weight: 600; color: var(--text3); letter-spacing: 0.1em; text-transform: uppercase; padding: 8px 8px 4px; }
.nav-item {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 12px; border-radius: var(--radius-sm);
  font-size: 14px; font-weight: 500; color: var(--text2);
  cursor: pointer; transition: all 0.2s; position: relative;
  margin-bottom: 2px;
}
.nav-item:hover { background: var(--card-hover); color: var(--text); }
.nav-item.active { background: rgba(0,212,255,0.1); color: var(--primary); }
.nav-item.active::before { content: ''; position: absolute; left: 0; top: 25%; bottom: 25%; width: 3px; border-radius: 0 2px 2px 0; background: var(--primary); }
.nav-item i { width: 18px; text-align: center; font-size: 15px; flex-shrink: 0; }
.nav-badge { margin-left: auto; padding: 2px 8px; border-radius: 100px; font-size: 10px; font-weight: 700; background: var(--red); color: #fff; }
.sidebar-footer { padding: 16px; border-top: 1px solid var(--border-light); }
.sidebar-user { display: flex; align-items: center; gap: 10px; padding: 10px; border-radius: var(--radius-sm); cursor: pointer; transition: all 0.2s; }
.sidebar-user:hover { background: var(--card-hover); }
.user-avatar { width: 34px; height: 34px; border-radius: 50%; background: linear-gradient(135deg, #00d4ff, #7c3aed); display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 14px; flex-shrink: 0; }
.user-name { font-size: 13px; font-weight: 600; }
.user-role { font-size: 11px; color: var(--text3); }

/* ===== MAIN ===== */
.admin-main { margin-left: var(--sidebar-w); flex: 1; display: flex; flex-direction: column; min-height: 100vh; overflow: hidden; }

/* ===== HEADER ===== */
.admin-header {
  height: var(--header-h); padding: 0 24px; border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between;
  background: rgba(6,6,15,0.8); backdrop-filter: blur(20px);
  position: sticky; top: 0; z-index: 50;
}
.header-left { display: flex; align-items: center; gap: 16px; }
.page-title { font-size: 18px; font-weight: 700; }
.breadcrumb { font-size: 12px; color: var(--text3); display: flex; align-items: center; gap: 4px; }
.header-right { display: flex; align-items: center; gap: 12px; }
.header-btn { padding: 8px 16px; border-radius: var(--radius-sm); font-size: 13px; font-weight: 600; cursor: pointer; border: 1px solid var(--border); background: var(--card); color: var(--text2); display: flex; align-items: center; gap: 6px; transition: all 0.2s; }
.header-btn:hover { background: var(--card-hover); color: var(--text); }
.header-btn.primary { background: linear-gradient(135deg, #00d4ff, #7c3aed); color: #fff; border-color: transparent; }
.header-btn.primary:hover { opacity: 0.9; transform: translateY(-1px); }

/* ===== CONTENT ===== */
.admin-content { flex: 1; overflow-y: auto; padding: 24px; }

/* ===== STATS ===== */
.stats-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-bottom: 24px; }
.stat-card { padding: 20px; border-radius: var(--radius); border: 1px solid var(--border); background: var(--card); transition: all 0.2s; }
.stat-card:hover { border-color: rgba(0,212,255,0.2); background: var(--card-hover); }
.stat-card-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; }
.stat-icon { width: 40px; height: 40px; border-radius: 10px; display: flex; align-items: center; justify-content: center; font-size: 18px; }
.stat-icon.blue { background: rgba(0,212,255,0.1); }
.stat-icon.purple { background: rgba(124,58,237,0.1); }
.stat-icon.gold { background: rgba(245,158,11,0.1); }
.stat-icon.green { background: rgba(16,185,129,0.1); }
.stat-trend { font-size: 12px; font-weight: 600; padding: 3px 8px; border-radius: 100px; }
.stat-trend.up { background: rgba(16,185,129,0.1); color: var(--green); }
.stat-trend.down { background: rgba(239,68,68,0.1); color: var(--red); }
.stat-value { font-size: 28px; font-weight: 700; font-family: var(--font-mono); }
.stat-label { font-size: 13px; color: var(--text2); margin-top: 4px; }

/* ===== CARDS ===== */
.card { padding: 20px; border-radius: var(--radius); border: 1px solid var(--border); background: var(--card); }
.card-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 20px; }
.card-title { font-size: 15px; font-weight: 700; display: flex; align-items: center; gap: 8px; }
.card-title i { color: var(--primary); }

/* ===== TABLES ===== */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
thead { background: rgba(255,255,255,0.02); }
th { padding: 10px 14px; text-align: left; font-size: 11px; font-weight: 600; color: var(--text3); text-transform: uppercase; letter-spacing: 0.08em; border-bottom: 1px solid var(--border); white-space: nowrap; }
td { padding: 12px 14px; font-size: 13px; color: var(--text2); border-bottom: 1px solid var(--border-light); vertical-align: middle; }
tr:last-child td { border-bottom: none; }
tr:hover td { background: rgba(255,255,255,0.02); color: var(--text); }
.td-name { font-weight: 600; color: var(--text); max-width: 200px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.td-actions { display: flex; gap: 6px; white-space: nowrap; }

/* ===== BUTTONS (admin) ===== */
.btn { display: inline-flex; align-items: center; gap: 6px; padding: 9px 18px; border-radius: var(--radius-sm); font-family: var(--font); font-size: 13px; font-weight: 600; cursor: pointer; border: none; transition: all 0.2s; white-space: nowrap; }
.btn-primary { background: linear-gradient(135deg, #00d4ff, #7c3aed); color: #fff; }
.btn-primary:hover { opacity: 0.9; transform: translateY(-1px); box-shadow: 0 4px 16px rgba(0,212,255,0.3); }
.btn-outline { background: transparent; border: 1px solid var(--border); color: var(--text2); }
.btn-outline:hover { border-color: var(--primary); color: var(--primary); background: rgba(0,212,255,0.05); }
.btn-danger { background: rgba(239,68,68,0.1); color: var(--red); border: 1px solid rgba(239,68,68,0.2); }
.btn-danger:hover { background: var(--red); color: #fff; }
.btn-success { background: rgba(16,185,129,0.1); color: var(--green); border: 1px solid rgba(16,185,129,0.2); }
.btn-success:hover { background: var(--green); color: #fff; }
.btn-sm { padding: 6px 12px; font-size: 12px; }
.btn-icon { width: 32px; height: 32px; padding: 0; justify-content: center; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; transform: none; }

/* ===== FORMS (admin) ===== */
.form-group { margin-bottom: 16px; }
.form-label { display: block; font-size: 12px; font-weight: 600; color: var(--text2); margin-bottom: 6px; text-transform: uppercase; letter-spacing: 0.05em; }
.form-input { width: 100%; padding: 10px 14px; border-radius: var(--radius-sm); background: rgba(255,255,255,0.04); border: 1px solid var(--border); color: var(--text); font-family: var(--font); font-size: 14px; transition: all 0.2s; outline: none; }
.form-input:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(0,212,255,0.15); background: rgba(255,255,255,0.06); }
.form-input::placeholder { color: var(--text3); }
textarea.form-input { resize: vertical; min-height: 100px; }
select.form-input { cursor: pointer; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.form-row-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 16px; }
.form-hint { font-size: 11px; color: var(--text3); margin-top: 4px; }
.required { color: var(--red); }

/* ===== STATUS BADGES ===== */
.status { display: inline-flex; align-items: center; gap: 4px; padding: 3px 10px; border-radius: 100px; font-size: 11px; font-weight: 600; }
.status::before { content: ''; width: 5px; height: 5px; border-radius: 50%; background: currentColor; }
.status-published, .status-active { background: rgba(16,185,129,0.1); color: var(--green); }
.status-draft { background: rgba(100,116,139,0.15); color: var(--text3); }
.status-new { background: rgba(0,212,255,0.1); color: var(--primary); }
.status-pending { background: rgba(245,158,11,0.1); color: var(--gold); }
.status-processing { background: rgba(124,58,237,0.1); color: #a78bfa; }
.status-done { background: rgba(16,185,129,0.1); color: var(--green); }
.status-inactive { background: rgba(239,68,68,0.1); color: var(--red); }

/* ===== PANELS / VIEWS ===== */
.panel { display: none; }
.panel.active { display: block; }

/* ===== EDITOR ===== */
.editor-toolbar { display: flex; gap: 4px; flex-wrap: wrap; padding: 8px 12px; border-radius: var(--radius-sm) var(--radius-sm) 0 0; border: 1px solid var(--border); background: rgba(255,255,255,0.03); border-bottom: none; }
.editor-btn { width: 30px; height: 28px; border-radius: 4px; border: none; background: transparent; color: var(--text2); cursor: pointer; display: flex; align-items: center; justify-content: center; font-size: 12px; transition: all 0.15s; font-family: var(--font); font-weight: 600; }
.editor-btn:hover { background: rgba(255,255,255,0.08); color: var(--text); }
.editor-divider { width: 1px; background: var(--border); margin: 0 4px; }
.editor-content { min-height: 300px; border: 1px solid var(--border); border-radius: 0 0 var(--radius-sm) var(--radius-sm); padding: 16px; outline: none; font-size: 14px; line-height: 1.7; color: var(--text); background: rgba(255,255,255,0.02); overflow-y: auto; }
.editor-content h2 { font-size: 20px; margin: 16px 0 8px; color: var(--primary); }
.editor-content h3 { font-size: 17px; margin: 12px 0 8px; }
.editor-content p { margin-bottom: 12px; }
.editor-content ul, .editor-content ol { margin: 8px 0 12px 24px; }
.editor-content li { margin-bottom: 4px; }
.editor-content strong { color: var(--text); }
.editor-content a { color: var(--primary); text-decoration: underline; }
.editor-content:focus { border-color: var(--primary); }

/* ===== AI PANEL ===== */
.ai-panel { padding: 20px; border-radius: var(--radius); border: 1px solid rgba(124,58,237,0.3); background: linear-gradient(135deg, rgba(0,212,255,0.04), rgba(124,58,237,0.04)); }
.ai-panel-title { font-size: 14px; font-weight: 700; display: flex; align-items: center; gap: 8px; margin-bottom: 16px; }
.ai-generating { display: flex; flex-direction: column; align-items: center; gap: 12px; padding: 32px; text-align: center; }
.ai-spinner { width: 40px; height: 40px; border: 3px solid rgba(0,212,255,0.2); border-top-color: var(--primary); border-radius: 50%; animation: spin 0.8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ===== MODAL ===== */
.modal-backdrop { position: fixed; inset: 0; z-index: 200; background: rgba(0,0,0,0.7); backdrop-filter: blur(8px); display: flex; align-items: center; justify-content: center; padding: 24px; opacity: 0; pointer-events: none; transition: opacity 0.2s; }
.modal-backdrop.show { opacity: 1; pointer-events: all; }
.modal-box { background: var(--bg2); border: 1px solid var(--border); border-radius: var(--radius); width: 100%; max-width: 640px; max-height: 90vh; overflow-y: auto; transform: scale(0.95); transition: transform 0.2s; }
.modal-backdrop.show .modal-box { transform: scale(1); }
.modal-lg { max-width: 960px; }
.modal-xl { max-width: 1200px; }
.modal-header { padding: 16px 20px; border-bottom: 1px solid var(--border); display: flex; align-items: center; justify-content: space-between; }
.modal-title-text { font-size: 16px; font-weight: 700; display: flex; align-items: center; gap: 8px; }
.modal-close-btn { width: 28px; height: 28px; border-radius: 6px; border: 1px solid var(--border); background: none; color: var(--text2); cursor: pointer; display: flex; align-items: center; justify-content: center; transition: all 0.15s; }
.modal-close-btn:hover { border-color: var(--red); color: var(--red); }
.modal-body { padding: 20px; }
.modal-footer { padding: 16px 20px; border-top: 1px solid var(--border); display: flex; gap: 10px; justify-content: flex-end; }

/* ===== IMAGE UPLOAD ===== */
.img-upload-zone { border: 2px dashed var(--border); border-radius: var(--radius-sm); padding: 32px; text-align: center; cursor: pointer; transition: all 0.2s; }
.img-upload-zone:hover, .img-upload-zone.drag-over { border-color: var(--primary); background: rgba(0,212,255,0.04); }
.img-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 12px; margin-top: 12px; }
.img-item { position: relative; border-radius: var(--radius-sm); overflow: hidden; aspect-ratio: 4/3; background: var(--bg3); }
.img-item img { width: 100%; height: 100%; object-fit: cover; }
.img-item-del { position: absolute; top: 4px; right: 4px; width: 24px; height: 24px; border-radius: 50%; background: rgba(239,68,68,0.9); color: #fff; border: none; cursor: pointer; display: flex; align-items: center; justify-content: center; font-size: 10px; }
.img-item-del:hover { background: var(--red); }

/* ===== MEDIA GRID ===== */
.media-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 12px; }
.media-item { position: relative; border-radius: var(--radius-sm); overflow: hidden; border: 2px solid transparent; cursor: pointer; transition: all 0.2s; background: var(--bg3); }
.media-item:hover { border-color: var(--primary); }
.media-item.selected { border-color: var(--primary); }
.media-item img { width: 100%; aspect-ratio: 4/3; object-fit: cover; display: block; }
.media-item-info { padding: 6px 8px; font-size: 11px; color: var(--text3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.media-item-del { position: absolute; top: 4px; right: 4px; width: 22px; height: 22px; border-radius: 50%; background: rgba(239,68,68,0.9); color: #fff; border: none; cursor: pointer; display: flex; align-items: center; justify-content: center; font-size: 10px; opacity: 0; transition: opacity 0.2s; }
.media-item:hover .media-item-del { opacity: 1; }

/* ===== TAGS INPUT ===== */
.tags-input-wrap { display: flex; flex-wrap: wrap; gap: 6px; padding: 8px; border: 1px solid var(--border); border-radius: var(--radius-sm); background: rgba(255,255,255,0.04); min-height: 44px; cursor: text; }
.tags-input-wrap:focus-within { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(0,212,255,0.15); }
.tag-chip { display: flex; align-items: center; gap: 4px; padding: 2px 10px; border-radius: 100px; background: rgba(0,212,255,0.15); color: var(--primary); font-size: 12px; font-weight: 500; }
.tag-chip button { background: none; border: none; cursor: pointer; color: var(--primary); opacity: 0.7; font-size: 12px; line-height: 1; }
.tag-chip button:hover { opacity: 1; }
.tags-real-input { border: none; outline: none; background: transparent; color: var(--text); font-size: 13px; min-width: 100px; flex: 1; padding: 2px 4px; font-family: var(--font); }

/* ===== TOAST ===== */
.toast-wrap { position: fixed; top: 16px; right: 16px; z-index: 9999; display: flex; flex-direction: column; gap: 8px; }
.toast { display: flex; align-items: center; gap: 10px; padding: 12px 16px; border-radius: var(--radius-sm); font-size: 13px; min-width: 280px; backdrop-filter: blur(20px); border: 1px solid; box-shadow: 0 4px 20px rgba(0,0,0,0.4); animation: slideIn 0.3s ease, fadeOut 0.3s ease 3.2s forwards; }
.toast-success { background: rgba(16,185,129,0.1); border-color: rgba(16,185,129,0.3); color: var(--green); }
.toast-error { background: rgba(239,68,68,0.1); border-color: rgba(239,68,68,0.3); color: var(--red); }
.toast-info { background: rgba(0,212,255,0.1); border-color: rgba(0,212,255,0.3); color: var(--primary); }
@keyframes slideIn { from { transform: translateX(110%); opacity: 0; } to { transform: translateX(0); opacity: 1; } }
@keyframes fadeOut { to { opacity: 0; pointer-events: none; height: 0; margin: 0; padding: 0; } }

/* ===== LOGIN ===== */
.login-screen { min-height: 100vh; display: flex; align-items: center; justify-content: center; background: radial-gradient(ellipse 60% 80% at 50% 50%, rgba(0,212,255,0.08), transparent), var(--bg); }
.login-card { width: 400px; padding: 40px; border-radius: 20px; border: 1px solid var(--border); background: rgba(10,10,26,0.9); backdrop-filter: blur(20px); }
.login-logo { text-align: center; margin-bottom: 32px; }
.login-logo-icon { width: 60px; height: 60px; border-radius: 16px; background: linear-gradient(135deg, #00d4ff, #7c3aed); display: flex; align-items: center; justify-content: center; font-size: 28px; margin: 0 auto 12px; }
.login-logo-text { font-size: 22px; font-weight: 700; }
.login-logo-sub { font-size: 13px; color: var(--text2); }
.login-title { font-size: 18px; font-weight: 700; margin-bottom: 24px; }

/* ===== LOADING ===== */
.loading-screen { display: flex; align-items: center; justify-content: center; height: 100vh; }
.loading-spinner { width: 40px; height: 40px; border: 3px solid var(--border); border-top-color: var(--primary); border-radius: 50%; animation: spin 0.8s linear infinite; }

/* ===== EMPTY STATE ===== */
.empty-state { text-align: center; padding: 60px 20px; color: var(--text2); }
.empty-state i { font-size: 40px; opacity: 0.3; margin-bottom: 16px; }
.empty-state h4 { font-size: 16px; color: var(--text); margin-bottom: 8px; }
.empty-state p { font-size: 13px; }

/* ===== RESPONSIVE ===== */
@media (max-width: 1024px) {
  .stats-row { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 768px) {
  .sidebar { transform: translateX(-100%); }
  .sidebar.open { transform: translateX(0); }
  .admin-main { margin-left: 0; }
  .form-row, .form-row-3 { grid-template-columns: 1fr; }
  .stats-row { grid-template-columns: 1fr 1fr; }
}
