/* ═══════════════════════════════════════════════════════════════════════════
   SkillBro — Component Styles
   ═══════════════════════════════════════════════════════════════════════════ */

/* ── Top Bar ───────────────────────────────────────────────────────────────── */
#appTopBar { display: flex; align-items: center; gap: 12px; padding: 12px 16px; background: #fff; border-bottom: 1px solid #e2e8f0; position: sticky; top: 0; z-index: 30; }
.topbar-logo-slot { width: 36px; height: 36px; flex-shrink: 0; }
.topbar-logo img { display: block; width: 100%; height: 100%; object-fit: contain; }
.topbar-page-meta { flex: 1; min-width: 0; }
.topbar-page-title { font-size: 15px; font-weight: 700; color: #0f172a; display: block; }
.topbar-page-description { font-size: 11px; color: #475569; display: block; }
.topbar-actions { display: flex; align-items: center; gap: 8px; }
.topbar-credit-btn { background: #eef2ff; color: #4f46e5; border: none; border-radius: 8px; padding: 4px 10px; font-size: 12px; font-weight: 600; cursor: pointer; }
.topbar-avatar-btn { width: 32px; height: 32px; border-radius: 50%; background: #e2e8f0; border: none; font-size: 12px; font-weight: 700; cursor: pointer; }
.topbar-plan-badge { display: none; background: #ede9fe; color: #7c3aed; border: 1px solid #ddd6fe; border-radius: 8px; padding: 4px 10px; font-size: 11px; font-weight: 700; letter-spacing: 0.03em; }
.topbar-plan-badge.topbar-plan-badge-visible { display: inline-block; }

/* ── Sidebar ───────────────────────────────────────────────────────────────── */
#appLayout { display: flex; flex-direction: column; height: 100vh; overflow: hidden; }
#sidebarNav { width: 220px; background: #fff; border-right: 1px solid #e2e8f0; display: flex; flex-direction: column; flex-shrink: 0; height: 100%; }
.sidebar-menu { flex: 1; padding: 8px; overflow-y: auto; }
.sidebar-footer { padding: 12px; border-top: 1px solid #e2e8f0; }
.sidebar-credits-bar { margin-bottom: 8px; }
.sidebar-credits-label { display: flex; justify-content: space-between; font-size: 11px; color: #475569; margin-bottom: 4px; }
.sidebar-credits-bar-bg { height: 6px; background: #e2e8f0; border-radius: 3px; overflow: hidden; }
.sidebar-credits-fill { height: 100%; background: linear-gradient(90deg, #4f46e5, #7c3aed); border-radius: 3px; transition: width 0.3s; }
.sidebar-footer-link { display: block; width: 100%; padding: 6px 0; border: none; background: none; text-align: left; font-size: 12px; color: #334155; cursor: pointer; }
.sidebar-footer-link:hover { color: #0f172a; }
.sidebar-footer-link:disabled { opacity: 0.4; cursor: default; }

/* ── Develop tab idea titles (darker for readability) ──────────────────────── */
.develop-idea-title { color: #1e293b; font-weight: 600; }
.sidebar-logout { color: #dc2626; }

/* ── Content Area ──────────────────────────────────────────────────────────── */
#contentArea { display: flex; flex: 1; min-height: 0; }
#mainArea { flex: 1; overflow-y: auto; }
.dynamic-content-frame { padding: 20px; max-width: 1500px; }

/* ── Dashboard Cards ───────────────────────────────────────────────────────── */
.dashboard-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; max-width: 640px; }
.dashboard-card { background: #fff; border: 1px solid #e2e8f0; border-radius: 11px; padding: 16px; cursor: pointer; transition: all 0.15s; }
.dashboard-card:hover { border-color: #4f46e5; transform: translateY(-2px); box-shadow: 0 8px 24px rgba(79,70,229,0.12); }
.dashboard-card-icon { font-size: 24px; margin-bottom: 8px; }
.dashboard-card-title { font-size: 12px; font-weight: 600; color: #0f172a; }

/* ── Tab Content ───────────────────────────────────────────────────────────── */
.tab-content { padding: 0; }

/* ── Status Badges ─────────────────────────────────────────────────────────── */
.review-card { background: #f8fafc; border: 1px solid #e2e8f0; border-radius: 8px; padding: 10px; margin-bottom: 8px; }
.review-card label { font-size: 10px; text-transform: uppercase; letter-spacing: 0.05em; color: #475569; }

.badge {
  display: inline-flex;
  align-items: center;
  font-size: 11px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 999px;
}
.badge-active   { background: #dcfce7; color: #166534; }
.badge-scheduled { background: #dbeafe; color: #1e40af; }
.badge-planner  { background: #fef9c3; color: #854d0e; }
.badge-archived { background: #f1f5f9; color: #475569; }

/* ── Idea Source Indicator ─────────────────────────────────────────────────── */
.idea-source {
  font-size: 11px;
  font-weight: 600;
  margin-left: 6px;
  padding: 2px 6px;
  border-radius: 4px;
}
.idea-source:not(.ai) {
  color: #0c4a6e;
  background: #e0f2fe;
}
.idea-source.ai {
  color: #92400e;
  background: #fef3c7;
}

/* ── Archive ───────────────────────────────────────────────────────────────── */
.archive-item { }

/* ── Media Grid ────────────────────────────────────────────────────────────── */
.media-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 12px; }
.media-item { border-radius: 8px; overflow: hidden; border: 1px solid #e2e8f0; }
.media-item img { width: 100%; height: 150px; object-fit: cover; }

/* ── Modal ─────────────────────────────────────────────────────────────────── */
.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: rgba(15, 23, 42, 0.6);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.modal-content {
  background: #fff;
  border-radius: 12px;
  max-width: 560px;
  width: 100%;
  max-height: 80vh;
  display: flex;
  flex-direction: column;
  box-shadow: 0 20px 60px rgba(0,0,0,0.2);
}
.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid #e2e8f0;
}
.modal-body {
  padding: 20px;
  overflow-y: auto;
  flex: 1;
  line-height: 1.6;
}
.modal-footer {
  padding: 12px 20px;
  border-top: 1px solid #e2e8f0;
  display: flex;
  justify-content: flex-end;
}

/* ── Image tab panels (mutually exclusive) ─────────────────────────────────── */
.image-panel-active {
  border-color: #4f46e5 !important;
  box-shadow: 0 0 0 2px rgba(79,70,229,0.15);
}
.image-panel-inactive {
  opacity: 0.5;
  pointer-events: none;
}

/* ── Responsive ───────────────────────────────────────────────────────────── */
@media (max-width: 768px) {
  #sidebarNav { display: none; }
  .dashboard-grid { grid-template-columns: 1fr; }
}
