/* ==========================================================================
   Chandrani Sinha Portfolio - CMS Dashboard Stylesheet
   Modern, Sleek, Professional Admin Interface
   ========================================================================== */

:root {
  --admin-navy: #081325;
  --admin-sidebar: #050d18;
  --admin-card-bg: #ffffff;
  --admin-body-bg: #f3f6fb;
  --primary-blue: #0c549c;
  --primary-blue-hover: #083c70;
  --accent-cyan: #06b6d4;
  --accent-cyan-light: #ecfeff;
  --success-green: #10b981;
  --danger-red: #ef4444;
  --warning-amber: #f59e0b;
  --text-dark: #0f172a;
  --text-muted: #64748b;
  --text-light: #94a3b8;
  --border-color: #e2e8f0;
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 14px;
  --shadow-subtle: 0 1px 3px rgba(0, 0, 0, 0.05), 0 1px 2px rgba(0, 0, 0, 0.1);
  --shadow-card: 0 4px 12px rgba(0, 0, 0, 0.05);
  --shadow-modal: 0 20px 40px rgba(0, 0, 0, 0.2);
  --font-main: 'Plus Jakarta Sans', system-ui, -apple-system, sans-serif;
}

*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: var(--font-main);
  background-color: var(--admin-body-bg);
  color: var(--text-dark);
  line-height: 1.5;
  min-height: 100vh;
  display: flex;
}

/* Layout */
.dashboard-layout {
  display: flex;
  width: 100%;
  min-height: 100vh;
}

/* Sidebar */
.dashboard-sidebar {
  width: 270px;
  background-color: var(--admin-sidebar);
  color: #ffffff;
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0;
  bottom: 0;
  left: 0;
  z-index: 100;
  border-right: 1px solid rgba(255, 255, 255, 0.08);
  transition: transform 0.3s ease;
}

.sidebar-header {
  padding: 24px 20px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  align-items: center;
  gap: 12px;
}

.sidebar-logo {
  height: 32px;
  width: auto;
}

.sidebar-title-box {
  display: flex;
  flex-direction: column;
}

.sidebar-brand-name {
  font-size: 1rem;
  font-weight: 700;
  color: #ffffff;
}

.sidebar-badge {
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--accent-cyan);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.sidebar-menu {
  flex: 1;
  padding: 20px 12px;
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 6px;
  overflow-y: auto;
}

.sidebar-menu-btn {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 16px;
  background: transparent;
  border: none;
  color: #94a3b8;
  font-size: 0.92rem;
  font-weight: 600;
  border-radius: var(--radius-sm);
  cursor: pointer;
  text-align: left;
  transition: all 0.2s ease;
}

.sidebar-menu-btn:hover {
  background: rgba(255, 255, 255, 0.06);
  color: #ffffff;
}

.sidebar-menu-btn.active {
  background: var(--primary-blue);
  color: #ffffff;
  box-shadow: 0 4px 12px rgba(12, 84, 156, 0.35);
}

.sidebar-menu-btn svg {
  width: 18px;
  height: 18px;
  stroke: currentColor;
  stroke-width: 2;
  fill: none;
}

.sidebar-footer {
  padding: 16px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.sidebar-live-link {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px;
  background: rgba(34, 211, 238, 0.12);
  border: 1px solid rgba(34, 211, 238, 0.3);
  color: var(--accent-cyan);
  border-radius: var(--radius-sm);
  font-size: 0.88rem;
  font-weight: 600;
  text-decoration: none;
  transition: all 0.2s ease;
}

.sidebar-live-link:hover {
  background: var(--accent-cyan);
  color: var(--admin-sidebar);
}

/* Main Content Area */
.dashboard-main {
  margin-left: 270px;
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* Topbar */
.dashboard-topbar {
  background: #ffffff;
  border-bottom: 1px solid var(--border-color);
  padding: 16px 32px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 90;
}

.topbar-left {
  display: flex;
  align-items: center;
  gap: 16px;
}

.topbar-page-title {
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--text-dark);
}

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

.sync-status-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.8rem;
  font-weight: 600;
  background: #ecfdf5;
  color: #065f46;
  border: 1px solid #a7f3d0;
  padding: 4px 12px;
  border-radius: 9999px;
}

.sync-status-pill .dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #10b981;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 8px 16px;
  border-radius: var(--radius-sm);
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
  border: none;
  transition: all 0.2s ease;
  text-decoration: none;
}

.btn-primary {
  background: var(--primary-blue);
  color: #ffffff;
}

.btn-primary:hover {
  background: var(--primary-blue-hover);
  box-shadow: 0 4px 12px rgba(12, 84, 156, 0.25);
}

.btn-outline {
  background: #ffffff;
  border: 1px solid var(--border-color);
  color: var(--text-dark);
}

.btn-outline:hover {
  background: #f8fafc;
  border-color: #cbd5e1;
}

.btn-danger {
  background: #fef2f2;
  color: var(--danger-red);
  border: 1px solid #fecaca;
}

.btn-danger:hover {
  background: var(--danger-red);
  color: #ffffff;
}

.btn-sm {
  padding: 5px 10px;
  font-size: 0.8rem;
}

/* Dashboard Body & Sections */
.dashboard-content {
  padding: 32px;
  flex: 1;
}

.tab-pane {
  display: none;
}

.tab-pane.active {
  display: block;
  animation: fadeIn 0.25s ease-out;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Overview Stat Cards */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
  margin-bottom: 32px;
}

.stat-card {
  background: #ffffff;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 22px;
  display: flex;
  align-items: center;
  gap: 18px;
  box-shadow: var(--shadow-subtle);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.stat-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-card);
}

.stat-icon {
  width: 52px;
  height: 52px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
}

.stat-icon.blue { background: #e0f2fe; color: #0284c7; }
.stat-icon.cyan { background: #cffafe; color: #0891b2; }
.stat-icon.green { background: #dcfce7; color: #16a34a; }
.stat-icon.purple { background: #f3e8ff; color: #9333ea; }

.stat-info {
  display: flex;
  flex-direction: column;
}

.stat-label {
  font-size: 0.82rem;
  color: var(--text-muted);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.stat-value {
  font-size: 1.85rem;
  font-weight: 800;
  color: var(--text-dark);
  line-height: 1.1;
  margin-top: 4px;
}

/* Section Action Bars */
.section-action-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
  gap: 16px;
  flex-wrap: wrap;
}

.search-input-box {
  display: flex;
  align-items: center;
  background: #ffffff;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 6px 14px;
  width: 320px;
}

.search-input-box input {
  border: none;
  outline: none;
  background: transparent;
  width: 100%;
  font-size: 0.88rem;
  color: var(--text-dark);
}

/* Card Grids for Content Management */
.content-table-card {
  background: #ffffff;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-subtle);
  overflow: hidden;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
}

.data-table th {
  background: #f8fafc;
  padding: 12px 18px;
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  border-bottom: 1px solid var(--border-color);
}

.data-table td {
  padding: 14px 18px;
  border-bottom: 1px solid var(--border-color);
  font-size: 0.9rem;
  vertical-align: middle;
}

.data-table tr:last-child td {
  border-bottom: none;
}

.data-table tr:hover td {
  background: #f8fafc;
}

.table-tag {
  display: inline-block;
  padding: 3px 8px;
  border-radius: 4px;
  font-size: 0.75rem;
  font-weight: 600;
  background: #e2e8f0;
  color: #334155;
}

.table-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

/* Video Manager Grid */
.videos-admin-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}

.video-admin-card {
  background: #ffffff;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: var(--shadow-subtle);
  display: flex;
  flex-direction: column;
}

.video-admin-thumb {
  position: relative;
  aspect-ratio: 16 / 9;
  background: #000;
}

.video-admin-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.video-admin-duration {
  position: absolute;
  bottom: 8px;
  right: 8px;
  background: rgba(0, 0, 0, 0.75);
  color: #fff;
  font-size: 0.75rem;
  padding: 2px 6px;
  border-radius: 4px;
  font-weight: 600;
}

.video-admin-info {
  padding: 16px;
  flex: 1;
  display: flex;
  flex-direction: column;
}

.video-admin-title {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text-dark);
  margin-bottom: 6px;
  line-height: 1.4;
}

.video-admin-desc {
  font-size: 0.82rem;
  color: var(--text-muted);
  line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  margin-bottom: 14px;
}

.video-admin-actions {
  margin-top: auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-top: 1px solid var(--border-color);
  padding-top: 12px;
}

/* Gallery Manager Grid */
.gallery-admin-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 18px;
}

.gallery-admin-card {
  background: #ffffff;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: var(--shadow-subtle);
  display: flex;
  flex-direction: column;
}

.gallery-admin-thumb {
  aspect-ratio: 4 / 3;
  overflow: hidden;
  background: #0f172a;
}

.gallery-admin-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.gallery-admin-info {
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.gallery-admin-title {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--text-dark);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.gallery-admin-cat {
  font-size: 0.74rem;
  color: var(--primary-blue);
  font-weight: 600;
}

.gallery-admin-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
  padding: 10px 12px;
  border-top: 1px solid var(--border-color);
  background: #fafafa;
}

/* Forms & Modals */
.admin-modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(8, 19, 37, 0.7);
  backdrop-filter: blur(4px);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
  padding: 20px;
}

.admin-modal-overlay.active {
  opacity: 1;
  pointer-events: auto;
}

.admin-modal-card {
  background: #ffffff;
  border-radius: var(--radius-lg);
  max-width: 600px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: var(--shadow-modal);
  transform: translateY(20px);
  transition: transform 0.25s ease;
  display: flex;
  flex-direction: column;
}

.admin-modal-overlay.active .admin-modal-card {
  transform: translateY(0);
}

.admin-modal-header {
  padding: 20px 24px;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.admin-modal-title {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text-dark);
}

.admin-modal-close {
  background: none;
  border: none;
  font-size: 1.4rem;
  color: var(--text-muted);
  cursor: pointer;
}

.admin-modal-body {
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.form-group label {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-dark);
}

.form-control {
  width: 100%;
  padding: 9px 12px;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  color: var(--text-dark);
  outline: none;
  background: #ffffff;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.form-control:focus {
  border-color: var(--primary-blue);
  box-shadow: 0 0 0 3px rgba(12, 84, 156, 0.15);
}

textarea.form-control {
  resize: vertical;
  min-height: 90px;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

.file-dropzone {
  border: 2px dashed #cbd5e1;
  border-radius: var(--radius-sm);
  padding: 24px;
  text-align: center;
  background: #f8fafc;
  cursor: pointer;
  transition: all 0.2s ease;
}

.file-dropzone:hover, .file-dropzone.dragover {
  border-color: var(--primary-blue);
  background: #f0f7ff;
}

.dropzone-preview {
  max-height: 120px;
  margin: 10px auto 0;
  border-radius: 4px;
  display: none;
}

.admin-modal-footer {
  padding: 16px 24px;
  border-top: 1px solid var(--border-color);
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  background: #f8fafc;
}

/* Settings Card */
.settings-section-card {
  background: #ffffff;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 28px;
  box-shadow: var(--shadow-subtle);
  margin-bottom: 24px;
}

.settings-card-header {
  margin-bottom: 20px;
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 12px;
}

.settings-card-title {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text-dark);
}

.settings-card-subtitle {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-top: 2px;
}

/* Responsive */
@media (max-width: 1024px) {
  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .videos-admin-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .gallery-admin-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (max-width: 768px) {
  .dashboard-sidebar {
    transform: translateX(-100%);
  }
  .dashboard-sidebar.mobile-open {
    transform: translateX(0);
  }
  .dashboard-main {
    margin-left: 0;
  }
  .stats-grid, .videos-admin-grid, .gallery-admin-grid {
    grid-template-columns: 1fr;
  }
  .dashboard-content {
    padding: 16px;
  }
  .topbar-right {
    gap: 8px;
  }
  .logo-managers-grid {
    grid-template-columns: 1fr !important;
  }
}

/* Website Branding & Logo Preview */
.logo-preview-card {
  background: #040c1a;
  border-radius: var(--radius-sm);
  padding: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 80px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: inset 0 2px 8px rgba(0, 0, 0, 0.35);
}

.logo-preview-card.footer-theme {
  background: #020610;
}

.logo-preview-card img {
  max-height: 48px;
  max-width: 200px;
  object-fit: contain;
}

/* User Role Badges */
.status-badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  border-radius: 9999px;
  font-size: 0.74rem;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.status-badge.badge-published {
  background: #dbeafe;
  color: #1e40af;
}

.status-badge.badge-draft {
  background: #f1f5f9;
  color: #475569;
}
