/* ==========================================================================
   Dharmik Tech Blog CMS — Admin Dashboard Styles (100% Light Theme)
   ========================================================================== */

:root {
  --primary: #FF6B00;
  --primary-dark: #E05500;
  --primary-light: #FFF0E5;
  --primary-subtle: #FFF8F2;
  --dark: #121826;
  --dark-2: #1E293B;
  --dark-3: #334155;
  --text-dark: #1E293B;
  --text-muted: #64748B;
  --bg-page: #F8FAFC;
  --bg-card: #FFFFFF;
  --border: #E2E8F0;
  --border-light: #F1F5F9;
  --success: #10B981;
  --success-light: #D1FAE5;
  --warning: #F59E0B;
  --warning-light: #FEF3C7;
  --danger: #EF4444;
  --danger-light: #FEE2E2;
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 14px;
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.07), 0 2px 4px -2px rgba(0, 0, 0, 0.05);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.08), 0 4px 6px -4px rgba(0, 0, 0, 0.04);
  --font-main: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-heading: 'Sora', 'Inter', sans-serif;
}

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

body {
  font-family: var(--font-main);
  background-color: var(--bg-page);
  color: var(--text-dark);
  line-height: 1.5;
  font-size: 0.9375rem;
  -webkit-font-smoothing: antialiased;
}

a {
  color: var(--primary);
  text-decoration: none;
  transition: all 0.2s ease;
}

a:hover {
  color: var(--primary-dark);
}

/* ================= LOGIN LAYOUT ================= */
.login-wrapper {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  background: radial-gradient(circle at 10% 20%, #FFF5EB 0%, #F8FAFC 90%);
}

.login-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  width: 100%;
  max-width: 440px;
  padding: 2.5rem 2rem;
}

.login-logo {
  text-align: center;
  margin-bottom: 2rem;
}

.login-logo img {
  height: 52px;
  width: auto;
}

.login-title {
  font-family: var(--font-heading);
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--dark);
  margin-bottom: 0.5rem;
  text-align: center;
}

.login-subtitle {
  color: var(--text-muted);
  font-size: 0.875rem;
  text-align: center;
  margin-bottom: 1.75rem;
}

/* ================= ADMIN LAYOUT ================= */
.admin-layout {
  display: flex;
  min-height: 100vh;
}

/* Sidebar */
.admin-sidebar {
  width: 260px;
  background: var(--bg-card);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0;
  bottom: 0;
  left: 0;
  z-index: 100;
  transition: transform 0.3s ease;
}

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

.sidebar-header img {
  height: 42px;
}

.sidebar-nav {
  padding: 1.25rem 0.75rem;
  flex: 1;
  overflow-y: auto;
}

.nav-section-title {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  padding: 0.5rem 0.75rem;
  margin-top: 0.75rem;
}

.sidebar-link {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 1rem;
  border-radius: var(--radius-md);
  color: var(--text-dark);
  font-weight: 500;
  font-size: 0.9rem;
  margin-bottom: 0.25rem;
  transition: all 0.15s ease;
}

.sidebar-link:hover {
  background: var(--primary-subtle);
  color: var(--primary);
}

.sidebar-link.active {
  background: var(--primary-light);
  color: var(--primary);
  font-weight: 600;
}

.sidebar-link svg {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}

.sidebar-footer {
  padding: 1rem 1.25rem;
  border-top: 1px solid var(--border-light);
  background: #FCFDFD;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.user-badge {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.user-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--primary-light);
  color: var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.875rem;
}

.user-name {
  font-weight: 600;
  font-size: 0.85rem;
  color: var(--dark);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 120px;
}

.user-role {
  font-size: 0.75rem;
  color: var(--text-muted);
}

/* Main Content Area */
.admin-main {
  flex: 1;
  margin-left: 260px;
  padding: 2rem;
  max-width: 1400px;
}

.top-navbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 2rem;
  background: var(--bg-card);
  padding: 1rem 1.5rem;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
}

.page-title {
  font-family: var(--font-heading);
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--dark);
}

.page-subtitle {
  color: var(--text-muted);
  font-size: 0.875rem;
}

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

.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  box-shadow: var(--shadow-sm);
  display: flex;
  align-items: center;
  gap: 1.25rem;
}

.stat-icon {
  width: 52px;
  height: 52px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  flex-shrink: 0;
}

.stat-icon.orange { background: #FFF0E5; color: #FF6B00; }
.stat-icon.green { background: #D1FAE5; color: #10B981; }
.stat-icon.yellow { background: #FEF3C7; color: #D97706; }
.stat-icon.blue { background: #E0F2FE; color: #0284C7; }

.stat-value {
  font-family: var(--font-heading);
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--dark);
  line-height: 1.2;
}

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

/* ================= BUTTONS & FORMS ================= */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.65rem 1.25rem;
  font-size: 0.9rem;
  font-weight: 600;
  border-radius: var(--radius-md);
  border: 1px solid transparent;
  cursor: pointer;
  transition: all 0.2s ease;
  font-family: inherit;
}

.btn-primary {
  background: var(--primary);
  color: #FFFFFF;
}

.btn-primary:hover {
  background: var(--primary-dark);
  color: #FFFFFF;
}

.btn-secondary {
  background: #F1F5F9;
  color: var(--dark-2);
  border-color: var(--border);
}

.btn-secondary:hover {
  background: #E2E8F0;
}

.btn-outline {
  background: transparent;
  border-color: var(--border);
  color: var(--text-dark);
}

.btn-outline:hover {
  background: #F8FAFC;
  border-color: #CBD5E1;
}

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

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

.btn-sm {
  padding: 0.4rem 0.75rem;
  font-size: 0.8125rem;
}

.btn-icon {
  width: 34px;
  height: 34px;
  padding: 0;
  border-radius: var(--radius-sm);
}

/* Form Controls */
.form-group {
  margin-bottom: 1.25rem;
}

.form-label {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--dark-2);
  margin-bottom: 0.4rem;
}

.form-control {
  width: 100%;
  padding: 0.65rem 0.9rem;
  font-size: 0.9rem;
  font-family: inherit;
  color: var(--dark);
  background: #FFFFFF;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  transition: all 0.2s ease;
}

.form-control:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(255, 107, 0, 0.15);
}

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

/* ================= CARD CONTAINER & TABLE ================= */
.admin-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
  margin-bottom: 2rem;
}

.card-header-bar {
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
}

.card-header-title {
  font-family: var(--font-heading);
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--dark);
}

.filter-bar {
  display: flex;
  gap: 0.75rem;
  align-items: center;
  flex-wrap: wrap;
}

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

.data-table th {
  background: #F8FAFC;
  padding: 0.85rem 1.25rem;
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border);
}

.data-table td {
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--border-light);
  vertical-align: middle;
  font-size: 0.9rem;
}

.data-table tr:hover td {
  background: #FAFBFD;
}

.article-cell {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.article-thumb {
  width: 54px;
  height: 54px;
  border-radius: var(--radius-md);
  object-fit: cover;
  background: #F1F5F9;
  border: 1px solid var(--border-light);
  flex-shrink: 0;
}

.article-title-text {
  font-weight: 600;
  color: var(--dark);
  line-height: 1.35;
  margin-bottom: 0.25rem;
}

.article-slug-text {
  font-size: 0.75rem;
  color: var(--text-muted);
  font-family: monospace;
}

/* Badges */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 0.25rem 0.65rem;
  border-radius: 9999px;
  font-size: 0.75rem;
  font-weight: 600;
}

.badge-published { background: var(--success-light); color: #065F46; }
.badge-draft { background: var(--warning-light); color: #92400E; }
.badge-category { background: #F1F5F9; color: #334155; border: 1px solid var(--border); }

/* ================= EDITOR TWO-COLUMN LAYOUT ================= */
.editor-grid {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 1.5rem;
}

@media (max-width: 1024px) {
  .editor-grid {
    grid-template-columns: 1fr;
  }
}

.editor-box {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  margin-bottom: 1.5rem;
  box-shadow: var(--shadow-sm);
}

.editor-box-title {
  font-family: var(--font-heading);
  font-size: 1rem;
  font-weight: 700;
  color: var(--dark);
  margin-bottom: 1rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--border-light);
}

/* Google SERP Snippet Preview Box */
.serp-preview {
  background: #FFFFFF;
  border: 1px solid #DFE1E5;
  border-radius: var(--radius-md);
  padding: 1rem;
  font-family: Arial, sans-serif;
  margin-top: 1rem;
}

.serp-url {
  font-size: 0.8rem;
  color: #202124;
  margin-bottom: 0.25rem;
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

.serp-title {
  font-size: 1.15rem;
  color: #1A0DAB;
  font-weight: 400;
  margin-bottom: 0.25rem;
  line-height: 1.3;
}

.serp-desc {
  font-size: 0.85rem;
  color: #4D5156;
  line-height: 1.4;
}

/* Modal */
.modal-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(18, 24, 38, 0.5);
  backdrop-filter: blur(4px);
  z-index: 1000;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

.modal-card {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 500px;
  box-shadow: var(--shadow-lg);
  overflow: hidden;
  animation: modalPop 0.2s ease-out;
}

@keyframes modalPop {
  from { opacity: 0; transform: scale(0.95); }
  to { opacity: 1; transform: scale(1); }
}

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

.modal-body {
  padding: 1.5rem;
}

.modal-footer {
  padding: 1rem 1.5rem;
  border-top: 1px solid var(--border);
  background: #F8FAFC;
  display: flex;
  justify-content: flex-end;
  gap: 0.75rem;
}

/* Toast Notifications */
.toast-container {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.toast {
  background: var(--dark);
  color: #FFFFFF;
  padding: 0.85rem 1.25rem;
  border-radius: var(--radius-md);
  font-size: 0.875rem;
  font-weight: 500;
  box-shadow: var(--shadow-lg);
  display: flex;
  align-items: center;
  gap: 0.75rem;
  animation: slideIn 0.3s ease;
}

.toast.success { background: #065F46; }
.toast.error { background: #991B1B; }

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