/* ============================================================
   INCLUSIVE IMPACT FOUNDATION — Admin Panel Styles
   admin.css · v1.0
   ============================================================ */

/* ─── 1. Admin Base & Layout ─────────────────────────────── */
:root {
  --admin-sidebar-width: 260px;
  --admin-topbar-height: 64px;
}

body.admin-body {
  background-color: #f8f9fa;
  font-family: 'Public Sans', sans-serif;
  color: #333;
  margin: 0;
  display: flex;
  min-height: 100vh;
}

/* ─── 2. Sidebar ─────────────────────────────────────────── */
.admin-sidebar {
  width: var(--admin-sidebar-width);
  background: var(--ink, #0F2B33);
  color: #fff;
  position: fixed;
  top: 0;
  left: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  z-index: 1040;
  transition: transform 0.3s ease;
}

.sidebar-header {
  height: var(--admin-topbar-height);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 20px;
  border-bottom: 1px solid rgba(255,255,255,0.1);
}

.sidebar-logo img {
  filter: brightness(0) invert(1);
}

.sidebar-close {
  display: none;
  background: none;
  border: none;
  color: #fff;
  font-size: 24px;
  cursor: pointer;
}

.sidebar-nav {
  flex: 1;
  overflow-y: auto;
  padding: 20px 0;
}
/* Scrollbar styling for sidebar */
.sidebar-nav::-webkit-scrollbar { width: 6px; }
.sidebar-nav::-webkit-scrollbar-track { background: transparent; }
.sidebar-nav::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.2); border-radius: 3px; }

.sidebar-menu {
  list-style: none;
  padding: 0;
  margin: 0;
}
.sidebar-menu li {
  margin-bottom: 4px;
}

.sidebar-link {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 20px;
  color: rgba(255,255,255,0.7);
  text-decoration: none;
  font-size: 14.5px;
  font-weight: 500;
  transition: all 0.2s ease;
  position: relative;
}
.sidebar-link svg {
  opacity: 0.7;
}
.sidebar-link:hover, .sidebar-link.active {
  color: #fff;
  background: rgba(255,255,255,0.08);
}
.sidebar-link:hover svg, .sidebar-link.active svg {
  opacity: 1;
}
.sidebar-link.active::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 3px;
  background: var(--gold, #C98A2C);
}

.sidebar-divider {
  height: 1px;
  background: rgba(255,255,255,0.1);
  margin: 16px 20px;
}

.sidebar-badge {
  margin-left: auto;
  background: var(--gold, #C98A2C);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 12px;
  line-height: 1;
}

.sidebar-footer {
  padding: 16px 20px;
  border-top: 1px solid rgba(255,255,255,0.1);
}
.sidebar-visit {
  justify-content: center;
  background: rgba(255,255,255,0.1);
  border-radius: 6px;
}


/* ─── 3. Main Area & Topbar ──────────────────────────────── */
.admin-main {
  flex: 1;
  margin-left: var(--admin-sidebar-width);
  display: flex;
  flex-direction: column;
  min-width: 0; /* Important for flex child truncation */
  transition: margin-left 0.3s ease;
}

.admin-topbar {
  height: var(--admin-topbar-height);
  background: #fff;
  border-bottom: 1px solid #dee2e6;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  position: sticky;
  top: 0;
  z-index: 1030;
}

.admin-hamburger {
  display: none;
  background: none;
  border: none;
  color: #333;
  padding: 8px;
  margin-left: -8px;
  cursor: pointer;
}

.admin-page-title {
  font-size: 20px;
  font-weight: 600;
  margin: 0;
  color: #212529;
}

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

.admin-user-name {
  font-size: 14px;
  font-weight: 500;
  color: #495057;
}

.admin-logout-btn {
  color: #6c757d;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  transition: all 0.2s ease;
}
.admin-logout-btn:hover {
  background: #f8f9fa;
  color: #dc3545;
}

.admin-content {
  padding: 24px;
  flex: 1;
}


/* ─── 4. Admin Components ────────────────────────────────── */
.admin-card {
  background: #fff;
  border: 1px solid #dee2e6;
  border-radius: 8px;
  padding: 24px;
  margin-bottom: 24px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.02);
}

.admin-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
  padding-bottom: 16px;
  border-bottom: 1px solid #f1f3f5;
}
.admin-card-header h2, .admin-card-header h3 {
  margin: 0;
  font-size: 18px;
  font-weight: 600;
}

/* Dashboard Stats */
.stat-widget {
  padding: 24px;
  background: #fff;
  border-radius: 8px;
  border: 1px solid #dee2e6;
  border-left: 4px solid var(--teal, #1C7C72);
  display: flex;
  flex-direction: column;
}
.stat-widget-label {
  font-size: 13px;
  text-transform: uppercase;
  color: #6c757d;
  font-weight: 600;
  letter-spacing: 0.5px;
}
.stat-widget-value {
  font-size: 32px;
  font-weight: 700;
  color: #212529;
  line-height: 1.2;
  margin-top: 8px;
}

/* Tables */
.table th {
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: #6c757d;
  font-weight: 600;
  border-bottom-width: 1px;
}
.table td {
  vertical-align: middle;
  font-size: 14.5px;
}

/* Badges */
.status-badge {
  padding: 4px 8px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.status-published { background: #d1e7dd; color: #0f5132; }
.status-draft { background: #fff3cd; color: #664d03; }
.status-scheduled { background: #cff4fc; color: #055160; }
.status-archived { background: #e2e3e5; color: #41464b; }
.status-new { background: #f8d7da; color: #842029; } /* for inquiries */

/* Actions */
.action-links {
  display: flex;
  gap: 12px;
}
.action-links a, .action-links button {
  color: #6c757d;
  font-size: 14px;
  text-decoration: none;
  background: none;
  border: none;
  padding: 0;
}
.action-links a:hover, .action-links button:hover {
  color: var(--teal, #1C7C72);
}
.action-links .text-danger:hover {
  color: #dc3545 !important;
}

/* Forms */
.form-label {
  font-weight: 500;
  font-size: 14px;
}

/* TinyMCE container */
.tox-tinymce {
  border-radius: 6px !important;
  border-color: #dee2e6 !important;
}


/* ─── 5. Media Library ───────────────────────────────────── */
.dropzone-area {
  border: 2px dashed #adb5bd;
  border-radius: 8px;
  padding: 40px;
  text-align: center;
  background: #f8f9fa;
  cursor: pointer;
  transition: all 0.2s ease;
  margin-bottom: 24px;
}
.dropzone-area:hover, .dropzone-area.dragover {
  border-color: var(--teal, #1C7C72);
  background: #f1f8f7;
}

.media-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 20px;
}
.media-item {
  background: #fff;
  border: 1px solid #dee2e6;
  border-radius: 8px;
  overflow: hidden;
  position: relative;
}
.media-thumb {
  height: 150px;
  background: #f8f9fa;
  display: flex;
  align-items: center;
  justify-content: center;
}
.media-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.media-thumb svg {
  color: #adb5bd;
}
.media-info {
  padding: 12px;
  border-top: 1px solid #f1f3f5;
}
.media-filename {
  font-size: 13px;
  font-weight: 500;
  margin-bottom: 4px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.media-meta {
  font-size: 11px;
  color: #6c757d;
  display: flex;
  justify-content: space-between;
}
.media-actions {
  position: absolute;
  top: 8px;
  right: 8px;
  display: flex;
  gap: 4px;
  opacity: 0;
  transition: opacity 0.2s ease;
}
.media-item:hover .media-actions {
  opacity: 1;
}
.media-btn {
  width: 28px;
  height: 28px;
  border-radius: 4px;
  background: rgba(255,255,255,0.9);
  border: 1px solid #dee2e6;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #495057;
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}
.media-btn:hover {
  background: #fff;
  color: var(--teal, #1C7C72);
}
.media-btn.text-danger:hover {
  color: #dc3545 !important;
}


/* ─── 6. Responsive Sidebar ──────────────────────────────── */
@media (max-width: 992px) {
  .admin-sidebar {
    transform: translateX(-100%);
  }
  .admin-sidebar.show {
    transform: translateX(0);
  }
  .admin-main {
    margin-left: 0;
  }
  .admin-hamburger {
    display: block;
  }
  .sidebar-close {
    display: block;
  }
  
  /* Overlay */
  .admin-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.5);
    z-index: 1035;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
  }
  .admin-overlay.show {
    opacity: 1;
    visibility: visible;
  }
}

/* ─── 7. Login Page Specific ─────────────────────────────── */
.login-page {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  background: var(--paper-dim, #F1E9D8);
}
.login-card {
  width: 100%;
  max-width: 400px;
  background: #fff;
  border-radius: 8px;
  box-shadow: 0 4px 24px rgba(15,43,51,0.07);
  padding: 40px;
}
.login-logo {
  text-align: center;
  margin-bottom: 32px;
}
