/* ========================================
   ADMIN PORTAL STYLES — Cyberium Group
   ======================================== */

/* === ADMIN LAYOUT === */
.admin-nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 1000;
  background: #0F1A2A;
  border-bottom: 1px solid rgba(255,255,255,0.08);
  height: 56px;
}
.admin-nav-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 32px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 100%;
}
.admin-nav-left {
  display: flex;
  align-items: center;
  gap: 16px;
}
.admin-nav-left .logo {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
}
.admin-nav-left .logo-mark {
  height: 32px;
  display: flex;
  align-items: center;
}
.admin-nav-left .logo-mark img {
  height: 32px;
  width: auto;
  filter: brightness(0) invert(1);
}
.admin-badge {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  color: var(--accent);
  background: rgba(27,106,201,0.15);
  padding: 3px 8px;
  border-radius: 4px;
}
.admin-nav-links {
  display: flex;
  align-items: center;
  gap: 4px;
}
.admin-nav-links a {
  color: rgba(255,255,255,0.6);
  text-decoration: none;
  font-size: 13px;
  font-weight: 500;
  padding: 6px 12px;
  border-radius: 6px;
  transition: all 0.15s ease;
}
.admin-nav-links a:hover { color: white; background: rgba(255,255,255,0.08); }
.admin-nav-links a.active { color: white; background: rgba(255,255,255,0.1); }
.admin-nav-right {
  display: flex;
  align-items: center;
  gap: 12px;
}
.admin-btn-site {
  color: rgba(255,255,255,0.5);
  text-decoration: none;
  font-size: 12px;
  font-weight: 500;
  padding: 5px 10px;
  border-radius: 6px;
  border: 1px solid rgba(255,255,255,0.1);
  transition: all 0.15s ease;
}
.admin-btn-site:hover { color: white; border-color: rgba(255,255,255,0.25); }
.admin-btn-signout {
  background: none;
  border: 1px solid rgba(255,255,255,0.1);
  color: rgba(255,255,255,0.5);
  font-size: 12px;
  font-weight: 500;
  padding: 5px 12px;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.15s ease;
  font-family: var(--font-body);
}
.admin-btn-signout:hover { color: #f87171; border-color: rgba(248,113,113,0.3); }

.admin-main {
  padding: 88px 0 48px;
  min-height: 100vh;
  background: var(--bg);
}
.admin-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 32px;
}

/* === ADMIN HEADER === */
.admin-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 32px;
}
.admin-header h1 {
  font-size: 24px;
  font-weight: 700;
}
.admin-header-actions {
  display: flex;
  gap: 10px;
}

/* === LOGIN PAGE === */
.login-page {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  background: var(--bg);
}
.login-card {
  background: var(--bg-white);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 48px 40px;
  width: 100%;
  max-width: 420px;
  box-shadow: var(--shadow-md);
}
.login-card .logo {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  margin-bottom: 8px;
}
.login-card .logo-mark { height: 40px; display: flex; align-items: center; }
.login-card .logo-mark img { height: 40px; width: auto; }
.login-card .admin-badge { margin-bottom: 32px; display: inline-block; }
.login-card h1 {
  font-size: 22px;
  font-weight: 700;
  margin-bottom: 6px;
}
.login-card .login-subtitle {
  font-size: 14px;
  color: var(--text-secondary);
  margin-bottom: 28px;
}
.login-error {
  background: #FEF2F2;
  color: #DC2626;
  border: 1px solid #FECACA;
  padding: 10px 14px;
  border-radius: 8px;
  font-size: 13px;
  margin-bottom: 16px;
  display: none;
}
.login-error.show { display: block; }

/* === TABLES === */
.admin-section {
  margin-bottom: 48px;
}
.admin-section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}
.admin-section-header h2 {
  font-size: 18px;
  font-weight: 700;
}
.admin-table-wrap {
  background: var(--bg-white);
  border: 1px solid var(--border-light);
  border-radius: 12px;
  overflow: hidden;
}
.admin-table {
  width: 100%;
  border-collapse: collapse;
}
.admin-table th {
  text-align: left;
  padding: 12px 16px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--text-muted);
  background: var(--bg);
  border-bottom: 1px solid var(--border-light);
}
.admin-table td {
  padding: 14px 16px;
  font-size: 14px;
  color: var(--text-primary);
  border-bottom: 1px solid var(--border-light);
  vertical-align: middle;
}
.admin-table tr:last-child td { border-bottom: none; }
.admin-table tr:hover td { background: rgba(0,0,0,0.01); }
.admin-table .title-cell {
  font-weight: 600;
}

/* Status badges */
.status-badge {
  font-size: 11px;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: 100px;
  text-transform: capitalize;
}
.status-badge.published {
  background: #ECFDF5;
  color: #16794A;
}
.status-badge.draft {
  background: #FFF8E7;
  color: #B7791F;
}

/* Table actions */
.table-actions {
  display: flex;
  gap: 6px;
}
.table-btn {
  padding: 5px 10px;
  font-size: 12px;
  font-weight: 500;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: var(--bg-white);
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.15s ease;
  text-decoration: none;
  font-family: var(--font-body);
}
.table-btn:hover { border-color: var(--accent); color: var(--accent); }
.table-btn.delete:hover { border-color: #DC2626; color: #DC2626; }

/* === BUTTONS === */
.admin-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 9px 18px;
  font-size: 13px;
  font-weight: 600;
  border-radius: 8px;
  border: none;
  cursor: pointer;
  transition: all 0.15s ease;
  text-decoration: none;
  font-family: var(--font-body);
}
.admin-btn-primary {
  background: var(--accent);
  color: white;
}
.admin-btn-primary:hover { background: var(--accent-deep); }
.admin-btn-secondary {
  background: var(--bg);
  color: var(--text-secondary);
  border: 1px solid var(--border);
}
.admin-btn-secondary:hover { border-color: #C4C9D4; color: var(--text-primary); }
.admin-btn-danger {
  background: #FEF2F2;
  color: #DC2626;
  border: 1px solid #FECACA;
}
.admin-btn-danger:hover { background: #FEE2E2; }

/* === EDITOR FORM === */
.editor-card {
  background: var(--bg-white);
  border: 1px solid var(--border-light);
  border-radius: 14px;
  padding: 36px 32px;
}
.editor-grid {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 32px;
  align-items: start;
}
.editor-sidebar {
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.sidebar-card {
  background: var(--bg);
  border: 1px solid var(--border-light);
  border-radius: 12px;
  padding: 20px;
}
.sidebar-card h3 {
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-muted);
  margin-bottom: 14px;
}
.editor-actions {
  display: flex;
  gap: 10px;
  margin-top: 24px;
}

/* Toggle switch for status */
.toggle-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
}
.toggle-label {
  font-size: 14px;
  font-weight: 500;
  color: var(--text-secondary);
}
.toggle-switch {
  position: relative;
  width: 44px;
  height: 24px;
}
.toggle-switch input {
  opacity: 0;
  width: 0;
  height: 0;
}
.toggle-slider {
  position: absolute;
  cursor: pointer;
  top: 0; left: 0; right: 0; bottom: 0;
  background: #D1D5DB;
  border-radius: 24px;
  transition: 0.2s ease;
}
.toggle-slider::before {
  content: '';
  position: absolute;
  height: 18px;
  width: 18px;
  left: 3px;
  bottom: 3px;
  background: white;
  border-radius: 50%;
  transition: 0.2s ease;
}
.toggle-switch input:checked + .toggle-slider {
  background: var(--success);
}
.toggle-switch input:checked + .toggle-slider::before {
  transform: translateX(20px);
}

/* Cover image preview */
.cover-preview {
  width: 100%;
  aspect-ratio: 16 / 9;
  background: var(--bg);
  border: 2px dashed var(--border);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  color: var(--text-muted);
  overflow: hidden;
  margin-bottom: 12px;
  position: relative;
}
.cover-preview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.cover-preview .placeholder-text {
  text-align: center;
  padding: 20px;
}

/* Quill editor overrides */
.ql-toolbar.ql-snow {
  border-color: var(--border) !important;
  border-radius: 10px 10px 0 0 !important;
  background: var(--bg) !important;
}
.ql-container.ql-snow {
  border-color: var(--border) !important;
  border-radius: 0 0 10px 10px !important;
  font-family: var(--font-body) !important;
  font-size: 15px !important;
  min-height: 300px;
}
.ql-editor {
  min-height: 300px;
  line-height: 1.7;
}
.ql-editor h2 { font-size: 22px; font-weight: 700; margin: 24px 0 12px; }
.ql-editor h3 { font-size: 18px; font-weight: 700; margin: 20px 0 10px; }
.ql-editor p { margin-bottom: 12px; }
.ql-editor blockquote {
  border-left: 3px solid var(--accent);
  padding-left: 16px;
  color: var(--text-secondary);
  font-style: italic;
}

/* === LOADING STATES === */
.admin-loading {
  text-align: center;
  padding: 48px;
  color: var(--text-muted);
  font-size: 14px;
}
.admin-empty {
  text-align: center;
  padding: 48px;
  color: var(--text-muted);
  font-size: 14px;
}

/* === TOAST NOTIFICATIONS === */
.toast {
  position: fixed;
  bottom: 24px;
  right: 24px;
  background: #0F1A2A;
  color: white;
  padding: 12px 20px;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 500;
  box-shadow: var(--shadow-lg);
  z-index: 9999;
  opacity: 0;
  transform: translateY(10px);
  transition: all 0.3s ease;
  pointer-events: none;
}
.toast.show {
  opacity: 1;
  transform: translateY(0);
}
.toast.error {
  background: #DC2626;
}

/* === RESPONSIVE === */
@media (max-width: 768px) {
  .admin-nav-inner { padding: 0 16px; }
  .admin-container { padding: 0 16px; }
  .admin-main { padding: 72px 0 32px; }
  .editor-grid { grid-template-columns: 1fr; }
  .admin-header { flex-direction: column; align-items: flex-start; gap: 12px; }
  .admin-table-wrap { overflow-x: auto; }
  .login-card { margin: 16px; padding: 32px 24px; }
  .admin-nav-links { display: none; }
}
