/* ==========================================================================
   LIVE 24 NEWS — Customized Admin Panel Stylesheet
   Matches ./logo.png palette (#ef090e, #990005, #041a38) & zero mobile overflow
   ========================================================================== */

:root {
  --brand-red: #ef090e;
  --brand-red-dark: #990005;
  --brand-navy: #041a38;
  --brand-navy-deep: #021024;
  --surface-bg: #f3f6fb;
  --border-color: #e2e8f2;
  --sidebar-width: 268px;
}

html,
body {
  overflow-x: hidden;
  max-width: 100%;
  background-color: var(--surface-bg);
  font-family: "Inter", "Roboto", sans-serif;
}

/* Login Screen */
.admin-login-screen {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: radial-gradient(circle at top right, rgba(239, 9, 14, 0.16), transparent 45%),
    linear-gradient(135deg, var(--brand-navy-deep) 0%, var(--brand-navy) 100%);
}

.admin-login-card {
  width: 100%;
  max-width: 420px;
  background: #ffffff;
  border-radius: 14px;
  padding: 32px 28px;
  box-shadow: 0 20px 48px rgba(0, 0, 0, 0.3);
  border-top: 5px solid var(--brand-red);
}

.admin-login-logo {
  width: 100px;
  height: 100px;
  object-fit: contain;
  margin: 0 auto 12px;
}

/* Shell Layout */
.admin-shell {
  display: flex;
  min-height: 100vh;
  width: 100%;
  overflow-x: hidden;
}

.admin-sidebar {
  width: var(--sidebar-width);
  flex-shrink: 0;
  background: linear-gradient(180deg, var(--brand-navy) 0%, var(--brand-navy-deep) 100%);
  color: #ffffff;
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
  z-index: 1040;
  border-right: 3px solid var(--brand-red);
  transition: transform 0.28s ease;
}

.admin-sidebar-brand {
  padding: 18px 20px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  display: flex;
  align-items: center;
  gap: 12px;
}

.admin-sidebar-logo-box {
  background: #ffffff;
  border-radius: 8px;
  padding: 5px 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.admin-sidebar-logo-box img {
  width: 62px;
  height: 62px;
  object-fit: contain;
}

.admin-nav {
  padding: 14px 12px;
  flex: 1 1 auto;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.admin-nav-btn {
  width: 100%;
  text-align: left;
  background: transparent;
  border: none;
  color: #d6e0f0;
  font-size: 13.5px;
  font-weight: 600;
  padding: 11px 14px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  gap: 11px;
  cursor: pointer;
  transition: background-color 0.18s ease, color 0.18s ease, transform 0.15s ease;
}

.admin-nav-btn i {
  font-size: 16px;
}

.admin-nav-btn:hover {
  background: rgba(255, 255, 255, 0.08);
  color: #ffffff;
}

.admin-nav-btn.active {
  background: linear-gradient(135deg, var(--brand-red) 0%, var(--brand-red-dark) 100%);
  color: #ffffff;
  box-shadow: 0 4px 12px rgba(239, 9, 14, 0.32);
}

.admin-sidebar-footer {
  padding: 14px 16px;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  display: flex;
  flex-direction: column;
  gap: 8px;
}

/* Main Content */
.admin-main {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.admin-topbar {
  background: #ffffff;
  border-bottom: 1px solid var(--border-color);
  padding: 12px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  position: sticky;
  top: 0;
  z-index: 1020;
}

.admin-content {
  padding: 24px;
  flex: 1 1 auto;
  min-width: 0;
}

.admin-panel-card {
  background: #ffffff;
  border: 1px solid var(--border-color);
  border-radius: 10px;
  padding: 20px;
  box-shadow: 0 3px 14px rgba(4, 26, 56, 0.04);
}

.admin-stat-card {
  background: #ffffff;
  border: 1px solid var(--border-color);
  border-left: 4px solid var(--brand-red);
  border-radius: 10px;
  padding: 16px 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  box-shadow: 0 3px 12px rgba(4, 26, 56, 0.04);
}

.admin-stat-card.navy {
  border-left-color: var(--brand-navy);
}

.admin-stat-icon {
  width: 44px;
  height: 44px;
  border-radius: 10px;
  background: rgba(239, 9, 14, 0.1);
  color: var(--brand-red);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
}

.admin-stat-card.navy .admin-stat-icon {
  background: rgba(4, 26, 56, 0.09);
  color: var(--brand-navy);
}

/* Post Editor & Image Picker */
.image-preview-box {
  width: 100%;
  aspect-ratio: 16 / 9;
  border-radius: 8px;
  border: 2px dashed #cbd6e6;
  background: #f8fafd;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

.image-preview-box img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.gallery-picker-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(84px, 1fr));
  gap: 8px;
  max-height: 210px;
  overflow-y: auto;
  padding: 4px;
}

.gallery-thumb-btn {
  border: 2px solid transparent;
  border-radius: 6px;
  padding: 0;
  overflow: hidden;
  aspect-ratio: 16 / 10;
  cursor: pointer;
  background: #e5ebf3;
  transition: transform 0.15s ease, border-color 0.15s ease;
}

.gallery-thumb-btn:hover {
  transform: scale(1.03);
}

.gallery-thumb-btn.selected {
  border-color: var(--brand-red);
  box-shadow: 0 0 0 2px rgba(239, 9, 14, 0.25);
}

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

.post-table-thumb {
  width: 64px;
  height: 42px;
  border-radius: 5px;
  object-fit: cover;
  flex-shrink: 0;
}

.admin-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(2, 16, 36, 0.55);
  z-index: 1035;
  display: none;
}

.admin-backdrop.show {
  display: block;
}

.admin-toast-wrap {
  position: fixed;
  bottom: 20px;
  right: 20px;
  z-index: 9999;
  max-width: calc(100vw - 40px);
}

@media (max-width: 991.98px) {
  .admin-sidebar {
    position: fixed;
    left: 0;
    top: 0;
    transform: translateX(-100%);
  }

  .admin-sidebar.open {
    transform: translateX(0);
  }

  .admin-topbar {
    padding: 12px 16px;
  }

  .admin-content {
    padding: 16px;
  }
}
