/* ============================================================
   BrandEdge - Main Stylesheet
   Stack: Bootstrap 5.3 + custom vars
   ============================================================ */

/* ---- Variables ---- */
:root {
  --sidebar-w:      240px;
  --sidebar-bg:     #1a1d2e;
  --sidebar-text:   rgba(255,255,255,.78);
  --sidebar-hover:  rgba(255,255,255,.09);
  --sidebar-active: rgba(99,102,241,.28);
  --accent:         #6366f1;
  --accent-dark:    #4f46e5;
  --topbar-h:       52px;
  --radius:         10px;
  --shadow-sm:      0 1px 4px rgba(0,0,0,.08);
  --shadow-md:      0 4px 16px rgba(0,0,0,.12);
}

/* ---- Reset / base ---- */
* { box-sizing: border-box; }
body {
  font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
  background: #f4f5f9;
  color: #1e2030;
  margin: 0;
}

/* ---- Auth pages ---- */
.auth-wrapper {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #1a1d2e 0%, #2d2f4a 100%);
  padding: 20px;
}
.auth-box {
  background: #fff;
  border-radius: var(--radius);
  padding: 40px 36px 32px;
  width: 100%;
  max-width: 420px;
  box-shadow: 0 16px 40px rgba(0,0,0,.25);
}
.auth-logo {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--accent);
  margin-bottom: 24px;
}
.auth-logo i { font-size: 1.8rem; }
.auth-footer {
  margin-top: 18px;
  text-align: center;
  font-size: .875rem;
  color: #666;
}
.auth-footer a { color: var(--accent); text-decoration: none; font-weight: 500; }
.auth-hint { text-align: center; margin-top: 8px; }

/* ---- Sidebar ---- */
.wrapper { min-height: 100vh; }
.sidebar {
  width: var(--sidebar-w);
  min-height: 100vh;
  background: var(--sidebar-bg);
  flex-shrink: 0;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
  transition: width .25s ease;
}
.sidebar-brand { border-bottom: 1px solid rgba(255,255,255,.07); }
.brand-icon { color: var(--accent); font-size: 1.4rem; }
.brand-name { color: #fff; font-weight: 700; font-size: 1.15rem; letter-spacing: -.3px; }
.sidebar-user { background: rgba(255,255,255,.04); border-radius: 8px; }
.user-avatar { color: rgba(255,255,255,.5); }
.user-name  { color: #fff; font-size: .875rem; font-weight: 600; }
.user-badge { color: var(--accent); font-size: .7rem; text-transform: uppercase; letter-spacing: .5px; }

.sidebar-nav .nav-link {
  display: flex;
  align-items: center;
  padding: 8px 10px;
  border-radius: 7px;
  color: var(--sidebar-text);
  font-size: .875rem;
  text-decoration: none;
  margin-bottom: 2px;
  transition: background .15s, color .15s;
}
.sidebar-nav .nav-link:hover  { background: var(--sidebar-hover); color: #fff; }
.sidebar-nav .nav-link.active { background: var(--sidebar-active); color: #fff; font-weight: 600; }
.sidebar-nav .nav-section {
  padding: 14px 10px 4px;
  font-size: .68rem;
  text-transform: uppercase;
  letter-spacing: .8px;
  color: rgba(255,255,255,.35);
  font-weight: 600;
}

/* ---- Topbar ---- */
.topbar {
  height: var(--topbar-h);
  background: #fff;
  border-bottom: 1px solid #e8eaf0;
  box-shadow: var(--shadow-sm);
  position: sticky;
  top: 0;
  z-index: 10;
}
.main-content { min-width: 0; }
.content-area { max-width: 1200px; }

/* ---- Page title ---- */
.page-title h4 { font-weight: 700; margin-bottom: 2px; }
.section-title  { font-weight: 700; font-size: .95rem; text-transform: uppercase; letter-spacing: .4px; color: #555; }

/* ---- Cards ---- */
.card {
  border: 1px solid #e8eaf0;
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
}
.card-header {
  background: #f9fafc;
  border-bottom: 1px solid #e8eaf0;
  font-weight: 600;
  font-size: .875rem;
  padding: 12px 16px;
  border-radius: var(--radius) var(--radius) 0 0 !important;
}

/* ---- Stat cards ---- */
.stat-card {
  background: #fff;
  border: 1px solid #e8eaf0;
  border-radius: var(--radius);
  padding: 18px 16px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 8px;
  box-shadow: var(--shadow-sm);
}
.stat-icon {
  width: 40px; height: 40px;
  border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.1rem;
}
.stat-val   { font-size: 1.6rem; font-weight: 800; line-height: 1; }
.stat-label { font-size: .78rem; color: #777; font-weight: 500; }
.bg-primary-soft { background: rgba(99,102,241,.1); }
.bg-success-soft { background: rgba(34,197,94,.1); }
.bg-warning-soft { background: rgba(234,179,8,.1); }
.bg-info-soft    { background: rgba(6,182,212,.1); }

/* ---- Category cards ---- */
.category-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 20px 12px;
  background: #fff;
  border: 1px solid #e8eaf0;
  border-radius: var(--radius);
  text-align: center;
  color: #333;
  transition: transform .15s, box-shadow .15s, border-color .15s;
  box-shadow: var(--shadow-sm);
}
.category-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); border-color: var(--accent); color: var(--accent); }
.cat-icon { font-size: 1.8rem; color: var(--accent); }
.cat-name { font-weight: 600; font-size: .875rem; }
.cat-count { font-size: .75rem; color: #888; }

/* ---- Content image grid ---- */
.content-card {
  background: #fff;
  border: 1px solid #e8eaf0;
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  transition: box-shadow .15s;
}
.content-card:hover { box-shadow: var(--shadow-md); }
.content-thumb { position: relative; overflow: hidden; aspect-ratio: 1; background: #f0f0f0; }
.content-thumb img { width: 100%; height: 100%; object-fit: cover; transition: opacity .2s; }
.content-overlay {
  position: absolute; inset: 0;
  background: rgba(99,102,241,.7);
  display: flex; align-items: center; justify-content: center;
  opacity: 0; transition: opacity .2s;
}
.content-card:hover .content-overlay { opacity: 1; }
.content-card:hover .content-thumb img { opacity: .7; }
.content-info { padding: 8px 10px; }
.content-title { font-size: .78rem; font-weight: 500; color: #555; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-bottom: 4px; }

/* ---- Branding page / Frame selector ---- */
.frames-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.frame-option {
  border: 2px solid #e0e0e0;
  border-radius: 8px;
  padding: 8px;
  cursor: pointer;
  transition: border-color .15s, transform .1s;
  text-align: center;
}
.frame-option:hover   { border-color: var(--accent); }
.frame-option.selected { border-color: var(--accent); background: rgba(99,102,241,.06); }
.frame-preview-box { margin-bottom: 6px; }
.mini-frame {
  width: 100%; height: 28px;
  border-radius: 4px;
  overflow: hidden;
  position: relative;
  display: flex; flex-direction: column;
}
.mini-name-bar { height: 9px; opacity: .8; }
.mini-content  { flex: 1; background: rgba(255,255,255,.15); }
.frame-label   { font-size: .7rem; color: #555; font-weight: 500; line-height: 1.2; }

/* ---- Preview ---- */
.preview-container { position: relative; }
.preview-base { border-radius: 8px; max-height: 420px; width: 100%; object-fit: contain; }
.preview-overlay { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; }
.preview-overlay img { max-height: 420px; width: 100%; object-fit: contain; border-radius: 8px; }
.preview-loader { padding: 40px; }

/* ---- Profile summary strip ---- */
.profile-summary { display: flex; align-items: center; gap: 12px; }
.profile-mini-logo { width: 48px; height: 48px; object-fit: contain; border-radius: 6px; border: 1px solid #e0e0e0; }
.profile-mini-info { flex: 1; font-size: .85rem; }

/* ---- Profile upload previews ---- */
.profile-logo-preview, .profile-photo-preview {
  width: 100px; height: 100px; object-fit: contain;
  border: 1px solid #ddd; border-radius: 8px; display: block; margin: 0 auto;
}
.logo-placeholder, .photo-placeholder {
  width: 100px; height: 100px;
  background: #f0f0f0; border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  font-size: 2.5rem; color: #bbb; margin: 0 auto;
}

/* ---- Admin action cards ---- */
.admin-action-card {
  display: flex; flex-direction: column; align-items: center; gap: 6px;
  padding: 24px 16px; background: #fff; border: 1px solid #e8eaf0;
  border-radius: var(--radius); text-align: center; color: #333;
  text-decoration: none; transition: transform .15s, box-shadow .15s;
  box-shadow: var(--shadow-sm);
}
.admin-action-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); color: var(--accent); }
.admin-action-card i     { color: var(--accent); }
.admin-action-card strong { font-size: .9rem; }
.admin-action-card small  { font-size: .75rem; color: #888; }

/* ---- Admin thumbs ---- */
.admin-thumb-card { border: 1px solid #e0e0e0; border-radius: 8px; padding: 6px; background: #fff; }
.admin-thumb-card img { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 5px; }
.admin-thumb-title { font-size: .7rem; color: #666; margin-top: 4px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ---- Empty state ---- */
.empty-state {
  text-align: center; padding: 60px 20px;
  color: #888;
}
.empty-state i  { font-size: 3rem; margin-bottom: 12px; display: block; opacity: .4; }
.empty-state h5 { font-weight: 700; color: #444; }

/* ---- Thumb card (dashboard recent) ---- */
.thumb-card { }
.thumb-card img { border-radius: 6px; aspect-ratio: 1; object-fit: cover; width: 100%; }

/* ---- Utility ---- */
.btn-xs { font-size: .72rem; padding: 2px 8px; border-radius: 5px; }
.font-monospace { font-family: 'Consolas', 'Courier New', monospace; font-size: .75rem; }

/* ---- Responsive ---- */
@media (max-width: 767px) {
  .sidebar   { width: 0; overflow: hidden; position: fixed; z-index: 100; }
  .sidebar.open { width: var(--sidebar-w); }
  .frames-grid { grid-template-columns: 1fr; }
}
