/* ==========================================================================
   FALCON BADMINTON CLUB — EVENTS CMS STYLES (css/admin-events.css)
   Clean, modern, athletic luxury admin interface with 2-Step visual editor
   and Canva-like click-to-edit website live preview.
   ========================================================================== */

/* 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: 1320px;
  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 Strip */
.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);
}

/* Events List Grid */
.events-list-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(330px, 1fr));
  gap: 22px;
}

.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: 155px;
  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;
}

.cms-target-pill {
  font-size: 0.7rem;
  font-weight: 800;
  color: var(--admin-red);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

/* Highlighted Member Price Pill (Court Booking Style Green Gradient) */
.event-member-price-pill {
  background: linear-gradient(135deg, #10B981 0%, #047857 100%) !important;
  color: #FFFFFF !important;
  padding: 11px 16px;
  border-radius: 12px;
  font-size: 0.84rem;
  font-weight: 900;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  box-shadow: 0 4px 14px rgba(16, 185, 129, 0.4);
  border: 1.5px solid rgba(255, 255, 255, 0.35);
  letter-spacing: 0.03em;
  white-space: nowrap;
  width: 100%;
  text-transform: uppercase;
  box-sizing: border-box;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.event-member-price-pill:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 18px rgba(16, 185, 129, 0.5);
}

.event-member-price-pill svg {
  width: 15px;
  height: 15px;
  stroke-width: 2.5;
  stroke: #ffffff;
}

/* Primary Action Ticket Button (Red Pill with Shine Effect) */
.ticket-action-btn {
  background: var(--admin-red, #c71010) !important;
  color: #FFFFFF !important;
  border: 1.5px solid transparent;
  padding: 0 20px;
  height: 48px;
  box-sizing: border-box;
  border-radius: 100px;
  font-family: var(--admin-font-heading, 'Montserrat', sans-serif);
  font-weight: 900;
  font-size: 0.85rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: background-color 0.3s ease, box-shadow 0.3s ease, transform 0.2s ease;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  width: 100%;
  box-shadow: 0 4px 14px rgba(199, 16, 16, 0.25);
  position: relative;
  overflow: hidden;
  text-decoration: none;
}

.ticket-action-btn:hover {
  background: var(--admin-red-hover, #9e0b22) !important;
  box-shadow: 0 6px 20px rgba(199, 16, 16, 0.4);
  transform: translateY(-1px);
}

.ticket-action-btn::after {
  content: '';
  position: absolute;
  top: -50%;
  left: -150%;
  width: 65%;
  height: 200%;
  background: linear-gradient(
    120deg,
    rgba(255, 255, 255, 0) 0%,
    rgba(255, 255, 255, 0.55) 50%,
    rgba(255, 255, 255, 0) 100%
  );
  transform: rotate(25deg);
  animation: ticketShineSweep 3.2s infinite ease-in-out;
}

@keyframes ticketShineSweep {
  0% { left: -150%; }
  45% { left: 180%; }
  100% { left: 180%; }
}

/* 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: 1480px;
  height: 96vh;
  max-height: 980px;
  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: 12px 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: 13px 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.88rem;
  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.1fr 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: 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;
}

/* Preview Header Controls */
.preview-controls-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  margin-bottom: 14px;
  padding: 6px 12px;
  background: #ffffff;
  border-radius: 10px;
  border: 1px solid #e2e8f0;
  box-shadow: 0 1px 4px rgba(0,0,0,0.03);
}

.preview-target-wrapper {
  width: 100%;
  display: flex;
  justify-content: center;
  align-items: flex-start;
}

/* 5. 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;
}

.form-row-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  margin-bottom: 12px;
}

.form-row-3 {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 12px;
  margin-bottom: 12px;
}

/* 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 EVENT CANVAS STYLES
   ══════════════════════════════════════════════════════════ */

.visual-canvas-doc {
  background: #ffffff;
  border: 1.5px solid #e2e8f0;
  border-radius: 18px;
  padding: 24px;
  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.04);
  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-cover-wrap {
  position: relative;
  border-radius: 16px;
  overflow: hidden;
  margin-bottom: 24px;
  background: #000;
}

.visual-cover-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  backdrop-filter: blur(2px);
  opacity: 0;
  transition: opacity 0.2s ease;
}

.visual-cover-wrap:hover .visual-cover-overlay {
  opacity: 1;
}

.visual-canvas-block {
  position: relative;
  border-radius: 10px;
  margin-bottom: 20px;
  transition: all 0.2s ease;
}

.visual-canvas-block:hover {
  border-color: #94a3b8 !important;
  background: #fafbfc !important;
}

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

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

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

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

.cms-element-badge {
  position: absolute;
  top: -18px;
  left: 0;
  background: var(--admin-red);
  color: #ffffff;
  font-family: var(--admin-font-heading);
  font-size: 0.64rem;
  font-weight: 900;
  padding: 2px 6px;
  border-radius: 4px;
  pointer-events: none;
  z-index: 1000;
  box-shadow: 0 2px 6px rgba(0,0,0,0.2);
}

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

.crop-preview-box:active {
  cursor: grabbing;
}

.crop-preview-img {
  max-width: 100%;
  max-height: 100%;
  object-fit: cover;
  transition: transform 0.05s linear;
}

.crop-focal-point {
  position: absolute;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 2px solid #ffffff;
  background: rgba(199, 16, 16, 0.6);
  box-shadow: 0 0 0 2px rgba(0,0,0,0.4), 0 0 12px rgba(199, 16, 16, 0.8);
  transform: translate(-50%, -50%);
  pointer-events: none;
  z-index: 10;
}

.crop-grid-lines {
  position: absolute;
  inset: 0;
  pointer-events: none;
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  grid-template-rows: 1fr 1fr 1fr;
  border: 1px solid rgba(255, 255, 255, 0.25);
}

.crop-grid-cell {
  border: 1px dashed rgba(255, 255, 255, 0.15);
}

/* 8. Full Event Step 2 Reader Preview Styling */
.event-preview-full-doc {
  background: #ffffff;
  border-radius: 18px;
  border: 1px solid #e2e8f0;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.06);
  overflow: hidden;
  width: 100%;
}

.event-preview-hero {
  position: relative;
  height: 240px;
  background: #111114;
  overflow: hidden;
}

.event-preview-hero-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0.85;
}

.event-preview-hero-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(0,0,0,0.1) 0%, rgba(17,17,20,0.9) 100%);
  padding: 24px;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  color: #ffffff;
}

.event-preview-content-body {
  padding: 28px;
}

.event-preview-details-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 12px;
  padding: 16px;
  background: #f8fafc;
  border-radius: 12px;
  border: 1px solid #e2e8f0;
  margin: 20px 0;
}

.event-preview-detail-item {
  font-size: 0.8rem;
}

.event-preview-detail-label {
  font-size: 0.7rem;
  font-weight: 800;
  color: #64748b;
  text-transform: uppercase;
}

.event-preview-detail-val {
  font-weight: 800;
  color: #0f172a;
}

/* 9. Dynamic Item Repeaters (Highlights, Schedule, FAQs) */
.repeater-item-card {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 12px 14px;
  margin-bottom: 10px;
  display: flex;
  gap: 10px;
  align-items: flex-start;
}

.repeater-item-content {
  flex: 1;
}

.repeater-del-btn {
  background: none;
  border: none;
  color: #ef4444;
  cursor: pointer;
  padding: 4px;
  border-radius: 4px;
  transition: background 0.15s;
}

.repeater-del-btn:hover {
  background: #fee2e2;
}

/* 10. AI Modals */
.ai-modal-box {
  background: #ffffff;
  border-radius: 16px;
  max-width: 780px;
  width: 95%;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 25px 60px rgba(0,0,0,0.3);
}

.ai-preview-container {
  background: #f8fafc;
  border: 1.5px dashed #cbd5e1;
  border-radius: 12px;
  padding: 18px;
  margin-top: 16px;
}

/* 11. Toast Notifications */
.cms-toast {
  position: fixed;
  bottom: 24px;
  right: 24px;
  background: #111114;
  color: #ffffff;
  padding: 12px 20px;
  border-radius: 10px;
  font-family: var(--admin-font-heading);
  font-size: 0.85rem;
  font-weight: 800;
  box-shadow: 0 10px 30px rgba(0,0,0,0.35);
  display: flex;
  align-items: center;
  gap: 10px;
  z-index: 9999;
  border-left: 4px solid var(--admin-red);
  transform: translateY(100px);
  opacity: 0;
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.cms-toast.show {
  transform: translateY(0);
  opacity: 1;
}
