/* Admin Panel Styles for Shri Mahakaleshwar Bhakta Niwas */

:root {
  --primary-maroon: #78100C;
  --maroon-dark: #4A0E18;
  --maroon-light: #9B1914;
  --gold: #C9A227;
  --gold-accent: #F2A93C;
  --gold-light: #F8D878;
  --bg-dark: #1E1214;
  --card-bg: #2B1A1E;
  --panel-border: rgba(242, 169, 60, 0.2);
  --text-light: #FDFBF7;
  --text-muted: #D5C7BD;
  --success: #2E7D32;
  --danger: #C62828;
  --info: #0288D1;
  --font-main: 'Work Sans', system-ui, -apple-system, sans-serif;
  --font-serif: 'Cormorant Garamond', Georgia, serif;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  background-color: var(--bg-dark);
  color: var(--text-light);
  font-family: var(--font-main);
  line-height: 1.6;
  min-height: 100vh;
}

/* AUTH OVERLAY */
.auth-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 8, 10, 0.95);
  backdrop-filter: blur(10px);
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
}

.auth-card {
  background: var(--card-bg);
  border: 1px solid var(--gold);
  border-radius: 16px;
  padding: 2.5rem;
  max-width: 400px;
  width: 100%;
  text-align: center;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.6);
}

.auth-card h2 {
  font-family: var(--font-serif);
  color: var(--gold-light);
  font-size: 2rem;
  margin-bottom: 0.5rem;
}

.auth-input {
  width: 100%;
  padding: 0.85rem;
  border-radius: 8px;
  border: 1px solid var(--panel-border);
  background: rgba(0, 0, 0, 0.4);
  color: #FFF;
  font-size: 1.1rem;
  margin: 1.25rem 0;
  text-align: center;
  letter-spacing: 2px;
}

.auth-input:focus {
  outline: none;
  border-color: var(--gold-accent);
  box-shadow: 0 0 10px rgba(242, 169, 60, 0.4);
}

/* NAVBAR */
.admin-navbar {
  background: linear-gradient(135deg, var(--maroon-dark) 0%, var(--primary-maroon) 100%);
  border-bottom: 2px solid var(--gold);
  padding: 1rem 2rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.admin-brand {
  display: flex;
  align-items: center;
  gap: 1rem;
  text-decoration: none;
}

.admin-brand img {
  height: 45px;
  border-radius: 50%;
  border: 2px solid var(--gold-accent);
}

.admin-brand-title {
  font-family: var(--font-serif);
  font-size: 1.5rem;
  color: var(--gold-light);
  font-weight: 700;
}

.admin-tag {
  background: rgba(242, 169, 60, 0.2);
  color: var(--gold-accent);
  font-size: 0.75rem;
  padding: 0.25rem 0.6rem;
  border-radius: 4px;
  border: 1px solid var(--gold);
  text-transform: uppercase;
  letter-spacing: 1px;
}

/* CONTAINER */
.admin-container {
  max-width: 1300px;
  margin: 2rem auto;
  padding: 0 1.5rem;
}

/* STATS GRID */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1.5rem;
  margin-bottom: 2rem;
}

.stat-card {
  background: var(--card-bg);
  border: 1px solid var(--panel-border);
  border-radius: 12px;
  padding: 1.5rem;
  display: flex;
  align-items: center;
  gap: 1.25rem;
  transition: transform 0.2s ease, border-color 0.2s ease;
}

.stat-card:hover {
  transform: translateY(-3px);
  border-color: var(--gold);
}

.stat-icon {
  font-size: 2.5rem;
  background: rgba(120, 16, 12, 0.4);
  width: 60px;
  height: 60px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 12px;
  border: 1px solid var(--panel-border);
}

.stat-val {
  font-size: 2rem;
  font-weight: 700;
  color: var(--gold-light);
}

.stat-label {
  font-size: 0.9rem;
  color: var(--text-muted);
}

/* HEADER ACTIONS */
.content-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.section-title {
  font-family: var(--font-serif);
  font-size: 2rem;
  color: var(--gold-light);
}

.search-box {
  display: flex;
  gap: 0.75rem;
  align-items: center;
}

.search-input {
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid var(--panel-border);
  color: #FFF;
  padding: 0.65rem 1rem;
  border-radius: 8px;
  width: 260px;
}

.search-input:focus {
  outline: none;
  border-color: var(--gold);
}

/* BUTTONS */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.65rem 1.25rem;
  border-radius: 8px;
  font-weight: 600;
  cursor: pointer;
  border: none;
  transition: all 0.2s ease;
  text-decoration: none;
  font-size: 0.95rem;
}

.btn-primary {
  background: linear-gradient(135deg, var(--gold-accent) 0%, var(--gold) 100%);
  color: #240A0C;
}

.btn-primary:hover {
  background: linear-gradient(135deg, var(--gold-light) 0%, var(--gold-accent) 100%);
  box-shadow: 0 4px 15px rgba(242, 169, 60, 0.3);
}

.btn-danger {
  background: var(--danger);
  color: #FFF;
}

.btn-danger:hover {
  background: #E53935;
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.1);
  color: var(--text-light);
  border: 1px solid rgba(255, 255, 255, 0.2);
}

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

.btn-sm {
  padding: 0.4rem 0.8rem;
  font-size: 0.85rem;
}

/* TABLE */
.table-card {
  background: var(--card-bg);
  border: 1px solid var(--panel-border);
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

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

.admin-table th {
  background: rgba(0, 0, 0, 0.4);
  padding: 1rem;
  color: var(--gold-light);
  font-size: 0.9rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  border-bottom: 1px solid var(--panel-border);
}

.admin-table td {
  padding: 1rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  vertical-align: middle;
}

.admin-table tr:hover {
  background: rgba(255, 255, 255, 0.02);
}

.blog-thumb {
  width: 65px;
  height: 45px;
  border-radius: 6px;
  object-fit: cover;
  border: 1px solid var(--panel-border);
}

.blog-title-cell {
  font-weight: 600;
  color: #FFF;
}

.blog-slug-text {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.category-pill {
  display: inline-block;
  padding: 0.25rem 0.65rem;
  background: rgba(120, 16, 12, 0.5);
  border: 1px solid var(--primary-maroon);
  border-radius: 50px;
  font-size: 0.8rem;
  color: var(--gold-light);
}

.actions-cell {
  display: flex;
  gap: 0.5rem;
}

/* MODAL */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.8);
  backdrop-filter: blur(5px);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.modal-backdrop.active {
  opacity: 1;
  pointer-events: auto;
}

.modal-content {
  background: var(--card-bg);
  border: 1px solid var(--gold);
  border-radius: 16px;
  max-width: 850px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  padding: 2rem;
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.7);
  position: relative;
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid var(--panel-border);
  padding-bottom: 1rem;
  margin-bottom: 1.5rem;
}

.modal-title {
  font-family: var(--font-serif);
  font-size: 1.8rem;
  color: var(--gold-light);
}

.close-btn {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 1.5rem;
  cursor: pointer;
}

.close-btn:hover {
  color: #FFF;
}

/* FORM ELEMENTS */
.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.25rem;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-bottom: 1.25rem;
}

.form-group.full-width {
  grid-column: span 2;
}

.form-label {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--gold-light);
}

.form-control {
  background: rgba(0, 0, 0, 0.4);
  border: 1px solid var(--panel-border);
  border-radius: 8px;
  padding: 0.75rem 1rem;
  color: #FFF;
  font-size: 1rem;
  font-family: inherit;
}

.form-control:focus {
  outline: none;
  border-color: var(--gold);
  box-shadow: 0 0 10px rgba(201, 162, 39, 0.2);
}

textarea.form-control {
  min-height: 140px;
  resize: vertical;
}

/* EDITOR FORMATTING TOOLBAR */
.editor-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  background: rgba(0, 0, 0, 0.5);
  border: 1px solid var(--panel-border);
  border-bottom: none;
  border-radius: 8px 8px 0 0;
  padding: 0.5rem;
}

.tool-btn {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: #FFF;
  padding: 0.3rem 0.6rem;
  border-radius: 4px;
  font-size: 0.85rem;
  cursor: pointer;
}

.tool-btn:hover {
  background: var(--primary-maroon);
  border-color: var(--gold);
}

.editor-textarea {
  border-radius: 0 0 8px 8px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.95rem;
  line-height: 1.6;
}

/* IMAGE UPLOAD PREVIEW */
.image-preview-container {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-top: 0.5rem;
}

.image-preview {
  width: 120px;
  height: 80px;
  border-radius: 8px;
  object-fit: cover;
  border: 1px dashed var(--gold);
  background: rgba(0, 0, 0, 0.3);
}

/* TOAST NOTIFICATION */
.toast-container {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  z-index: 10000;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.toast {
  background: var(--card-bg);
  border: 1px solid var(--gold);
  color: #FFF;
  padding: 1rem 1.5rem;
  border-radius: 10px;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  gap: 0.75rem;
  animation: slideIn 0.3s ease;
}

.toast-success { border-color: #4CAF50; }
.toast-error { border-color: #F44336; }

@keyframes slideIn {
  from { transform: translateX(100%); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}

@media (max-width: 768px) {
  .form-grid { grid-template-columns: 1fr; }
  .form-group.full-width { grid-column: span 1; }
  .actions-cell { flex-direction: column; }
}
