/* ==========================================================================
   MOGULZ CMD - ADMIN PANEL STYLESHEET
   ========================================================================== */

.admin-container {
  display: flex;
  height: 100vh;
  background-color: #ffffff;
  color: #000;
  font-family: 'Inter', sans-serif;
  overflow: hidden;
}

/* --- SIDEBAR --- */
.admin-sidebar {
  width: 280px;
  background-color: #f9f9f9;
  border-right: 1px solid rgba(0, 0, 0, 0.05);
  display: flex;
  flex-direction: column;
  padding: 2.5rem 0;
  transition: all 0.3s ease;
  flex-shrink: 0;
}

.admin-logo {
  font-size: 1.4rem;
  font-weight: 950;
  letter-spacing: -1px;
  padding: 0 2.5rem;
  margin-bottom: 3.5rem;
  color: #000;
  text-transform: uppercase;
}

.admin-logo span {
  color: var(--accent-purple, #800020);
  text-shadow: 0 0 15px rgba(128, 0, 32, 0.2);
}

.admin-nav {
  list-style: none;
  padding: 0;
  margin: 0;
}

.admin-nav li {
  padding: 1.2rem 2.5rem;
  cursor: pointer;
  font-weight: 700;
  font-size: 0.9rem;
  color: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  gap: 1.2rem;
  transition: all 0.3s cubic-bezier(0.165, 0.84, 0.44, 1);
  border-left: 3px solid transparent;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.admin-nav li i {
  font-size: 1.1rem;
  width: 20px;
}

.admin-nav li:hover {
  color: #000;
  background: rgba(128, 0, 32, 0.04);
}

.admin-nav li.active {
  color: #000;
  background: rgba(128, 0, 32, 0.08);
  border-left-color: var(--accent-purple, #800020);
}

/* --- MAIN CONTENT --- */
.admin-main {
  flex: 1;
  padding: 3rem;
  overflow-y: auto;
  background: radial-gradient(circle at top right, rgba(128, 0, 32, 0.02) 0%, transparent 40%);
}

.admin-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 3rem;
}

.admin-header h1 {
  font-size: 1.8rem;
  font-weight: 950;
  letter-spacing: -0.5px;
  text-transform: uppercase;
}

/* --- DASHBOARD OVERVIEW --- */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 2rem;
  margin-bottom: 4rem;
}

.stat-card {
  background: #000;
  color: white;
  padding: 2rem;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.05);
  transition: transform 0.3s ease;
}

.stat-card:hover {
  transform: translateY(-5px);
  border-color: var(--accent-purple, #800020);
}

.stat-label {
  color: rgba(255, 255, 255, 0.4);
  font-size: 0.8rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 0.8rem;
}

.stat-value {
  font-size: 2.2rem;
  font-weight: 950;
}

.stat-trend {
  margin-top: 1rem;
  font-size: 0.85rem;
  font-weight: 700;
}

.trend-up { color: #2ecc71; }
.trend-down { color: #e74c3c; }

/* --- TABLES --- */
.admin-table-container {
  background: #000;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.05);
  overflow: hidden;
}

.admin-table {
  width: 100%;
  border-collapse: collapse;
}

.admin-table th {
  background: rgba(255, 255, 255, 0.02);
  padding: 1.5rem;
  text-align: left;
  font-size: 0.8rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: rgba(255, 255, 255, 0.4);
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.admin-table td {
  padding: 1.5rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.03);
  font-size: 0.95rem;
  color: rgba(255, 255, 255, 0.8);
}

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

.item-title { font-weight: 900; color: #fff; text-transform: uppercase; }
.item-author { font-weight: 600; font-size: 0.9rem; }
.item-date { color: rgba(255, 255, 255, 0.4); font-size: 0.85rem; }

.status-badge {
  padding: 0.3rem 0.8rem;
  font-size: 0.7rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  border-radius: 50px;
  display: inline-block;
}

.status-published { background: rgba(46, 204, 113, 0.1); color: #2ecc71; }
.status-draft { background: rgba(241, 196, 15, 0.1); color: #f1c40f; }
.status-scheduled { background: rgba(52, 152, 219, 0.1); color: #3498db; }

.action-btns {
  display: flex;
  gap: 0.8rem;
}

.icon-action-btn {
  background: rgba(255, 255, 255, 0.05);
  border: none;
  color: white;
  width: 32px;
  height: 32px;
  border-radius: 6px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
}

.icon-action-btn:hover {
  background: var(--accent-purple, #800020);
}

.icon-action-btn.delete:hover {
  background: #e74c3c;
}

/* --- EDITOR OVERLAY --- */
.admin-editor-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.85);
  backdrop-filter: blur(8px);
  z-index: 2000;
  display: flex;
  justify-content: center;
  align-items: center;
  animation: adminFadeIn 0.3s ease;
}

.admin-editor-panel {
  width: 90%;
  max-width: 900px;
  background: #000;
  color: white;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 16px;
  box-shadow: 0 30px 60px rgba(0, 0, 0, 0.6);
  display: flex;
  flex-direction: column;
  max-height: 90vh;
}

.editor-header {
  padding: 1.8rem 2.5rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.editor-header h2 {
  font-size: 1.3rem;
  font-weight: 900;
  text-transform: uppercase;
}

.editor-header .close-btn {
  background: none;
  border: none;
  color: rgba(255, 255, 255, 0.4);
  font-size: 1.4rem;
  cursor: pointer;
  transition: all 0.3s ease;
}

.editor-header .close-btn:hover {
  color: var(--accent-red, #ff1a1a);
  transform: rotate(90deg);
}

.editor-body {
  padding: 2.5rem;
  overflow-y: auto;
}

.form-group {
  margin-bottom: 1.8rem;
}

.form-group label {
  display: block;
  font-size: 0.75rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: rgba(255, 255, 255, 0.5);
  margin-bottom: 0.6rem;
}

.form-group input, .form-group select, .form-group textarea {
  width: 100%;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  padding: 0.9rem 1.2rem;
  color: #fff;
  font-size: 0.95rem;
  font-family: inherit;
  transition: all 0.3s ease;
}

.form-group input:focus, .form-group select:focus, .form-group textarea:focus {
  outline: none;
  border-color: var(--accent-purple, #800020);
  background: rgba(255, 255, 255, 0.06);
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2rem;
}

.editor-actions {
  display: flex;
  justify-content: flex-end;
  gap: 1.2rem;
  padding: 1.8rem 2.5rem;
  background: rgba(255, 255, 255, 0.01);
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.btn-secondary-admin {
  background: rgba(255, 255, 255, 0.04);
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.08);
  padding: 0.8rem 1.5rem;
  border-radius: 8px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-secondary-admin:hover {
  background: rgba(255, 255, 255, 0.08);
}

.btn-primary-admin {
  background: var(--accent-purple, #800020);
  color: white;
  border: none;
  padding: 0.8rem 1.5rem;
  border-radius: 8px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-primary-admin:hover {
  background: var(--accent-red, #ff1a1a);
}

/* Login Gateway Dashboard Page */
.login-gateway {
  color: white;
}

.login-gateway label {
  color: rgba(255, 255, 255, 0.6);
  font-weight: 700;
}

/* Rich Text Editor Styling */
.editor-toolbar button {
  transition: background 0.2s ease;
}
.editor-toolbar button:hover {
  background: var(--accent-purple) !important;
}

@keyframes adminFadeIn {
  from { opacity: 0; transform: scale(0.97); }
  to { opacity: 1; transform: scale(1); }
}

@media (max-width: 1024px) {
  .admin-sidebar { width: 80px; }
  .admin-logo, .admin-nav li span { display: none; }
  .admin-nav li { justify-content: center; padding: 1.5rem; }
}

@media (max-width: 768px) {
  .form-row { grid-template-columns: 1fr; }
  .admin-editor-panel { width: 95%; max-height: 95vh; }
  .admin-main { padding: 1.5rem; }
  .admin-header { flex-direction: column; gap: 1rem; align-items: flex-start; }
}
