/* ==========================================================================
   MD. ABU TAHER - ADMIN CMS CONTROL PANEL STYLES
   Aesthetic: Dark Obsidian, Brushed Gold, Glassmorphism, Clean Dashboard UI
   ========================================================================== */

:root {
  --admin-bg-base: #06070a;
  --admin-bg-sidebar: #0b0d13;
  --admin-bg-card: rgba(16, 20, 30, 0.85);
  --admin-bg-hover: rgba(26, 32, 48, 0.9);
  --admin-border: rgba(212, 175, 55, 0.15);
  --admin-border-focus: rgba(212, 175, 55, 0.5);

  --gold-primary: #d4af37;
  --gold-light: #f5e4a8;
  --gold-gradient: linear-gradient(135deg, #faebb7 0%, #d4af37 50%, #997517 100%);
  --gold-glow: 0 0 20px rgba(212, 175, 55, 0.25);

  --text-main: #f3f4f6;
  --text-sub: #9ca3af;
  --text-muted: #6b7280;

  --danger: #ef4444;
  --danger-bg: rgba(239, 68, 68, 0.12);
  --success: #10b981;
  --success-bg: rgba(16, 185, 129, 0.12);

  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --radius-full: 9999px;

  --transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  --font-sans: 'Outfit', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-display: 'Cormorant Garamond', Georgia, serif;
}

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

body {
  font-family: var(--font-sans);
  background-color: var(--admin-bg-base);
  color: var(--text-main);
  min-height: 100vh;
  display: flex;
  overflow-x: hidden;
}

/* Auth Overlay Screen */
.auth-overlay {
  position: fixed;
  inset: 0;
  background: radial-gradient(circle at center, #121624 0%, #06070a 100%);
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
}

.auth-overlay.hidden {
  display: none;
}

.auth-card {
  background: var(--admin-bg-card);
  border: 1px solid var(--admin-border);
  border-radius: var(--radius-lg);
  padding: 3rem 2.5rem;
  max-width: 440px;
  width: 100%;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.8), var(--gold-glow);
  text-align: center;
  position: relative;
  backdrop-filter: blur(20px);
}

.auth-symbol {
  width: 60px;
  height: 60px;
  margin: 0 auto 1.5rem auto;
  border-radius: var(--radius-md);
  background: var(--gold-gradient);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'Amiri', serif;
  font-size: 2.2rem;
  font-weight: bold;
  color: #06070a;
  box-shadow: 0 6px 20px rgba(212, 175, 55, 0.35);
}

.auth-title {
  font-family: var(--font-display);
  font-size: 2rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
}

.auth-desc {
  font-size: 0.9rem;
  color: var(--text-sub);
  margin-bottom: 2rem;
}

.auth-input-group {
  margin-bottom: 1.5rem;
  text-align: left;
}

.auth-input-group label {
  display: block;
  font-size: 0.82rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--gold-primary);
  margin-bottom: 0.5rem;
}

.auth-input {
  width: 100%;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--admin-border);
  border-radius: var(--radius-sm);
  padding: 0.85rem 1rem;
  color: var(--text-main);
  font-size: 1rem;
  outline: none;
  transition: var(--transition);
}

.auth-input:focus {
  border-color: var(--gold-primary);
  box-shadow: var(--gold-glow);
  background: rgba(212, 175, 55, 0.04);
}

.auth-btn {
  width: 100%;
  padding: 0.9rem;
  background: var(--gold-gradient);
  color: #06070a;
  font-size: 0.95rem;
  font-weight: 700;
  border: none;
  border-radius: var(--radius-full);
  cursor: pointer;
  transition: var(--transition);
  box-shadow: 0 4px 15px rgba(212, 175, 55, 0.3);
}

.auth-btn:hover {
  filter: brightness(1.1);
  transform: translateY(-2px);
}

.auth-error {
  color: var(--danger);
  font-size: 0.85rem;
  margin-top: 1rem;
  display: none;
}

/* Main CMS Layout */
.cms-layout {
  display: flex;
  width: 100%;
  min-height: 100vh;
}

/* Sidebar */
.cms-sidebar {
  width: 270px;
  background: var(--admin-bg-sidebar);
  border-right: 1px solid var(--admin-border);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0;
  bottom: 0;
  left: 0;
  z-index: 100;
  padding: 1.5rem 1rem;
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.5rem 0.75rem 1.75rem 0.75rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  margin-bottom: 1.5rem;
  text-decoration: none;
  color: var(--text-main);
}

.sidebar-logo {
  width: 38px;
  height: 38px;
  border-radius: var(--radius-sm);
  background: var(--gold-gradient);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'Amiri', serif;
  font-size: 1.5rem;
  font-weight: bold;
  color: #06070a;
}

.sidebar-title {
  font-weight: 700;
  font-size: 1.1rem;
  letter-spacing: 0.5px;
}

.sidebar-subtitle {
  font-size: 0.72rem;
  color: var(--gold-primary);
  text-transform: uppercase;
  letter-spacing: 1px;
}

.nav-menu {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  flex-grow: 1;
  overflow-y: auto;
}

.nav-item-btn {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 0.85rem;
  padding: 0.75rem 1rem;
  border-radius: var(--radius-md);
  border: 1px solid transparent;
  background: transparent;
  color: var(--text-sub);
  font-family: var(--font-sans);
  font-size: 0.92rem;
  font-weight: 500;
  text-align: left;
  cursor: pointer;
  transition: var(--transition);
}

.nav-item-btn:hover {
  background: rgba(255, 255, 255, 0.04);
  color: var(--text-main);
}

.nav-item-btn.active {
  background: rgba(212, 175, 55, 0.12);
  border-color: var(--admin-border);
  color: var(--gold-light);
  font-weight: 600;
}

.nav-icon {
  font-size: 1.15rem;
  width: 22px;
  text-align: center;
}

.badge-count {
  margin-left: auto;
  background: var(--gold-primary);
  color: #06070a;
  font-size: 0.72rem;
  font-weight: 700;
  padding: 0.15rem 0.5rem;
  border-radius: var(--radius-full);
}

.sidebar-footer {
  padding-top: 1rem;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.view-live-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.7rem;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--radius-md);
  color: var(--text-main);
  text-decoration: none;
  font-size: 0.85rem;
  font-weight: 600;
  transition: var(--transition);
}

.view-live-btn:hover {
  background: rgba(212, 175, 55, 0.15);
  border-color: var(--gold-primary);
  color: var(--gold-light);
}

.logout-btn {
  background: transparent;
  border: none;
  color: var(--danger);
  font-size: 0.85rem;
  font-weight: 600;
  padding: 0.6rem;
  cursor: pointer;
  border-radius: var(--radius-sm);
  transition: var(--transition);
}

.logout-btn:hover {
  background: var(--danger-bg);
}

/* Main Content Area */
.cms-main {
  margin-left: 270px;
  flex-grow: 1;
  padding: 2.5rem 3rem;
  min-height: 100vh;
}

.tab-pane {
  display: none;
}

.tab-pane.active {
  display: block;
  animation: fadeInTab 0.3s ease forwards;
}

@keyframes fadeInTab {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

.page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 2.5rem;
  flex-wrap: wrap;
  gap: 1rem;
}

.page-title {
  font-family: var(--font-display);
  font-size: 2.4rem;
  font-weight: 700;
  line-height: 1.1;
}

.page-desc {
  font-size: 0.95rem;
  color: var(--text-sub);
  margin-top: 0.35rem;
}

/* Cards & Widgets */
.dashboard-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1.5rem;
  margin-bottom: 2.5rem;
}

.stat-widget {
  background: var(--admin-bg-card);
  border: 1px solid var(--admin-border);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
}

.stat-label {
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--text-muted);
  margin-bottom: 0.5rem;
}

.stat-number {
  font-family: var(--font-display);
  font-size: 2.2rem;
  font-weight: 700;
  color: var(--gold-primary);
  line-height: 1.1;
}

.stat-sub {
  font-size: 0.8rem;
  color: var(--text-sub);
  margin-top: 0.5rem;
}

/* Action Button */
.btn-gold {
  background: var(--gold-gradient);
  color: #06070a;
  border: none;
  padding: 0.75rem 1.5rem;
  border-radius: var(--radius-full);
  font-weight: 700;
  font-size: 0.9rem;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  transition: var(--transition);
  box-shadow: 0 4px 15px rgba(212, 175, 55, 0.25);
}

.btn-gold:hover {
  filter: brightness(1.1);
  transform: translateY(-2px);
}

.btn-secondary-action {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: var(--text-main);
  padding: 0.75rem 1.4rem;
  border-radius: var(--radius-full);
  font-weight: 600;
  font-size: 0.88rem;
  cursor: pointer;
  transition: var(--transition);
}

.btn-secondary-action:hover {
  border-color: var(--gold-primary);
  color: var(--gold-light);
}

/* Forms & Panels */
.cms-card {
  background: var(--admin-bg-card);
  border: 1px solid var(--admin-border);
  border-radius: var(--radius-lg);
  padding: 2.2rem;
  margin-bottom: 2rem;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4);
}

.card-heading {
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: 0.4rem;
}

.card-subtext {
  font-size: 0.88rem;
  color: var(--text-sub);
  margin-bottom: 1.75rem;
}

.form-grid-2 {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.5rem;
  margin-bottom: 1.5rem;
}

.form-grid-3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
  margin-bottom: 1.5rem;
}

.cms-group {
  display: flex;
  flex-direction: column;
  margin-bottom: 1.25rem;
}

.cms-label {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-main);
  margin-bottom: 0.45rem;
}

.cms-input, .cms-select, .cms-textarea {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: var(--radius-sm);
  padding: 0.8rem 1rem;
  color: var(--text-main);
  font-family: var(--font-sans);
  font-size: 0.95rem;
  outline: none;
  transition: var(--transition);
}

.cms-input:focus, .cms-select:focus, .cms-textarea:focus {
  border-color: var(--gold-primary);
  box-shadow: 0 0 12px rgba(212, 175, 55, 0.2);
  background: rgba(212, 175, 55, 0.02);
}

.cms-select option {
  background: var(--admin-bg-sidebar);
}

/* Tables */
.table-wrap {
  width: 100%;
  overflow-x: auto;
  border-radius: var(--radius-md);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.cms-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 0.9rem;
}

.cms-table th {
  background: rgba(255, 255, 255, 0.04);
  color: var(--text-sub);
  font-weight: 600;
  text-transform: uppercase;
  font-size: 0.75rem;
  letter-spacing: 1px;
  padding: 1rem 1.25rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.cms-table td {
  padding: 1.1rem 1.25rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
  vertical-align: middle;
}

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

.table-thumb {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-sm);
  object-fit: cover;
  border: 1px solid var(--admin-border);
}

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

.btn-edit {
  background: rgba(212, 175, 55, 0.12);
  color: var(--gold-light);
  border: 1px solid var(--admin-border);
  border-radius: var(--radius-sm);
  padding: 0.35rem 0.75rem;
  font-size: 0.78rem;
  cursor: pointer;
  transition: var(--transition);
}

.btn-edit:hover {
  background: var(--gold-primary);
  color: #06070a;
}

.btn-delete {
  background: var(--danger-bg);
  color: var(--danger);
  border: 1px solid rgba(239, 68, 68, 0.3);
  border-radius: var(--radius-sm);
  padding: 0.35rem 0.75rem;
  font-size: 0.78rem;
  cursor: pointer;
  transition: var(--transition);
}

.btn-delete:hover {
  background: var(--danger);
  color: white;
}

/* Modal Form for Adding/Editing */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(6, 7, 10, 0.9);
  backdrop-filter: blur(15px);
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
}

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

.modal-content {
  background: var(--admin-bg-sidebar);
  border: 1px solid var(--admin-border);
  border-radius: var(--radius-lg);
  max-width: 650px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  padding: 2.5rem;
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.9), var(--gold-glow);
  position: relative;
}

.modal-close {
  position: absolute;
  top: 1.25rem;
  right: 1.25rem;
  background: rgba(255, 255, 255, 0.08);
  border: none;
  color: var(--text-main);
  width: 32px;
  height: 32px;
  border-radius: 50%;
  cursor: pointer;
  font-size: 1.2rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

.modal-close:hover {
  background: var(--gold-primary);
  color: #06070a;
}

/* Image preview box */
.preview-box {
  width: 100%;
  height: 180px;
  border: 2px dashed rgba(255, 255, 255, 0.15);
  border-radius: var(--radius-md);
  margin-top: 0.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  position: relative;
  background: rgba(0, 0, 0, 0.3);
}

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

/* Toast Message */
.admin-toast {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  background: var(--admin-bg-card);
  border: 1px solid var(--gold-primary);
  border-radius: var(--radius-md);
  padding: 1rem 1.5rem;
  box-shadow: 0 15px 35px rgba(0, 0, 0, 0.7), var(--gold-glow);
  display: flex;
  align-items: center;
  gap: 0.75rem;
  z-index: 5000;
  transform: translateY(150%);
  transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}

.admin-toast.show {
  transform: translateY(0);
}

@media (max-width: 900px) {
  .cms-sidebar {
    width: 70px;
    padding: 1rem 0.5rem;
  }
  .sidebar-title, .sidebar-subtitle, .nav-item-btn span:not(.nav-icon), .sidebar-footer {
    display: none;
  }
  .cms-main {
    margin-left: 70px;
    padding: 1.5rem;
  }
  .dashboard-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* ==========================================================================
   FAVICON & LOGO LIVE BROWSER TAB SIMULATOR
   ========================================================================== */
.browser-mockup {
  background: #1e1f26;
  border-radius: var(--radius-md);
  border: 1px solid rgba(255, 255, 255, 0.1);
  overflow: hidden;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.6);
  margin-top: 1rem;
}

.browser-header {
  background: #14161f;
  padding: 0.6rem 1rem;
  display: flex;
  align-items: center;
  gap: 1rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.browser-dots {
  display: flex;
  gap: 6px;
}

.browser-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
}
.browser-dot.red { background: #ff5f56; }
.browser-dot.yellow { background: #ffbd2e; }
.browser-dot.green { background: #27c93f; }

.browser-tabs-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex: 1;
}

.browser-tab {
  background: #1e1f26;
  padding: 0.4rem 1rem;
  border-radius: 6px 6px 0 0;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  max-width: 240px;
  font-size: 0.8rem;
  color: var(--text-main);
  border-top: 2px solid var(--gold-primary);
}

.browser-tab img {
  width: 16px;
  height: 16px;
  object-fit: contain;
}

.browser-tab-title {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.browser-url-bar {
  background: #0d0f16;
  padding: 0.35rem 0.85rem;
  border-radius: var(--radius-sm);
  font-size: 0.78rem;
  color: #9ca3af;
  font-family: monospace;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin: 0.4rem 1rem;
}

.browser-url-lock {
  color: #10b981;
}

.browser-canvas-preview {
  background: #07080c;
  padding: 1.5rem;
  min-height: 140px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.live-header-preview {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 1rem 1.5rem;
  background: rgba(12, 15, 23, 0.95);
  border: 1px solid var(--admin-border);
  border-radius: var(--radius-md);
}

.live-header-brand {
  display: flex;
  align-items: center;
  gap: 0.85rem;
}

.live-header-logo-img {
  height: 48px;
  width: auto;
  max-width: 180px;
  object-fit: contain;
  filter: drop-shadow(0 2px 10px rgba(212, 175, 55, 0.4));
}

/* ==========================================================================
   VISITOR ANALYTICS VISUALIZATIONS
   ========================================================================== */
.analytics-metric-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1.25rem;
  margin-bottom: 2rem;
}

.chart-bar-group {
  margin-bottom: 1rem;
}

.chart-bar-header {
  display: flex;
  justify-content: space-between;
  font-size: 0.85rem;
  margin-bottom: 0.35rem;
}

.chart-bar-label {
  color: var(--text-main);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.chart-bar-count {
  color: var(--gold-light);
  font-weight: 600;
}

.chart-bar-track {
  width: 100%;
  height: 10px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 5px;
  overflow: hidden;
}

.chart-bar-fill {
  height: 100%;
  border-radius: 5px;
  transition: width 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

.chart-fill-gold {
  background: linear-gradient(90deg, #d4af37, #f5e4a8);
}

.chart-fill-blue {
  background: linear-gradient(90deg, #3b82f6, #60a5fa);
}

.chart-fill-green {
  background: linear-gradient(90deg, #10b981, #34d399);
}

.chart-fill-purple {
  background: linear-gradient(90deg, #8b5cf6, #a78bfa);
}

/* ==========================================================================
   EMAIL MARKETING SUITE
   ========================================================================== */
.template-cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1.25rem;
  margin-bottom: 1.5rem;
}

.template-card {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--radius-md);
  padding: 1.25rem;
  cursor: pointer;
  transition: var(--transition);
}

.template-card:hover {
  border-color: var(--gold-primary);
  background: rgba(212, 175, 55, 0.05);
}

.template-card.active {
  border-color: var(--gold-primary);
  background: rgba(212, 175, 55, 0.1);
  box-shadow: 0 0 15px rgba(212, 175, 55, 0.2);
}

.template-badge {
  font-size: 0.72rem;
  padding: 0.2rem 0.5rem;
  border-radius: var(--radius-full);
  background: rgba(212, 175, 55, 0.15);
  color: var(--gold-light);
  display: inline-block;
  margin-bottom: 0.5rem;
}

.email-preview-wrapper {
  background: #0b0d13;
  border: 1px solid var(--admin-border);
  border-radius: var(--radius-lg);
  padding: 2rem;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
  max-width: 600px;
  margin: 0 auto;
}

/* Category Manager Chips */
.category-chip-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 0.75rem;
}

.category-chip {
  background: rgba(212, 175, 55, 0.1);
  border: 1px solid var(--gold-primary);
  color: var(--gold-light);
  padding: 0.35rem 0.75rem;
  border-radius: var(--radius-full);
  font-size: 0.85rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.category-chip-del {
  background: none;
  border: none;
  color: var(--danger);
  cursor: pointer;
  font-weight: bold;
  font-size: 0.9rem;
}

