/* ============================================================
   Cliqvolt Publish - Custom Stylesheet
   ============================================================ */

:root {
  --cv-gradient: linear-gradient(135deg, #5e2ad0, #851c91, #c21575, #da126a);
  --cv-primary:  #5e2ad0;
  --cv-secondary:#851c91;
  --cv-accent:   #da126a;
  --cv-mid:      #c21575;
  --sidebar-w:   260px;
  --sidebar-collapsed: 72px;
  --topbar-h:    60px;
}

/* ── General ──────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }

body {
  font-family: 'Inter', 'Segoe UI', system-ui, sans-serif;
  background: #f1f3f9;
  color: #2c2c3e;
  min-height: 100vh;
  overflow-x: hidden;
}

a { text-decoration: none; }
img { max-width: 100%; }

/* ── Scrollbar ────────────────────────────────────────────── */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: #f1f3f9; }
::-webkit-scrollbar-thumb { background: #c0c3d0; border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: #9396a8; }

/* ── Gradient Utilities ───────────────────────────────────── */
.bg-gradient-cv  { background: var(--cv-gradient) !important; }
.text-gradient-cv {
  background: var(--cv-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.border-gradient-cv {
  border: 2px solid transparent;
  background-clip: padding-box;
  position: relative;
}

/* ── Sidebar ──────────────────────────────────────────────── */
.sidebar {
  position: fixed;
  top: 0; left: 0;
  height: 100vh;
  width: var(--sidebar-w);
  background: var(--cv-gradient);
  display: flex;
  flex-direction: column;
  z-index: 1040;
  transition: width .25s ease, transform .25s ease;
  overflow: hidden;
  box-shadow: 4px 0 20px rgba(94,42,208,.25);
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 20px 18px;
  border-bottom: 1px solid rgba(255,255,255,.15);
  min-height: var(--topbar-h);
  flex-shrink: 0;
}

.sidebar-brand-logo {
  width: 36px; height: 36px;
  border-radius: 10px;
  background: rgba(255,255,255,.25);
  display: flex; align-items: center; justify-content: center;
  font-size: 18px; font-weight: 800; color: #fff;
  flex-shrink: 0;
}

.sidebar-brand-name {
  color: #fff;
  font-size: 16px;
  font-weight: 700;
  letter-spacing: -.3px;
  white-space: nowrap;
}

.sidebar-brand-sub {
  color: rgba(255,255,255,.65);
  font-size: 10px;
  line-height: 1;
  margin-top: 2px;
}

.sidebar-nav {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 12px 0;
}

.sidebar-section-label {
  color: rgba(255,255,255,.5);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 1.2px;
  text-transform: uppercase;
  padding: 16px 20px 6px;
  white-space: nowrap;
}

.sidebar-nav .nav-link {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 20px;
  color: rgba(255,255,255,.8);
  font-size: 13.5px;
  font-weight: 500;
  border-radius: 0;
  transition: all .2s;
  white-space: nowrap;
  position: relative;
}

.sidebar-nav .nav-link i {
  font-size: 16px;
  width: 20px;
  text-align: center;
  flex-shrink: 0;
}

.sidebar-nav .nav-link:hover {
  color: #fff;
  background: rgba(255,255,255,.12);
}

.sidebar-nav .nav-link.active {
  color: #fff;
  background: rgba(255,255,255,.2);
  font-weight: 600;
}

.sidebar-nav .nav-link.active::before {
  content: '';
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 3px;
  background: #fff;
  border-radius: 0 3px 3px 0;
}

.sidebar-footer {
  padding: 16px;
  border-top: 1px solid rgba(255,255,255,.15);
  flex-shrink: 0;
}

.sidebar-user {
  display: flex;
  align-items: center;
  gap: 10px;
  color: rgba(255,255,255,.85);
  font-size: 13px;
}

.sidebar-user-avatar {
  width: 34px; height: 34px;
  border-radius: 50%;
  background: rgba(255,255,255,.25);
  display: flex; align-items: center; justify-content: center;
  font-size: 14px; font-weight: 700; color: #fff;
  flex-shrink: 0;
}

/* ── Top Navbar ───────────────────────────────────────────── */
.topbar {
  position: fixed;
  top: 0;
  left: var(--sidebar-w);
  right: 0;
  height: var(--topbar-h);
  background: #fff;
  border-bottom: 1px solid #e8eaf0;
  display: flex;
  align-items: center;
  padding: 0 24px;
  z-index: 1030;
  gap: 16px;
  box-shadow: 0 1px 8px rgba(0,0,0,.06);
  transition: left .25s ease;
}

.topbar-title {
  font-size: 17px;
  font-weight: 700;
  color: #2c2c3e;
  flex: 1;
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

/* ── Main Content ─────────────────────────────────────────── */
.main-content {
  margin-left: var(--sidebar-w);
  margin-top: var(--topbar-h);
  padding: 28px;
  min-height: calc(100vh - var(--topbar-h));
  transition: margin-left .25s ease;
}

/* ── Cards ────────────────────────────────────────────────── */
.card {
  border: none;
  border-radius: 14px;
  box-shadow: 0 2px 12px rgba(0,0,0,.07);
  background: #fff;
}

.card-header {
  background: transparent;
  border-bottom: 1px solid #f0f1f7;
  padding: 16px 20px;
  font-weight: 600;
  font-size: 15px;
}

.card-body { padding: 20px; }

/* ── Stat Cards ───────────────────────────────────────────── */
.stat-card {
  border-radius: 16px;
  padding: 20px 22px;
  color: #fff;
  background: var(--cv-gradient);
  display: flex;
  align-items: center;
  gap: 16px;
  box-shadow: 0 6px 24px rgba(94,42,208,.3);
  transition: transform .2s, box-shadow .2s;
}
.stat-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 10px 30px rgba(94,42,208,.35);
}
.stat-card-icon {
  width: 52px; height: 52px;
  border-radius: 14px;
  background: rgba(255,255,255,.2);
  display: flex; align-items: center; justify-content: center;
  font-size: 24px;
  flex-shrink: 0;
}
.stat-card-label {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: .5px;
  text-transform: uppercase;
  opacity: .8;
}
.stat-card-value {
  font-size: 30px;
  font-weight: 800;
  line-height: 1;
}

.stat-card-alt {
  background: #fff;
  color: #2c2c3e;
  box-shadow: 0 2px 12px rgba(0,0,0,.07);
}
.stat-card-alt .stat-card-icon {
  background: var(--cv-gradient);
  color: #fff;
}
.stat-card-alt:hover { box-shadow: 0 6px 20px rgba(0,0,0,.12); }

/* ── Buttons ──────────────────────────────────────────────── */
.btn-cv {
  background: var(--cv-gradient);
  color: #fff;
  border: none;
  border-radius: 8px;
  padding: 8px 20px;
  font-weight: 600;
  font-size: 13.5px;
  transition: opacity .2s, transform .15s, box-shadow .2s;
  box-shadow: 0 3px 12px rgba(94,42,208,.3);
}
.btn-cv:hover  { color: #fff; opacity: .9; transform: translateY(-1px); box-shadow: 0 6px 18px rgba(94,42,208,.35); }
.btn-cv:active { transform: translateY(0); }
.btn-cv:disabled { opacity: .6; cursor: not-allowed; }

.btn-cv-outline {
  background: transparent;
  color: var(--cv-primary);
  border: 2px solid var(--cv-primary);
  border-radius: 8px;
  padding: 6px 18px;
  font-weight: 600;
  font-size: 13.5px;
  transition: all .2s;
}
.btn-cv-outline:hover {
  background: var(--cv-gradient);
  border-color: transparent;
  color: #fff;
}

/* ── Tables ───────────────────────────────────────────────── */
.table thead th {
  background: #f7f8fc;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .7px;
  text-transform: uppercase;
  color: #6b7280;
  border-bottom: 2px solid #eaecf4;
  padding: 12px 16px;
}
.table tbody td {
  padding: 13px 16px;
  vertical-align: middle;
  font-size: 13.5px;
  border-bottom: 1px solid #f4f5f9;
}
.table tbody tr:last-child td { border-bottom: none; }
.table-hover tbody tr:hover { background: #fafbff; }

/* ── Badges ───────────────────────────────────────────────── */
.badge { font-weight: 600; font-size: 11px; padding: 4px 9px; border-radius: 6px; }

/* ── Forms ────────────────────────────────────────────────── */
.form-control, .form-select {
  border-radius: 8px;
  border: 1.5px solid #e2e5f0;
  font-size: 13.5px;
  padding: 9px 14px;
  transition: border-color .2s, box-shadow .2s;
}
.form-control:focus, .form-select:focus {
  border-color: var(--cv-primary);
  box-shadow: 0 0 0 3px rgba(94,42,208,.12);
}
.form-label { font-size: 13px; font-weight: 600; color: #4b5563; margin-bottom: 6px; }

.input-group-text {
  border-radius: 8px;
  border: 1.5px solid #e2e5f0;
  background: #f7f8fc;
  font-size: 13.5px;
}

/* ── Platform Connect Cards ───────────────────────────────── */
.platform-card {
  border-radius: 16px;
  border: 2px solid #eaecf4;
  padding: 24px;
  text-align: center;
  transition: all .25s;
  cursor: pointer;
  position: relative;
  overflow: hidden;
}
.platform-card:hover {
  border-color: var(--cv-primary);
  box-shadow: 0 8px 28px rgba(94,42,208,.15);
  transform: translateY(-2px);
}
.platform-card.connected { border-color: #10b981; }
.platform-card-icon {
  width: 60px; height: 60px;
  border-radius: 16px;
  display: flex; align-items: center; justify-content: center;
  font-size: 28px; color: #fff;
  margin: 0 auto 14px;
}
.platform-card-name { font-weight: 700; font-size: 15px; margin-bottom: 4px; }
.platform-card-status { font-size: 12px; color: #6b7280; }
.platform-card .connected-badge {
  position: absolute;
  top: 12px; right: 12px;
  background: #10b981;
  color: #fff;
  border-radius: 20px;
  font-size: 10px;
  font-weight: 700;
  padding: 3px 8px;
}

/* ── Page Header ──────────────────────────────────────────── */
.page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
  flex-wrap: wrap;
  gap: 12px;
}
.page-header-title { font-size: 22px; font-weight: 800; color: #1a1a2e; }
.page-header-sub   { font-size: 13px; color: #6b7280; margin-top: 2px; }

/* ── Section Divider ──────────────────────────────────────── */
.section-divider {
  display: flex; align-items: center; gap: 12px;
  margin: 24px 0 18px;
  color: #9ca3af; font-size: 12px; font-weight: 600;
  text-transform: uppercase; letter-spacing: .8px;
}
.section-divider::before, .section-divider::after {
  content: ''; flex: 1; height: 1px; background: #e5e7eb;
}

/* ── Media Preview ────────────────────────────────────────── */
.media-preview {
  border-radius: 10px;
  overflow: hidden;
  border: 2px dashed #e2e5f0;
  min-height: 120px;
  display: flex; align-items: center; justify-content: center;
  background: #f7f8fc;
  position: relative;
}
.media-preview img, .media-preview video {
  max-height: 280px;
  width: 100%;
  object-fit: contain;
}
.media-preview-placeholder {
  text-align: center; color: #9ca3af;
}

/* ── Upload Zone ──────────────────────────────────────────── */
.upload-zone {
  border: 2px dashed #c4c9e0;
  border-radius: 12px;
  padding: 30px;
  text-align: center;
  cursor: pointer;
  transition: all .2s;
  background: #fafbff;
}
.upload-zone:hover, .upload-zone.dragover {
  border-color: var(--cv-primary);
  background: rgba(94,42,208,.04);
}
.upload-zone i { font-size: 36px; color: #b0b5cc; margin-bottom: 10px; }
.upload-zone p { font-size: 13px; color: #6b7280; margin: 0; }

/* ── Checkbox Platform Selector ───────────────────────────── */
.platform-check-label {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 16px;
  border: 2px solid #e2e5f0;
  border-radius: 10px;
  cursor: pointer;
  transition: all .2s;
  font-size: 13.5px;
  font-weight: 500;
}
.platform-check-label:hover { border-color: var(--cv-primary); }
input[type=checkbox]:checked + .platform-check-label {
  border-color: var(--cv-primary);
  background: rgba(94,42,208,.06);
  color: var(--cv-primary);
}
.platform-check { display: none; }

/* ── Loading Overlay ──────────────────────────────────────── */
.loading-overlay {
  position: fixed; inset: 0;
  background: rgba(255,255,255,.7);
  z-index: 9999;
  display: flex; align-items: center; justify-content: center;
  backdrop-filter: blur(2px);
}
.loading-spinner {
  width: 48px; height: 48px;
  border-radius: 50%;
  border: 4px solid #eaecf4;
  border-top-color: var(--cv-primary);
  animation: spin .7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ── Toast Notifications ──────────────────────────────────── */
.cv-toast-container {
  position: fixed;
  top: 80px; right: 20px;
  z-index: 9990;
  width: 340px;
  display: flex; flex-direction: column; gap: 8px;
}
.cv-toast {
  border-radius: 10px;
  padding: 14px 18px;
  color: #fff;
  font-size: 13.5px;
  font-weight: 500;
  display: flex; align-items: flex-start; gap: 10px;
  box-shadow: 0 6px 24px rgba(0,0,0,.15);
  animation: toastIn .3s ease forwards;
}
.cv-toast.success { background: #10b981; }
.cv-toast.error   { background: #ef4444; }
.cv-toast.warning { background: #f59e0b; }
.cv-toast.info    { background: var(--cv-primary); }
@keyframes toastIn { from { opacity:0; transform:translateX(50px); } to { opacity:1; transform:translateX(0); } }

/* ── Code Blocks ──────────────────────────────────────────── */
.code-block {
  background: #1e1e2e;
  color: #cdd6f4;
  border-radius: 10px;
  padding: 16px 20px;
  font-family: 'JetBrains Mono', 'Fira Code', 'Consolas', monospace;
  font-size: 13px;
  position: relative;
  overflow-x: auto;
}
.code-block .copy-btn {
  position: absolute;
  top: 10px; right: 10px;
  background: rgba(255,255,255,.1);
  color: #cdd6f4;
  border: none;
  border-radius: 6px;
  padding: 4px 10px;
  font-size: 11px;
  cursor: pointer;
  transition: background .2s;
}
.code-block .copy-btn:hover { background: rgba(255,255,255,.2); }

/* ── Guide Steps ──────────────────────────────────────────── */
.guide-step {
  display: flex;
  gap: 16px;
  padding: 20px 0;
  border-bottom: 1px solid #f0f1f7;
}
.guide-step:last-child { border-bottom: none; }
.guide-step-num {
  width: 36px; height: 36px;
  border-radius: 50%;
  background: var(--cv-gradient);
  color: #fff;
  font-weight: 800; font-size: 15px;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.guide-step-content h6 { font-weight: 700; font-size: 14px; margin-bottom: 4px; }
.guide-step-content p  { font-size: 13px; color: #6b7280; margin: 0; }

/* ── Login Page ───────────────────────────────────────────── */
.login-page {
  min-height: 100vh;
  background: var(--cv-gradient);
  display: flex; align-items: center; justify-content: center;
  padding: 20px;
}
.login-card {
  background: #fff;
  border-radius: 20px;
  width: 100%;
  max-width: 440px;
  padding: 40px;
  box-shadow: 0 20px 60px rgba(0,0,0,.25);
}
.login-logo {
  width: 56px; height: 56px;
  border-radius: 16px;
  background: var(--cv-gradient);
  display: flex; align-items: center; justify-content: center;
  font-size: 26px; font-weight: 900; color: #fff;
  margin: 0 auto 20px;
}

/* ── Responsive ───────────────────────────────────────────── */
@media (max-width: 992px) {
  .sidebar {
    transform: translateX(-100%);
  }
  .sidebar.open {
    transform: translateX(0);
  }
  .topbar {
    left: 0;
  }
  .main-content {
    margin-left: 0;
    padding: 18px;
  }
}

@media (max-width: 576px) {
  .stat-card { padding: 16px; }
  .stat-card-value { font-size: 24px; }
  .main-content { padding: 14px; }
}

/* ── Utilities ────────────────────────────────────────────── */
.rounded-xl { border-radius: 14px !important; }
.rounded-2xl { border-radius: 20px !important; }
.shadow-cv { box-shadow: 0 6px 24px rgba(94,42,208,.2) !important; }
.text-muted-sm { font-size: 12px; color: #9ca3af; }
.fw-700 { font-weight: 700 !important; }
.fw-800 { font-weight: 800 !important; }

.gap-2 { gap: 8px !important; }
.gap-3 { gap: 12px !important; }

.avatar-sm {
  width: 32px; height: 32px;
  border-radius: 8px;
  object-fit: cover;
}
.avatar-md {
  width: 44px; height: 44px;
  border-radius: 12px;
  object-fit: cover;
}

.brand-logo-preview {
  width: 50px; height: 50px;
  border-radius: 12px;
  object-fit: cover;
  border: 2px solid #e2e5f0;
}

.action-btn {
  width: 32px; height: 32px;
  border-radius: 8px;
  border: none;
  display: inline-flex; align-items: center; justify-content: center;
  cursor: pointer;
  transition: all .2s;
  font-size: 14px;
}
.action-btn:hover { opacity: .85; transform: translateY(-1px); }
