/* ==========================================================================
   FALCON BADMINTON CLUB — BLOG CMS STYLES (css/admin-blog.css)
   Clean, modern, athletic luxury admin interface with Canva-like visual editor
   ========================================================================== */

/* 1. CSS Custom Properties */
:root {
  --admin-red: #c71010;
  --admin-red-hover: #9e0b22;
  --admin-red-light: #fff0f2;
  --admin-red-border: rgba(199, 16, 16, 0.2);
  --admin-dark: #0f0f14;
  --admin-dark-surface: #16161e;
  --admin-dark-card: #1c1c26;
  --admin-dark-border: #2a2a38;
  --admin-white: #ffffff;
  --admin-bg: #f4f6f9;
  --admin-text-main: #0f172a;
  --admin-text-muted: #64748b;
  --admin-border: #e2e8f0;
  --admin-radius-sm: 8px;
  --admin-radius: 14px;
  --admin-radius-lg: 20px;
  --admin-font-heading: 'Montserrat', sans-serif;
  --admin-font-body: 'DM Sans', sans-serif;
  --admin-shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.04);
  --admin-shadow: 0 4px 16px rgba(0, 0, 0, 0.06);
  --admin-shadow-lg: 0 20px 45px rgba(0, 0, 0, 0.15);
}

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

body {
  font-family: var(--admin-font-body);
  background-color: var(--admin-bg) !important;
  color: var(--admin-text-main);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  -webkit-font-smoothing: antialiased;
}

/* 2. Admin Navbar */
.admin-navbar {
  background: #111114;
  color: #ffffff;
  padding: 10px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid #22222a;
  position: sticky;
  top: 0;
  z-index: 1000;
  box-shadow: 0 4px 15px rgba(0,0,0,0.25);
  gap: 16px;
}

.admin-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: #ffffff;
  flex-shrink: 0;
}

.admin-brand-text h1 {
  font-family: var(--admin-font-heading);
  font-size: 0.98rem;
  font-weight: 900;
  letter-spacing: 0.5px;
  margin: 0;
  line-height: 1.1;
  color: #ffffff;
}

.admin-nav-tabs {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  flex: 1;
  flex-wrap: nowrap;
}

.nav-tab-link {
  background: #1c1c24;
  color: #94a3b8;
  padding: 5px 9px;
  font-size: 0.72rem;
  font-weight: 700;
  border-radius: 6px;
  text-decoration: none;
  transition: all 0.2s ease;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  border: 1px solid #2a2a36;
  white-space: nowrap;
}

.nav-tab-link:hover {
  background: #282834;
  color: #ffffff;
  border-color: #3b3b4a;
}

.nav-tab-link.active {
  background: var(--admin-red);
  color: #ffffff;
  border-color: var(--admin-red);
  box-shadow: 0 2px 8px rgba(199, 16, 16, 0.4);
  font-weight: 800;
}

.admin-nav-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

/* Button Variants */
.btn-admin {
  font-family: var(--admin-font-heading);
  font-weight: 800;
  font-size: 0.82rem;
  padding: 8px 16px;
  border-radius: 8px;
  border: 1px solid transparent;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  text-decoration: none;
  transition: all 0.2s ease;
  white-space: nowrap;
}

.btn-admin-primary {
  background: var(--admin-red);
  color: #ffffff;
  border-color: var(--admin-red);
  box-shadow: 0 4px 12px rgba(199, 16, 16, 0.25);
}

.btn-admin-primary:hover {
  background: var(--admin-red-hover);
  border-color: var(--admin-red-hover);
  transform: translateY(-1px);
}

.btn-admin-secondary {
  background: #ffffff;
  color: var(--admin-text-main);
  border-color: var(--admin-border);
}

.btn-admin-secondary:hover {
  background: #f8fafc;
  border-color: #cbd5e1;
}

.btn-admin-dark {
  background: #22222c;
  color: #ffffff;
  border-color: #333342;
}

.btn-admin-dark:hover {
  background: #2c2c3a;
}

.btn-admin-danger {
  background: #fef2f2;
  color: #b91c1c;
  border-color: #fecaca;
}

.btn-admin-danger:hover {
  background: #fee2e2;
}

.btn-sm {
  padding: 5px 10px;
  font-size: 0.74rem;
  border-radius: 6px;
}

/* 3. Main Dashboard Layout */
.nontech-container {
  max-width: 1280px;
  margin: 0 auto;
  padding: 24px 20px 80px;
  width: 100%;
}

.nontech-header-card {
  background: #ffffff;
  border: 1px solid var(--admin-border);
  border-radius: var(--admin-radius);
  padding: 24px 28px;
  margin-bottom: 24px;
  box-shadow: var(--admin-shadow-sm);
}

/* Stats Summary Row */
.cms-stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 14px;
  margin-bottom: 20px;
}

.cms-stat-card {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  padding: 14px 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.cms-stat-label {
  font-size: 0.75rem;
  font-weight: 700;
  color: #64748b;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.cms-stat-value {
  font-family: var(--admin-font-heading);
  font-size: 1.4rem;
  font-weight: 900;
  color: #0f172a;
}

/* Filter Controls Bar */
.filters-bar {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: center;
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid #f1f5f9;
}

.filters-bar input, .filters-bar select {
  padding: 8px 12px;
  border: 1.5px solid #cbd5e1;
  border-radius: 8px;
  font-size: 0.84rem;
  font-family: var(--admin-font-body);
  outline: none;
  background: #ffffff;
  color: #0f172a;
  transition: border-color 0.2s;
}

.filters-bar input:focus, .filters-bar select:focus {
  border-color: var(--admin-red);
}

/* Article Cards Grid */
.programs-list-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 20px;
}

.cms-card {
  background: #ffffff;
  border: 1px solid var(--admin-border);
  border-radius: 14px;
  overflow: hidden;
  box-shadow: var(--admin-shadow-sm);
  display: flex;
  flex-direction: column;
  transition: transform 0.2s, box-shadow 0.2s, border-color 0.2s;
}

.cms-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--admin-shadow);
  border-color: #cbd5e1;
}

.cms-card-photo-wrap {
  height: 140px;
  position: relative;
  background: #000;
  overflow: hidden;
}

.cms-status-pill {
  font-family: var(--admin-font-heading);
  font-size: 0.68rem;
  font-weight: 900;
  padding: 3px 8px;
  border-radius: 6px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.cms-status-pill.published {
  background: #10b981;
  color: #ffffff;
}

.cms-status-pill.draft {
  background: #f59e0b;
  color: #ffffff;
}

.cms-section-tag {
  font-size: 0.68rem;
  font-weight: 800;
  padding: 2px 6px;
  border-radius: 4px;
  background: #f1f5f9;
  color: #475569;
  display: inline-block;
}

/* 4. Fullscreen 2-Step Visual Editor Modal */
.editor-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.75);
  backdrop-filter: blur(6px);
  z-index: 2000;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

.nontech-modal-window {
  background: #ffffff;
  width: 100%;
  max-width: 1440px;
  height: 96vh;
  max-height: 960px;
  border-radius: 18px;
  box-shadow: 0 25px 65px rgba(0, 0, 0, 0.35);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.nontech-modal-header {
  padding: 14px 24px;
  border-bottom: 1px solid var(--admin-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #ffffff;
}

/* Step Switcher Tabs */
.editor-step-tabs {
  display: flex;
  border-bottom: 1px solid var(--admin-border);
  background: #f8fafc;
}

.step-tab {
  flex: 1;
  padding: 14px 20px;
  text-align: center;
  background: none;
  border: none;
  border-bottom: 3px solid transparent;
  font-family: var(--admin-font-heading);
  font-weight: 800;
  font-size: 0.9rem;
  color: #64748b;
  cursor: pointer;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.step-tab:hover {
  color: #0f172a;
  background: #f1f5f9;
}

.step-tab.active {
  color: var(--admin-red);
  border-bottom-color: var(--admin-red);
  background: #ffffff;
}

.step-number {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: #e2e8f0;
  color: #475569;
  font-size: 0.72rem;
  font-weight: 900;
}

.step-tab.active .step-number {
  background: var(--admin-red);
  color: #ffffff;
}

/* Split Pane: Left Editor Form & Right Preview */
.editor-body {
  display: grid;
  grid-template-columns: 1.15fr 1fr;
  flex: 1;
  overflow: hidden;
}

.editor-form-scroll {
  padding: 24px 28px;
  overflow-y: auto;
  background: #ffffff;
  border-right: 1px solid var(--admin-border);
}

.editor-preview-pane {
  padding: 18px 20px;
  background: #f1f5f9;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  overflow-y: auto;
  position: relative;
}

.editor-footer {
  padding: 12px 24px;
  border-top: 1px solid var(--admin-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #ffffff;
}

/* Form Controls & Styling */
.form-section {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  padding: 16px 20px;
  margin-bottom: 20px;
}

.form-section-title {
  font-family: var(--admin-font-heading);
  font-size: 0.92rem;
  font-weight: 800;
  color: #0f172a;
  margin: 0 0 14px 0;
  padding-bottom: 8px;
  border-bottom: 1px solid #e2e8f0;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.nontech-label {
  font-size: 0.78rem;
  font-weight: 800;
  color: #334155;
  margin-bottom: 5px;
  display: block;
}

.nontech-input, .nontech-select, .nontech-textarea {
  width: 100%;
  padding: 9px 12px;
  border: 1.5px solid #cbd5e1;
  border-radius: 8px;
  font-family: var(--admin-font-body);
  font-size: 0.88rem;
  color: #0f172a;
  background: #ffffff;
  outline: none;
  transition: all 0.2s ease;
  box-sizing: border-box;
}

.nontech-input:focus, .nontech-select:focus, .nontech-textarea:focus {
  border-color: var(--admin-red);
  box-shadow: 0 0 0 3px rgba(199, 16, 16, 0.15);
}

.nontech-textarea {
  resize: vertical;
  min-height: 75px;
}

/* Flash animation when focused via right click */
.form-control-highlighted {
  border-color: var(--admin-red) !important;
  background: #fff5f5 !important;
  box-shadow: 0 0 0 4px rgba(199, 16, 16, 0.25) !important;
  animation: flashHighlight 1.5s ease-out;
}

@keyframes flashHighlight {
  0% { transform: scale(1.02); }
  50% { transform: scale(1); }
  100% { transform: scale(1); }
}

/* ══════════════════════════════════════════════════════════
   5. STEP 2 DIRECT VISUAL CANVAS EDITOR STYLES (MEDIUM/CANVA-STYLE)
   ══════════════════════════════════════════════════════════ */

.visual-editor-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #ffffff;
  border: 1px solid var(--admin-border);
  border-radius: 12px;
  padding: 10px 14px;
  margin-bottom: 20px;
  box-shadow: var(--admin-shadow-sm);
  position: sticky;
  top: 0;
  z-index: 100;
}

.visual-canvas-doc {
  background: #ffffff;
  border: 1.5px solid #e2e8f0;
  border-radius: 18px;
  padding: 32px 36px;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.04);
  position: relative;
  transition: border-color 0.2s;
}

.visual-editable-field {
  outline: none;
  border-radius: 6px;
  transition: all 0.15s ease;
  position: relative;
}

.visual-editable-field:hover {
  background: rgba(199, 16, 16, 0.03);
  box-shadow: 0 0 0 2px rgba(199, 16, 16, 0.25);
  cursor: text;
}

.visual-editable-field:focus {
  background: #ffffff;
  box-shadow: 0 0 0 2.5px var(--admin-red) !important;
  cursor: text;
}

/* Visual Block in Editor Canvas */
.visual-canvas-block {
  position: relative;
  border-radius: 10px;
  margin-bottom: 20px;
  transition: all 0.2s ease;
  padding: 8px 10px;
  border: 1.5px dashed transparent;
}

.visual-canvas-block:hover {
  border-color: #cbd5e1;
  background: #fafafa;
}

.visual-canvas-block:focus-within {
  border-color: var(--admin-red);
  background: #ffffff;
  box-shadow: 0 4px 15px rgba(199, 16, 16, 0.06);
}

/* Floating Action Toolbar on Each Block */
.visual-block-toolbar {
  position: absolute;
  top: -14px;
  right: 12px;
  background: #111114;
  color: #ffffff;
  border-radius: 20px;
  padding: 2px 8px;
  display: none;
  align-items: center;
  gap: 4px;
  font-family: var(--admin-font-heading);
  font-size: 0.7rem;
  font-weight: 800;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
  z-index: 50;
}

.visual-canvas-block:hover .visual-block-toolbar,
.visual-canvas-block:focus-within .visual-block-toolbar {
  display: flex;
}

.visual-block-btn {
  background: none;
  border: none;
  color: #94a3b8;
  cursor: pointer;
  padding: 2px 6px;
  font-size: 0.72rem;
  border-radius: 4px;
  transition: all 0.15s;
}

.visual-block-btn:hover {
  color: #ffffff;
  background: #272732;
}

.visual-block-btn.danger:hover {
  color: #ff6b81;
  background: rgba(199, 16, 16, 0.4);
}

/* Inline Add Block Divider Button */
.visual-add-divider {
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 12px 0;
  position: relative;
  opacity: 0.35;
  transition: opacity 0.2s;
}

.visual-add-divider:hover {
  opacity: 1;
}

.visual-add-divider::before {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  height: 1px;
  background: #e2e8f0;
  z-index: 1;
}

.visual-add-btn {
  position: relative;
  z-index: 2;
  background: #ffffff;
  border: 1px solid #cbd5e1;
  color: #475569;
  font-size: 0.74rem;
  font-weight: 800;
  padding: 3px 12px;
  border-radius: 100px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 4px;
  transition: all 0.2s;
}

.visual-add-btn:hover {
  background: var(--admin-red);
  color: #ffffff;
  border-color: var(--admin-red);
  transform: scale(1.04);
}

/* Banner image hover controls */
.visual-cover-wrap {
  position: relative;
  border-radius: 16px;
  overflow: hidden;
  margin-bottom: 32px;
  max-height: 380px;
  background: #000;
}

.visual-cover-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
  display: none;
  align-items: center;
  justify-content: center;
  gap: 10px;
  backdrop-filter: blur(2px);
}

.visual-cover-wrap:hover .visual-cover-overlay {
  display: flex;
}

/* 6. Canva-like Click-to-Edit Styles in Preview Pane */
[data-cms-field], [data-cms-block] {
  transition: outline 0.15s ease, background-color 0.15s ease;
  border-radius: 4px;
}

.cms-editable-highlight {
  outline: 2px dashed rgba(199, 16, 16, 0.5) !important;
  outline-offset: 3px !important;
  cursor: pointer !important;
  background-color: rgba(199, 16, 16, 0.03) !important;
}

.cms-editable-selected {
  outline: 2.5px solid var(--admin-red) !important;
  outline-offset: 3px !important;
  background-color: rgba(199, 16, 16, 0.05) !important;
}

/* 7. Image Cropper Modal */
.crop-preview-box {
  width: 100%;
  height: 320px;
  background: #09090b;
  border-radius: 10px;
  overflow: hidden;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}

.crop-preview-img {
  max-width: 100%;
  max-height: 100%;
  object-fit: cover;
  transition: transform 0.1s ease, object-position 0.1s ease;
  user-select: none;
}

.crop-crosshair {
  position: absolute;
  pointer-events: none;
  inset: 0;
  border: 2px dashed rgba(255, 255, 255, 0.6);
  display: flex;
  align-items: center;
  justify-content: center;
}

.crop-crosshair::before, .crop-crosshair::after {
  content: '';
  position: absolute;
  background: rgba(255, 255, 255, 0.8);
}

.crop-crosshair::before { width: 1px; height: 100%; }
.crop-crosshair::after { height: 1px; width: 100%; }

/* 8. Toast Banner */
.admin-toast {
  position: fixed;
  bottom: 24px;
  right: 24px;
  background: #0f172a;
  color: #ffffff;
  padding: 12px 20px;
  border-radius: 10px;
  font-family: var(--admin-font-heading);
  font-weight: 800;
  font-size: 0.85rem;
  display: none;
  align-items: center;
  gap: 10px;
  z-index: 5000;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.25);
  border-left: 4px solid var(--admin-red);
}

/* 9. Responsive Adjustments */
@media (max-width: 992px) {
  .editor-body {
    grid-template-columns: 1fr;
  }
  .editor-form-scroll {
    border-right: none;
    border-bottom: 1px solid var(--admin-border);
  }
  .admin-nav-tabs {
    display: none;
  }
}
