/* ============================================================
   CaptionBangla Admin Panel — Stylesheet
   Font: Plus Jakarta Sans + JetBrains Mono
   Theme: Dark professional with green accent
   ============================================================ */

:root {
  --sidebar-width: 260px;
  --sidebar-collapsed: 70px;
  --topbar-height: 60px;

  --bg-base:       #0d0f13;
  --bg-surface:    #141720;
  --bg-card:       #1a1e2e;
  --bg-hover:      #1f2435;
  --bg-input:      #1a1e2e;

  --accent:        #22c55e;
  --accent-dim:    rgba(34, 197, 94, 0.15);
  --accent-hover:  #16a34a;

  --text-primary:  #f1f5f9;
  --text-secondary:#94a3b8;
  --text-muted:    #475569;

  --border:        rgba(255,255,255,0.07);
  --border-light:  rgba(255,255,255,0.04);

  --danger:        #ef4444;
  --warning:       #f59e0b;
  --info:          #3b82f6;

  --radius-sm:     6px;
  --radius:        10px;
  --radius-lg:     14px;

  --shadow:        0 4px 24px rgba(0,0,0,0.3);
  --shadow-sm:     0 2px 8px rgba(0,0,0,0.2);

  --font-body:     'Plus Jakarta Sans', sans-serif;
  --font-mono:     'JetBrains Mono', monospace;

  --transition:    all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ── Reset & Base ──────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }

html { font-size: 14px; }

body {
  font-family: var(--font-body);
  background: var(--bg-base);
  color: var(--text-primary);
  margin: 0;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

/* ── Sidebar ───────────────────────────────────────────────── */
.sidebar {
  position: fixed;
  top: 0; left: 0;
  width: var(--sidebar-width);
  height: 100vh;
  background: var(--bg-surface);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  z-index: 1000;
  transition: var(--transition);
  overflow: hidden;
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 20px 18px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}

.brand-icon {
  width: 38px; height: 38px;
  background: var(--accent);
  color: #000;
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 13px;
  display: flex; align-items: center; justify-content: center;
  border-radius: var(--radius-sm);
  flex-shrink: 0;
  letter-spacing: 0.5px;
}

.brand-text { display: flex; flex-direction: column; }
.brand-name {
  font-size: 14px; font-weight: 700;
  color: var(--text-primary); line-height: 1.2;
  white-space: nowrap;
}
.brand-sub {
  font-size: 11px; color: var(--text-muted);
  letter-spacing: 0.5px; text-transform: uppercase;
  white-space: nowrap;
}

.sidebar-nav {
  flex: 1;
  overflow-y: auto;
  padding: 12px 10px;
  scrollbar-width: thin;
  scrollbar-color: var(--border) transparent;
}

.nav-section-label {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 1.2px;
  text-transform: uppercase;
  color: var(--text-muted);
  padding: 14px 10px 6px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 13.5px;
  font-weight: 500;
  transition: var(--transition);
  position: relative;
  margin-bottom: 2px;
  white-space: nowrap;
}

.nav-item i {
  font-size: 16px;
  width: 20px;
  flex-shrink: 0;
  text-align: center;
}

.nav-item:hover {
  background: var(--bg-hover);
  color: var(--text-primary);
}

.nav-item.active {
  background: var(--accent-dim);
  color: var(--accent);
}

.nav-item.active i { color: var(--accent); }

.nav-badge {
  margin-left: auto;
  background: var(--danger);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 99px;
  line-height: 1.4;
}

.sidebar-footer {
  padding: 14px 14px;
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

.sidebar-user {
  display: flex; align-items: center; gap: 10px; flex: 1; overflow: hidden;
}

.user-avatar {
  width: 34px; height: 34px;
  background: linear-gradient(135deg, var(--accent), #16a34a);
  color: #000;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 14px;
  flex-shrink: 0;
}

.user-info { display: flex; flex-direction: column; overflow: hidden; }
.user-name { font-size: 13px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.user-role { font-size: 11px; color: var(--text-muted); }

.btn-logout {
  color: var(--text-muted);
  font-size: 18px;
  padding: 4px;
  border-radius: var(--radius-sm);
  transition: var(--transition);
  flex-shrink: 0;
  text-decoration: none;
}
.btn-logout:hover { color: var(--danger); background: rgba(239,68,68,0.1); }

/* ── Main Wrapper ──────────────────────────────────────────── */
.main-wrapper {
  margin-left: var(--sidebar-width);
  min-height: 100vh;
  transition: var(--transition);
  display: flex;
  flex-direction: column;
}

/* ── Topbar ────────────────────────────────────────────────── */
.topbar {
  position: sticky; top: 0;
  height: var(--topbar-height);
  background: var(--bg-surface);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  padding: 0 24px;
  gap: 16px;
  z-index: 100;
  flex-shrink: 0;
}

.sidebar-toggle {
  background: none;
  border: none;
  color: var(--text-secondary);
  font-size: 22px;
  padding: 4px 8px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: var(--transition);
  line-height: 1;
}
.sidebar-toggle:hover { background: var(--bg-hover); color: var(--text-primary); }

.topbar-breadcrumb {
  display: flex; align-items: center; gap: 8px;
  font-size: 13px; color: var(--text-secondary); flex: 1;
}
.breadcrumb-app { color: var(--text-muted); }
.breadcrumb-app + i { color: var(--text-muted); font-size: 11px; }
.breadcrumb-page { color: var(--text-primary); font-weight: 600; }

.topbar-right { display: flex; align-items: center; gap: 8px; }

/* ── Flash Messages ────────────────────────────────────────── */
.flash-container { padding: 16px 24px 0; }

/* ── Page Content ──────────────────────────────────────────── */
.page-content {
  flex: 1;
  padding: 24px;
}

/* ── Page Header ───────────────────────────────────────────── */
.page-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 24px;
  gap: 16px;
}
.page-header-text h1 {
  font-size: 22px; font-weight: 700; margin: 0 0 4px;
}
.page-header-text p {
  color: var(--text-secondary); margin: 0; font-size: 13.5px;
}

/* ── Stat Cards ────────────────────────────────────────────── */
.stat-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 16px; margin-bottom: 28px; }

.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px;
  display: flex;
  align-items: center;
  gap: 16px;
  transition: var(--transition);
  text-decoration: none;
  color: inherit;
}
.stat-card:hover {
  border-color: var(--accent);
  transform: translateY(-2px);
  box-shadow: 0 8px 32px rgba(34,197,94,0.1);
  color: inherit;
}

.stat-icon {
  width: 48px; height: 48px;
  border-radius: var(--radius);
  display: flex; align-items: center; justify-content: center;
  font-size: 22px;
  flex-shrink: 0;
}
.stat-icon.green  { background: rgba(34,197,94,0.12);  color: #22c55e; }
.stat-icon.blue   { background: rgba(59,130,246,0.12); color: #3b82f6; }
.stat-icon.orange { background: rgba(245,158,11,0.12); color: #f59e0b; }
.stat-icon.red    { background: rgba(239,68,68,0.12);  color: #ef4444; }
.stat-icon.purple { background: rgba(168,85,247,0.12); color: #a855f7; }

.stat-info .stat-value {
  font-size: 26px; font-weight: 700; line-height: 1.1;
  font-family: var(--font-mono);
}
.stat-info .stat-label {
  font-size: 12px; color: var(--text-muted); text-transform: uppercase;
  letter-spacing: 0.8px; font-weight: 600; margin-top: 2px;
}

/* ── Cards ─────────────────────────────────────────────────── */
.card {
  background: var(--bg-card) !important;
  border: 1px solid var(--border) !important;
  border-radius: var(--radius-lg) !important;
}
.card-header {
  background: transparent !important;
  border-bottom: 1px solid var(--border) !important;
  padding: 16px 20px !important;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.card-header h5, .card-header h6 {
  margin: 0; font-weight: 600; font-size: 15px;
  display: flex; align-items: center; gap: 8px;
}
.card-body { padding: 20px !important; }

/* ── Tables ────────────────────────────────────────────────── */
.table {
  color: var(--text-primary) !important;
  margin: 0;
}
.table > thead > tr > th {
  background: var(--bg-hover) !important;
  color: var(--text-muted) !important;
  font-size: 11px !important;
  font-weight: 700 !important;
  letter-spacing: 0.8px;
  text-transform: uppercase;
  border-color: var(--border) !important;
  padding: 10px 16px !important;
  white-space: nowrap;
}
.table > tbody > tr > td {
  border-color: var(--border-light) !important;
  padding: 12px 16px !important;
  vertical-align: middle;
  color: var(--text-primary);
}
.table > tbody > tr:hover > td { background: var(--bg-hover) !important; }
.table-responsive { border-radius: var(--radius) !important; overflow: hidden; }

/* ── Forms ─────────────────────────────────────────────────── */
.form-control, .form-select, .form-check-input {
  background: var(--bg-input) !important;
  border: 1px solid var(--border) !important;
  color: var(--text-primary) !important;
  border-radius: var(--radius-sm) !important;
  font-family: var(--font-body);
  transition: var(--transition);
}
.form-control:focus, .form-select:focus {
  border-color: var(--accent) !important;
  box-shadow: 0 0 0 3px rgba(34,197,94,0.15) !important;
  background: var(--bg-input) !important;
  color: var(--text-primary) !important;
}
.form-control::placeholder { color: var(--text-muted) !important; }
.form-label {
  font-size: 13px; font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 6px;
}
.form-text { color: var(--text-muted); font-size: 12px; }
.input-group-text {
  background: var(--bg-hover) !important;
  border-color: var(--border) !important;
  color: var(--text-muted) !important;
}
textarea.form-control { min-height: 120px; resize: vertical; font-family: var(--font-body); }

/* ── Buttons ───────────────────────────────────────────────── */
.btn-accent {
  background: var(--accent);
  color: #000;
  font-weight: 600;
  border: none;
  padding: 8px 18px;
  border-radius: var(--radius-sm);
  transition: var(--transition);
  font-family: var(--font-body);
  font-size: 13.5px;
}
.btn-accent:hover { background: var(--accent-hover); color: #000; }

.btn-outline-secondary {
  border-color: var(--border) !important;
  color: var(--text-secondary) !important;
}
.btn-outline-secondary:hover {
  background: var(--bg-hover) !important;
  color: var(--text-primary) !important;
}

.btn-icon {
  padding: 5px 9px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text-secondary);
  transition: var(--transition);
  cursor: pointer;
  line-height: 1;
  text-decoration: none;
  display: inline-flex; align-items: center; justify-content: center;
}
.btn-icon:hover { background: var(--bg-hover); color: var(--text-primary); }
.btn-icon.danger:hover { background: rgba(239,68,68,0.1); color: var(--danger); border-color: rgba(239,68,68,0.3); }
.btn-icon.success:hover { background: var(--accent-dim); color: var(--accent); border-color: rgba(34,197,94,0.3); }

/* ── Badges ────────────────────────────────────────────────── */
.badge-category {
  background: rgba(59,130,246,0.15);
  color: #60a5fa;
  font-size: 11px;
  padding: 3px 8px;
  border-radius: 99px;
  font-weight: 600;
  white-space: nowrap;
}
.badge-active {
  background: rgba(34,197,94,0.12);
  color: var(--accent);
  font-size: 11px; padding: 3px 8px;
  border-radius: 99px; font-weight: 600;
}
.badge-inactive {
  background: rgba(100,116,139,0.15);
  color: var(--text-muted);
  font-size: 11px; padding: 3px 8px;
  border-radius: 99px; font-weight: 600;
}
.badge-unread {
  background: rgba(239,68,68,0.12);
  color: var(--danger);
  font-size: 11px; padding: 3px 8px;
  border-radius: 99px; font-weight: 600;
}

/* ── Emoji display ─────────────────────────────────────────── */
.emoji-cell { font-size: 20px; line-height: 1; }

/* ── Search & Filter bar ───────────────────────────────────── */
.filter-bar {
  display: flex; gap: 10px; flex-wrap: wrap;
  margin-bottom: 16px;
}
.filter-bar .form-control, .filter-bar .form-select {
  max-width: 220px; min-width: 140px;
}

/* ── Pagination ────────────────────────────────────────────── */
.pagination .page-link {
  background: var(--bg-card) !important;
  border-color: var(--border) !important;
  color: var(--text-secondary) !important;
  border-radius: var(--radius-sm) !important;
  margin: 0 2px;
  font-size: 13px;
}
.pagination .page-item.active .page-link {
  background: var(--accent) !important;
  border-color: var(--accent) !important;
  color: #000 !important;
  font-weight: 700;
}
.pagination .page-link:hover {
  background: var(--bg-hover) !important;
  color: var(--text-primary) !important;
}

/* ── Modals ────────────────────────────────────────────────── */
.modal-content {
  background: var(--bg-card) !important;
  border: 1px solid var(--border) !important;
  border-radius: var(--radius-lg) !important;
}
.modal-header {
  border-bottom: 1px solid var(--border) !important;
  padding: 18px 22px !important;
}
.modal-title { font-size: 15px; font-weight: 700; }
.modal-body { padding: 22px !important; }
.modal-footer {
  border-top: 1px solid var(--border) !important;
  padding: 14px 22px !important;
}
.btn-close { filter: invert(1) brightness(0.6); }

/* ── Alert ─────────────────────────────────────────────────── */
.alert-success {
  background: rgba(34,197,94,0.1) !important;
  border-color: rgba(34,197,94,0.3) !important;
  color: #4ade80 !important;
}
.alert-danger {
  background: rgba(239,68,68,0.1) !important;
  border-color: rgba(239,68,68,0.3) !important;
  color: #f87171 !important;
}

/* ── Profile card (developer/tribute) ─────────────────────── */
.profile-photo-wrap {
  position: relative; display: inline-block;
}
.profile-photo {
  width: 90px; height: 90px;
  border-radius: 50%;
  object-fit: cover;
  border: 3px solid var(--border);
}
.profile-photo-placeholder {
  width: 90px; height: 90px;
  border-radius: 50%;
  background: var(--bg-hover);
  border: 3px solid var(--border);
  display: flex; align-items: center; justify-content: center;
  font-size: 32px;
  color: var(--text-muted);
}

/* ── API Docs ──────────────────────────────────────────────── */
.endpoint-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 16px;
  overflow: hidden;
}
.endpoint-header {
  display: flex; align-items: center; gap: 12px;
  padding: 14px 18px;
  border-bottom: 1px solid var(--border);
}
.method-badge {
  font-family: var(--font-mono);
  font-size: 11px; font-weight: 700;
  padding: 3px 9px; border-radius: 4px;
  flex-shrink: 0;
}
.method-get  { background: rgba(34,197,94,0.15);  color: #22c55e; }
.method-post { background: rgba(59,130,246,0.15); color: #3b82f6; }
.endpoint-url {
  font-family: var(--font-mono);
  font-size: 13px; color: var(--text-primary);
}
.code-block {
  background: var(--bg-base);
  padding: 16px 18px;
  font-family: var(--font-mono);
  font-size: 12px;
  line-height: 1.7;
  color: #a3e635;
  overflow-x: auto;
  white-space: pre;
}

/* ── Feedback card ─────────────────────────────────────────── */
.feedback-item {
  padding: 16px;
  border-bottom: 1px solid var(--border-light);
  transition: var(--transition);
}
.feedback-item:last-child { border-bottom: none; }
.feedback-item:hover { background: var(--bg-hover); }
.feedback-item.unread { border-left: 3px solid var(--accent); }

/* ── Login page ────────────────────────────────────────────── */
.login-page {
  min-height: 100vh;
  display: flex; align-items: center; justify-content: center;
  background: var(--bg-base);
  background-image:
    radial-gradient(ellipse at 20% 50%, rgba(34,197,94,0.05) 0%, transparent 50%),
    radial-gradient(ellipse at 80% 20%, rgba(59,130,246,0.04) 0%, transparent 50%);
}
.login-card {
  width: 100%; max-width: 400px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 40px;
}
.login-logo {
  width: 52px; height: 52px;
  background: var(--accent);
  color: #000;
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 18px;
  display: flex; align-items: center; justify-content: center;
  border-radius: var(--radius);
  margin: 0 auto 20px;
}

/* ── Collapsed sidebar ─────────────────────────────────────── */
body.sidebar-collapsed .sidebar { width: var(--sidebar-collapsed); }
body.sidebar-collapsed .brand-text,
body.sidebar-collapsed .nav-section-label,
body.sidebar-collapsed .nav-item span,
body.sidebar-collapsed .nav-badge,
body.sidebar-collapsed .user-info,
body.sidebar-collapsed .btn-logout { display: none; }
body.sidebar-collapsed .nav-item { justify-content: center; padding: 10px; }
body.sidebar-collapsed .sidebar-brand { justify-content: center; padding: 20px 10px; }
body.sidebar-collapsed .sidebar-footer { justify-content: center; }
body.sidebar-collapsed .main-wrapper { margin-left: var(--sidebar-collapsed); }

/* ── Responsive ────────────────────────────────────────────── */
@media (max-width: 768px) {
  .sidebar { transform: translateX(-100%); }
  body.sidebar-open .sidebar { transform: translateX(0); }
  .main-wrapper { margin-left: 0 !important; }
  .page-content { padding: 16px; }
  .stat-cards { grid-template-columns: repeat(2, 1fr); }
  .filter-bar .form-control, .filter-bar .form-select { max-width: 100%; }
}

/* ── Misc ──────────────────────────────────────────────────── */
.text-accent { color: var(--accent) !important; }
.text-mono { font-family: var(--font-mono); }
.empty-state {
  text-align: center; padding: 48px 24px;
  color: var(--text-muted);
}
.empty-state i { font-size: 40px; margin-bottom: 12px; display: block; }
.empty-state p { margin: 0; font-size: 14px; }

/* ── sidebar JS-class collapse ──────────────────────────────── */
.sidebar.collapsed { width: var(--sidebar-collapsed) !important; }
.sidebar.collapsed .brand-text,
.sidebar.collapsed .nav-section-label,
.sidebar.collapsed .nav-item span,
.sidebar.collapsed .nav-badge,
.sidebar.collapsed .user-info,
.sidebar.collapsed .btn-logout { display: none !important; }
.sidebar.collapsed .nav-item { justify-content: center; padding: 10px; }
.sidebar.collapsed .sidebar-brand { justify-content: center; padding: 20px 10px; }
.sidebar.collapsed .sidebar-footer { justify-content: center; }
.main-wrapper.sidebar-collapsed { margin-left: var(--sidebar-collapsed) !important; }
.sidebar.mobile-open { transform: translateX(0) !important; }
.btn-xs { padding: 3px 8px; font-size: 12px; }
.caption-text-cell { max-width: 420px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
