/**
 * Portfolio Admin Suite Stylesheet
 */
:root {
  --bg: #0f0e17;
  --bg-card: #171622;
  --bg-input: #212030;
  --border: rgba(255, 255, 255, 0.1);
  --text: #fffffe;
  --text-muted: #a7a9be;
  --accent: #7c5cff;
  --accent-hover: #9275ff;
  --yel: #ffe14d;
  --coral: #ff5c5c;
  --teal: #00c9a0;
  --font-h: 'CabinetGrotesk-Variable', 'Cabinet Grotesk', -apple-system, sans-serif;
  --font-b: 'Plus Jakarta Sans', -apple-system, sans-serif;
  --radius: 12px;
}

[data-theme="light"] {
  --bg: #fafaf8;
  --bg-card: #ffffff;
  --bg-input: #f3f0eb;
  --border: rgba(0, 0, 0, 0.08);
  --text: #0f0e0c;
  --text-muted: #6b665f;
  --accent: #7c5cff;
  --accent-hover: #6340f5;
  --yel: #ffe14d;
  --coral: #ff5c5c;
  --teal: #00a884;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-b);
  font-size: 15px;
  line-height: 1.6;
  min-height: 100vh;
}

/* NAVBAR */
.admin-nav {
  position: sticky;
  top: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 36px;
  background: var(--bg-card);
  border-bottom: 1px solid var(--border);
  backdrop-filter: blur(12px);
}
.admin-logo {
  font-family: var(--font-h);
  font-size: 20px;
  font-weight: 800;
  color: var(--text);
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 10px;
}
.admin-logo span { color: var(--accent); }
.admin-badge {
  background: rgba(124, 92, 255, 0.15);
  color: var(--accent);
  padding: 4px 10px;
  border-radius: 100px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
}
.admin-nav-actions { display: flex; align-items: center; gap: 14px; }

/* BUTTONS */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 20px;
  border-radius: 100px;
  font-family: var(--font-b);
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  border: 1px solid transparent;
  transition: all 0.2s ease;
}
.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--accent-hover); transform: translateY(-2px); box-shadow: 0 8px 20px rgba(124,92,255,0.3); }
.btn-outline { background: transparent; border-color: var(--border); color: var(--text); }
.btn-outline:hover { background: var(--bg-input); }
.btn-danger { background: rgba(255, 92, 92, 0.15); color: var(--coral); border-color: rgba(255, 92, 92, 0.3); }
.btn-danger:hover { background: var(--coral); color: #fff; }

/* CONTAINER & LAYOUT */
.admin-container { max-width: 1400px; margin: 0 auto; padding: 36px 36px 80px; }

/* STATS BAR */
.stats-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 20px; margin-bottom: 36px; }
.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  display: flex;
  flex-direction: column;
}
.stat-val { font-family: var(--font-h); font-size: 32px; font-weight: 800; color: var(--text); }
.stat-lbl { font-size: 13px; color: var(--text-muted); font-weight: 500; margin-top: 4px; }

/* TOOLBAR & LIVE SEARCH */
.toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
  margin-bottom: 24px;
}
.search-wrap {
  position: relative;
  flex: 1;
  max-width: 460px;
}
.search-input {
  width: 100%;
  padding: 12px 18px 12px 42px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 100px;
  color: var(--text);
  font-size: 14px;
  outline: none;
  transition: border-color 0.2s;
}
.search-input:focus { border-color: var(--accent); }
.search-icon {
  position: absolute;
  left: 16px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  pointer-events: none;
}

/* PROJECTS GRID */
.project-cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(360px, 1fr));
  gap: 24px;
}
.proj-admin-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: transform 0.2s, box-shadow 0.2s;
}
.proj-admin-card:hover { transform: translateY(-4px); box-shadow: 0 16px 36px rgba(0,0,0,0.2); }
.pac-thumb { height: 180px; position: relative; background: #000; overflow: hidden; }
.pac-thumb img { width: 100%; height: 100%; object-fit: cover; }
.pac-badge {
  position: absolute;
  top: 12px;
  left: 12px;
  background: rgba(0,0,0,0.7);
  color: #fff;
  backdrop-filter: blur(8px);
  padding: 4px 10px;
  border-radius: 100px;
  font-size: 11px;
  font-weight: 700;
}
.pac-body { padding: 20px; flex: 1; display: flex; flex-direction: column; }
.pac-title { font-family: var(--font-h); font-size: 18px; font-weight: 700; margin-bottom: 6px; }
.pac-desc { font-size: 13px; color: var(--text-muted); margin-bottom: 16px; line-height: 1.6; flex: 1; }
.pac-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 14px;
  border-top: 1px solid var(--border);
}
.pac-actions { display: flex; gap: 8px; }

/* TABS NAVIGATION */
.studio-tabs {
  display: flex;
  gap: 8px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 28px;
  overflow-x: auto;
  padding-bottom: 4px;
}
.studio-tab {
  padding: 10px 18px;
  border-radius: 8px 8px 0 0;
  font-size: 14px;
  font-weight: 600;
  color: var(--text-muted);
  cursor: pointer;
  border: none;
  background: transparent;
  border-bottom: 2px solid transparent;
  transition: all 0.2s;
  white-space: nowrap;
}
.studio-tab:hover { color: var(--text); background: var(--bg-input); }
.studio-tab.active {
  color: var(--accent);
  border-bottom-color: var(--accent);
  background: rgba(124, 92, 255, 0.08);
}
.tab-content { display: none; }
.tab-content.active { display: block; }

/* STUDIO FORM & PREVIEW */
.studio-layout {
  display: grid;
  grid-template-columns: 1fr 440px;
  gap: 32px;
  align-items: start;
}
@media (max-width: 1100px) {
  .studio-layout { grid-template-columns: 1fr; }
}
.form-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 32px;
}
.form-group { margin-bottom: 20px; }
.form-label { display: block; font-size: 13px; font-weight: 600; margin-bottom: 8px; color: var(--text); }
.form-input, .form-select, .form-textarea {
  width: 100%;
  padding: 12px 16px;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text);
  font-family: inherit;
  font-size: 14px;
  outline: none;
  transition: border-color 0.2s;
}
.form-input:focus, .form-select:focus, .form-textarea:focus { border-color: var(--accent); }
.form-textarea { resize: vertical; min-height: 200px; font-family: monospace; line-height: 1.6; }
.code-editor { min-height: 520px; font-family: 'Fira Code', Consolas, monospace; font-size: 13px; background: #0b0a12; color: #a5b4fc; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.form-row-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 12px; }

/* METRIC ROW */
.metric-box {
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 14px;
  margin-bottom: 12px;
  display: grid;
  grid-template-columns: 120px 100px 1fr;
  gap: 12px;
  align-items: center;
}

/* DROPZONE */
.dropzone {
  border: 2px dashed var(--border);
  border-radius: var(--radius);
  padding: 24px;
  text-align: center;
  background: var(--bg-input);
  cursor: pointer;
  position: relative;
  transition: border-color 0.2s;
}
.dropzone:hover { border-color: var(--accent); }
.dropzone input[type="file"] { position: absolute; inset: 0; opacity: 0; cursor: pointer; width: 100%; height: 100%; }
.preview-img { max-height: 180px; border-radius: 8px; margin-top: 12px; display: none; object-fit: cover; width: 100%; }

/* PREVIEW PANE */
.preview-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px;
  position: sticky;
  top: 90px;
  max-height: calc(100vh - 120px);
  overflow-y: auto;
}
.preview-title { font-family: var(--font-h); font-size: 24px; font-weight: 800; margin-bottom: 6px; }
.preview-body h2 { font-family: var(--font-h); font-size: 18px; margin: 20px 0 8px; color: var(--accent); }
.preview-body p { margin-bottom: 12px; font-size: 13px; color: var(--text-muted); }
