/* ============================================================
   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: #1C7C72; /* Navbar Teal Color */
  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 {
  font-size: 19px;
  font-weight: 700;
  color: #fff;
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 10px;
}
.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: 15px 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: 2px;
}

.sidebar-link {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 24px;
  color: rgba(255,255,255,0.85);
  text-decoration: none;
  font-size: 15px;
  font-weight: 500;
  transition: all 0.2s ease;
  position: relative;
}
.sidebar-link svg {
  opacity: 0.85;
}
.sidebar-link:hover {
  color: #fff;
  background: rgba(255,255,255,0.1);
}
.sidebar-link.active {
  color: #fff;
  background: rgba(255,255,255,0.15);
  font-weight: 600;
}
.sidebar-link:hover svg, .sidebar-link.active svg {
  opacity: 1;
}

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

.sidebar-badge {
  margin-left: auto;
  background: #ef4444;
  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;
  transition: margin-left 0.3s ease;
}

.admin-topbar {
  height: var(--admin-topbar-height);
  background: #fff;
  border-bottom: 1px solid #e5e7eb;
  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: 700;
  margin: 0;
  color: #1f2937;
}

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

.admin-user-name {
  font-size: 14.5px;
  font-weight: 500;
  color: #4b5563;
}

.admin-logout-btn {
  background-color: #ef4444; /* Red button */
  color: #fff !important;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  border-radius: 6px;
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
  transition: background-color 0.2s ease;
}
.admin-logout-btn:hover {
  background-color: #dc2626;
  color: #fff !important;
}

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


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

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

/* Dashboard Stats */
.stat-widget {
  padding: 24px;
  background: #fff;
  border-radius: 12px;
  border: 1px solid #e5e7eb;
  box-shadow: 0 4px 6px -1px rgba(0,0,0,0.05), 0 2px 4px -1px rgba(0,0,0,0.03);
  display: flex;
  flex-direction: row; /* Horizontal layout */
  align-items: center;
  gap: 20px;
}
.stat-widget-icon {
  width: 54px;
  height: 54px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
}
.stat-widget-icon-blue {
  background: #eff6ff;
  color: #2563eb;
}
.stat-widget-icon-green {
  background: #f0fdf4;
  color: #16a34a;
}
.stat-widget-icon-teal {
  background: #f0fdfa;
  color: #0d9488;
}
.stat-widget-icon-orange {
  background: #fff7ed;
  color: #ea580c;
}
.stat-widget-info {
  display: flex;
  flex-direction: column;
}
.stat-widget-label {
  order: 2;
  font-size: 14px;
  color: #6b7280;
  font-weight: 500;
  margin-top: 2px;
  text-transform: none;
  letter-spacing: normal;
}
.stat-widget-value {
  order: 1;
  font-size: 28px;
  font-weight: 700;
  color: #111827;
  margin: 0;
  line-height: 1;
}

/* 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-input, .form-textarea, .form-select {
  display: block;
  width: 100%;
  padding: 10px 14px;
  font-size: 14.5px;
  font-weight: 400;
  line-height: 1.5;
  color: #1f2937;
  background-color: #fff;
  border: 1px solid #d1d5db;
  border-radius: 8px;
  box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  transition: border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
}

.form-input:focus, .form-textarea:focus, .form-select:focus {
  color: #1f2937;
  background-color: #fff;
  border-color: #10b981;
  outline: 0;
  box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.15);
}

.form-label {
  display: inline-block;
  margin-bottom: 6px;
  font-size: 14px;
  font-weight: 600;
  color: #374151;
}

.form-hint {
  margin-top: 6px;
  font-size: 12.5px;
  color: #6b7280;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-weight: 600;
  font-size: 14.5px;
  padding: 10px 18px;
  border-radius: 8px;
  transition: all 0.2s ease;
  cursor: pointer;
  border: 1px solid transparent;
  text-decoration: none;
}

.btn-primary {
  background-color: #14532d;
  color: #fff !important;
  border-color: #14532d;
}
.btn-primary:hover {
  background-color: #166534;
  border-color: #166534;
  color: #fff !important;
}

.btn-secondary {
  background-color: #fff;
  color: #4b5563 !important;
  border: 1px solid #d1d5db;
}
.btn-secondary:hover {
  background-color: #f9fafb;
  color: #1f2937 !important;
}

/* 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;
}
