/**
 * IN-APP POPUPS STYLES
 * ====================
 * Uses design tokens from design-tokens.css
 * Green primary (#10b981), warm grays, Inter font
 */

/* ========================================
   POPUP OVERLAY & CONTAINER
   ======================================== */

.in-app-popup-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  padding: 16px;
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}

.in-app-popup-overlay.position-top {
  align-items: flex-start;
  padding-top: 5vh;
}

.in-app-popup-overlay.position-bottom {
  align-items: flex-end;
  padding-bottom: 5vh;
}

.in-app-popup-container {
  position: relative;
  max-width: 90vw;
  max-height: 85vh;
  overflow: hidden;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', sans-serif;
}

/* ========================================
   ANIMATIONS
   ======================================== */

/* Fade */
.in-app-popup-overlay.animation-fade {
  animation: popupFadeIn 0.3s ease-out;
}

.in-app-popup-overlay.animation-fade .in-app-popup-container {
  animation: popupScaleIn 0.3s ease-out;
}

@keyframes popupFadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

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

/* Slide Up */
.in-app-popup-overlay.animation-slide-up .in-app-popup-container {
  animation: popupSlideUp 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

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

/* Slide Down */
.in-app-popup-overlay.animation-slide-down .in-app-popup-container {
  animation: popupSlideDown 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes popupSlideDown {
  from {
    opacity: 0;
    transform: translateY(-40px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Scale (Bounce) */
.in-app-popup-overlay.animation-scale .in-app-popup-container {
  animation: popupBounce 0.5s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

@keyframes popupBounce {
  0% {
    opacity: 0;
    transform: scale(0.3);
  }
  50% {
    transform: scale(1.05);
  }
  100% {
    opacity: 1;
    transform: scale(1);
  }
}

/* Closing animation */
.in-app-popup-overlay.popup-closing {
  animation: popupFadeOut 0.25s ease-in forwards;
}

.in-app-popup-overlay.popup-closing .in-app-popup-container {
  animation: popupScaleOut 0.25s ease-in forwards;
}

@keyframes popupFadeOut {
  to { opacity: 0; }
}

@keyframes popupScaleOut {
  to {
    opacity: 0;
    transform: scale(0.95);
  }
}

/* ========================================
   POPUP CONTENT STRUCTURE
   ======================================== */

.popup-background {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
}

.popup-content {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
}

.popup-title {
  margin: 0;
  line-height: 1.3;
  word-wrap: break-word;
}

.popup-title.size-small { font-size: 1rem; }
.popup-title.size-medium { font-size: 1.25rem; }
.popup-title.size-large { font-size: 1.5rem; }
.popup-title.size-xlarge { font-size: 1.875rem; }

.popup-title.weight-normal { font-weight: 400; }
.popup-title.weight-medium { font-weight: 500; }
.popup-title.weight-semibold { font-weight: 600; }
.popup-title.weight-bold { font-weight: 700; }

.popup-body {
  margin: 0;
  line-height: 1.6;
  word-wrap: break-word;
}

.popup-body.size-small { font-size: 0.875rem; }
.popup-body.size-medium { font-size: 1rem; }
.popup-body.size-large { font-size: 1.125rem; }

.popup-title.align-left,
.popup-body.align-left { text-align: left; }

.popup-title.align-center,
.popup-body.align-center { text-align: center; }

.popup-title.align-right,
.popup-body.align-right { text-align: right; }

/* ========================================
   CTA BUTTON
   ======================================== */

.popup-cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 12px 24px;
  font-family: inherit;
  font-weight: 600;
  cursor: pointer;
  border: none;
  transition: transform 0.2s ease, box-shadow 0.2s ease, opacity 0.2s ease;
  text-decoration: none;
  margin-top: 8px;
}

.popup-cta:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.popup-cta:active {
  transform: translateY(0);
}

.popup-cta.size-small {
  padding: 8px 16px;
  font-size: 0.875rem;
}

.popup-cta.size-medium {
  padding: 12px 24px;
  font-size: 1rem;
}

.popup-cta.size-large {
  padding: 14px 32px;
  font-size: 1.125rem;
}

.popup-cta.full-width {
  width: 100%;
}

/* ========================================
   DISMISS BUTTON
   ======================================== */

.popup-dismiss {
  position: absolute;
  width: 32px;
  height: 32px;
  border-radius: 8px;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background-color 0.2s ease, transform 0.2s ease;
  z-index: 10;
  padding: 0;
}

.popup-dismiss.position-top-right {
  top: 12px;
  right: 12px;
}

.popup-dismiss.position-top-left {
  top: 12px;
  left: 12px;
}

.popup-dismiss:hover {
  transform: scale(1.1);
}

.popup-dismiss svg {
  width: 16px;
  height: 16px;
  stroke: currentColor;
  stroke-width: 2;
  fill: none;
}

/* ========================================
   DASHBOARD STYLES - TAB 13
   ======================================== */

.in-app-popups-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
  margin-bottom: 24px;
}

.in-app-popups-header h2 {
  font-size: 1.5rem;
  font-weight: 700;
  color: #1c1917; /* Explicit light mode color - prevents OS dark mode override */
  margin: 0;
  display: flex;
  align-items: center;
  gap: 12px;
}

.pro-badge {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  background: linear-gradient(135deg, var(--primary-500), var(--primary-600));
  color: white;
  font-size: 0.75rem;
  font-weight: 600;
  border-radius: 8px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.feature-toggle-container {
  display: flex;
  align-items: center;
  gap: 12px;
}

.feature-toggle-label {
  font-size: 0.875rem;
  font-weight: 500;
  color: #44403c; /* Explicit light mode color - prevents OS dark mode override */
}

/* Popup List Table */
.popups-table-container {
  background: #ffffff; /* Explicit white for light mode */
  border-radius: 8px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
  overflow: hidden;
  margin-bottom: 24px;
}

.popups-table {
  width: 100%;
  border-collapse: collapse;
}

.popups-table th {
  background: #fafaf9; /* Explicit light mode - gray-50 */
  padding: 12px 16px;
  text-align: left;
  font-size: 0.75rem;
  font-weight: 600;
  color: #57534e; /* Explicit light mode color - prevents OS dark mode override */
  text-transform: uppercase;
  letter-spacing: 0.5px;
  border-bottom: 1px solid #e7e5e4; /* Explicit light mode - gray-200 */
}

.popups-table td {
  padding: 16px;
  border-bottom: 1px solid #f5f5f4; /* Explicit light mode - gray-100 */
  font-size: 0.875rem;
  color: #292524; /* Explicit light mode color - prevents OS dark mode override */
}

.popups-table tr:last-child td {
  border-bottom: none;
}

.popups-table tr:hover td {
  background: #fafaf9; /* Explicit light mode hover - prevents OS dark mode override */
}

.popup-name-cell {
  font-weight: 600;
  color: #1c1917; /* Explicit light mode color - prevents OS dark mode override */
}

.popup-holes-cell {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

.hole-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 28px;
  height: 24px;
  padding: 0 8px;
  background: var(--primary-100);
  color: var(--primary-700);
  font-size: 0.75rem;
  font-weight: 600;
  border-radius: 8px;
}

.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 8px;
  font-size: 0.75rem;
  font-weight: 500;
}

.status-badge.active {
  background: #f0fdf4; /* Explicit light mode - success-50/green-50 */
  color: #047857; /* Explicit light mode - success-700/green-700 */
}

.status-badge.inactive {
  background: #f5f5f4; /* Explicit light mode - gray-100 */
  color: #57534e; /* Explicit light mode - gray-600 */
}

.status-dot {
  width: 6px;
  height: 6px;
  border-radius: 8px;
}

.status-badge.active .status-dot {
  background: #10b981; /* Explicit light mode - success-500/green-500 */
}

.status-badge.inactive .status-dot {
  background: #a8a29e; /* Explicit light mode - gray-400 */
}

.analytics-cell {
  font-weight: 500;
  color: #44403c; /* Explicit light mode color - prevents OS dark mode override */
}

.ctr-value {
  color: var(--primary-600);
  font-weight: 600;
}

.action-buttons {
  display: flex;
  gap: 8px;
}

.action-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 8px;
  border: none;
  cursor: pointer;
  transition: background-color 0.2s, transform 0.2s;
}

.action-btn.edit {
  background: #eff6ff; /* Explicit light mode - blue-50 */
  color: #2563eb; /* Explicit light mode - blue-600 */
}

.action-btn.edit:hover {
  background: #dbeafe; /* Explicit light mode - blue-100 */
}

.action-btn.delete {
  background: #fef2f2; /* Explicit light mode - red-50 */
  color: #dc2626; /* Explicit light mode - red-600 */
}

.action-btn.delete:hover {
  background: #fee2e2; /* Explicit light mode - red-100 */
}

.action-btn svg {
  width: 16px;
  height: 16px;
}

/* Empty State */
.popups-empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 48px 24px;
  text-align: center;
}

.popups-empty-state svg {
  width: 64px;
  height: 64px;
  color: #d6d3d1; /* Explicit light mode - gray-300 */
  margin-bottom: 16px;
}

.popups-empty-state h3 {
  font-size: 1.125rem;
  font-weight: 600;
  color: #292524; /* Explicit light mode color - prevents OS dark mode override */
  margin: 0 0 8px 0;
}

.popups-empty-state p {
  font-size: 0.875rem;
  color: #78716c; /* Explicit light mode color - prevents OS dark mode override */
  margin: 0;
  max-width: 300px;
}

/* Create Button */
.create-popup-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 20px;
  background: var(--primary-500);
  color: white;
  font-size: 0.875rem;
  font-weight: 600;
  border-radius: 8px;
  border: none;
  cursor: pointer;
  transition: background-color 0.2s, transform 0.2s;
}

.create-popup-btn:hover {
  background: var(--primary-600);
  transform: translateY(-1px);
}

.create-popup-btn svg {
  width: 18px;
  height: 18px;
}

/* ========================================
   MODAL STYLES
   ======================================== */

.popup-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9990;
  padding: 16px;
  backdrop-filter: blur(4px);
}

.popup-modal {
  background: #ffffff;
  border-radius: 8px;
  width: 100%;
  max-width: 1200px;
  max-height: 90vh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
}

.popup-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 24px;
  border-bottom: 1px solid #e7e5e4;
  background: #ffffff;
}

.popup-modal-header h3 {
  font-size: 1.25rem;
  font-weight: 700;
  color: #1c1917;
  margin: 0;
}

.popup-modal-close {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  border: none;
  background: #f5f5f4;
  color: #57534e;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background-color 0.2s;
}

.popup-modal-close:hover {
  background: #e7e5e4;
}

.popup-modal-body {
  display: grid;
  grid-template-columns: 1fr 400px;
  overflow: hidden;
  flex: 1;
}

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

  .popup-preview-panel {
    display: none;
  }
}

.popup-form-panel {
  padding: 24px;
  overflow-y: auto;
  max-height: calc(90vh - 140px);
  background: #ffffff;
}

.popup-preview-panel {
  background: #f5f5f4;
  padding: 24px;
  display: flex;
  flex-direction: column;
  align-items: center;
  border-left: 1px solid #e7e5e4;
}

.preview-label {
  font-size: 0.75rem;
  font-weight: 600;
  color: #57534e;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 16px;
}

.phone-mockup {
  width: 280px;
  height: 560px;
  background: #1c1917; /* Explicit dark - phone frame should always be dark */
  border-radius: 8px;
  padding: 12px;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.2);
}

.phone-screen {
  width: 100%;
  height: 100%;
  background: #292524; /* Explicit dark - phone screen should always be dark */
  border-radius: 8px;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

.preview-popup {
  width: 90%;
  max-width: 240px;
  transform: scale(0.85);
}

/* Preview popup background is controlled by JavaScript - DO NOT OVERRIDE */
#preview-popup[style] {
  /* This selector has high specificity to prevent CSS overrides */
}

/* Form Sections */
.form-section {
  margin-bottom: 24px;
}

.form-section-title {
  font-size: 0.875rem;
  font-weight: 600;
  color: #292524;
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.form-section-title svg {
  width: 16px;
  height: 16px;
  color: #78716c;
}

.form-group {
  margin-bottom: 16px;
}

.form-label {
  display: block;
  font-size: 0.8125rem;
  font-weight: 500;
  color: #44403c;
  margin-bottom: 6px;
}

.form-input,
.form-select,
.form-textarea {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid #d6d3d1;
  border-radius: 6px;
  font-size: 0.875rem;
  font-family: inherit;
  color: #1c1917;
  background: #ffffff;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
  outline: none;
  border-color: #10b981;
  box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.1);
}

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

/* Hole Selection Grid */
.hole-selection-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(50px, 1fr));
  gap: 8px;
}

.hole-checkbox {
  display: none;
}

.hole-checkbox-label {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 40px;
  background: #f5f5f4;
  border: 2px solid transparent;
  border-radius: 8px;
  font-size: 0.875rem;
  font-weight: 600;
  color: #57534e;
  cursor: pointer;
  transition: all 0.2s;
}

.hole-checkbox-label:hover {
  background: #e7e5e4;
}

.hole-checkbox:checked + .hole-checkbox-label,
.hole-checkbox-label.selected {
  background: #d1fae5;
  border-color: #10b981;
  color: #047857;
}

.hole-select-actions {
  display: flex;
  gap: 8px;
  margin-top: 8px;
}

.hole-select-btn {
  padding: 6px 12px;
  font-size: 0.75rem;
  font-weight: 500;
  border-radius: 8px;
  border: 1px solid #d6d3d1;
  background: #ffffff;
  color: #44403c;
  cursor: pointer;
  transition: background-color 0.2s;
}

.hole-select-btn:hover {
  background: #f5f5f4;
}

/* Color Picker */
.color-picker-group {
  display: flex;
  align-items: center;
  gap: 12px;
}

.color-picker-input {
  width: 48px;
  height: 48px;
  padding: 0;
  border: 2px solid #e7e5e4;
  border-radius: 8px;
  cursor: pointer;
  overflow: hidden;
}

.color-picker-input::-webkit-color-swatch-wrapper {
  padding: 0;
}

.color-picker-input::-webkit-color-swatch {
  border: none;
  border-radius: 8px;
}

.color-hex-input {
  width: 100px;
  padding: 8px 10px;
  font-size: 0.875rem;
  font-family: monospace;
}

/* Radio Group */
.radio-group {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.radio-option {
  display: none;
}

.radio-label {
  display: inline-flex;
  align-items: center;
  padding: 8px 16px;
  background: #f5f5f4;
  border: 2px solid transparent;
  border-radius: 8px;
  font-size: 0.875rem;
  font-weight: 500;
  color: #44403c;
  cursor: pointer;
  transition: all 0.2s;
}

.radio-label:hover {
  background: #e7e5e4;
}

.radio-option:checked + .radio-label {
  background: #d1fae5;
  border-color: #10b981;
  color: #047857;
}

/* Toggle Switch */
.toggle-switch {
  position: relative;
  width: 44px;
  height: 24px;
  background: #d6d3d1;
  border-radius: 8px;
  cursor: pointer;
  transition: background-color 0.2s;
}

.toggle-switch.active {
  background: #10b981;
}

.toggle-switch::after {
  content: '';
  position: absolute;
  top: 2px;
  left: 2px;
  width: 20px;
  height: 20px;
  background: #ffffff;
  border-radius: 8px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
  transition: transform 0.2s;
}

.toggle-switch.active::after {
  transform: translateX(20px);
}

/* Image Upload */
.image-upload-area {
  border: 2px dashed #d6d3d1;
  border-radius: 8px;
  padding: 24px;
  text-align: center;
  cursor: pointer;
  transition: border-color 0.2s, background-color 0.2s;
  background: #ffffff;
}

.image-upload-area:hover {
  border-color: #34d399;
  background: #ecfdf5;
}

.image-upload-area.has-image {
  padding: 12px;
  border-style: solid;
  border-color: #10b981;
}

.image-upload-preview {
  max-width: 100%;
  max-height: 150px;
  border-radius: 8px;
  object-fit: cover;
}

.image-upload-icon {
  width: 48px;
  height: 48px;
  color: #a8a29e;
  margin-bottom: 8px;
}

.image-upload-text {
  font-size: 0.875rem;
  color: #57534e;
}

.image-upload-hint {
  font-size: 0.75rem;
  color: #78716c;
  margin-top: 4px;
}

/* Modal Footer */
.popup-modal-footer {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
  padding: 16px 24px;
  border-top: 1px solid #e7e5e4;
  background: #fafaf9;
}

.btn-cancel {
  padding: 10px 20px;
  background: #ffffff;
  border: 1px solid #d6d3d1;
  border-radius: 8px;
  font-size: 0.875rem;
  font-weight: 500;
  color: #44403c;
  cursor: pointer;
  transition: background-color 0.2s;
}

.btn-cancel:hover {
  background: #f5f5f4;
}

.btn-save {
  padding: 10px 24px;
  background: #10b981;
  border: none;
  border-radius: 8px;
  font-size: 0.875rem;
  font-weight: 600;
  color: #ffffff;
  cursor: pointer;
  transition: background-color 0.2s, transform 0.2s;
}

.btn-save:hover {
  background: #059669;
  transform: translateY(-1px);
}

.btn-save:disabled {
  background: #d6d3d1;
  cursor: not-allowed;
  transform: none;
}

body.dark-mode .btn-save:disabled,
.dark .btn-save:disabled {
  background: #475569; /* slate-600 */
  color: #94a3b8; /* slate-400 */
}

/* Analytics Summary Cards */
.analytics-summary {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
  margin-top: 24px;
}

.analytics-card {
  background: #ffffff;
  border-radius: 8px;
  padding: 20px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.analytics-card-label {
  font-size: 0.75rem;
  font-weight: 600;
  color: #78716c;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 8px;
}

.analytics-card-value {
  font-size: 1.75rem;
  font-weight: 700;
  color: #1c1917;
}

.analytics-card-value.highlight {
  color: #059669;
}

/* ========================================
   DARK MODE SUPPORT
   ======================================== */

body.dark-mode .in-app-popup-overlay,
.dark .in-app-popup-overlay {
  background: rgba(0, 0, 0, 0.8);
}

body.dark-mode .popup-modal-overlay,
.dark .popup-modal-overlay {
  background: rgba(0, 0, 0, 0.7);
}

body.dark-mode .popups-table-container,
body.dark-mode .analytics-card,
.dark .popups-table-container,
.dark .analytics-card {
  background: #1e293b; /* slate-800 */
  border: 1px solid #475569; /* slate-600 */
}

body.dark-mode .popups-table th,
.dark .popups-table th {
  background: #0f172a; /* slate-900 */
  color: #94a3b8; /* slate-400 */
  border-color: #475569; /* slate-600 */
}

body.dark-mode .popups-table td,
.dark .popups-table td {
  color: #f1f5f9; /* slate-100 */
  border-color: #475569; /* slate-600 */
}

body.dark-mode .popups-table tr:hover td,
.dark .popups-table tr:hover td {
  background: #334155; /* slate-700 */
}

body.dark-mode .popup-name-cell,
.dark .popup-name-cell {
  color: #f8fafc; /* slate-50 */
}

body.dark-mode .form-input,
body.dark-mode .form-select,
body.dark-mode .form-textarea,
.dark .form-input,
.dark .form-select,
.dark .form-textarea {
  background: #1e293b; /* slate-800 */
  border-color: #475569; /* slate-600 */
  color: #f1f5f9; /* slate-100 */
}

body.dark-mode .form-input:focus,
body.dark-mode .form-select:focus,
body.dark-mode .form-textarea:focus,
.dark .form-input:focus,
.dark .form-select:focus,
.dark .form-textarea:focus {
  border-color: #10b981;
  box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.2);
}

body.dark-mode .form-label,
.dark .form-label {
  color: #cbd5e1; /* slate-300 */
}

body.dark-mode .popup-modal,
.dark .popup-modal {
  background: #1e293b; /* slate-800 */
  border-color: #475569; /* slate-600 */
}

body.dark-mode .popup-modal-header,
.dark .popup-modal-header {
  background: #1e293b; /* slate-800 */
  border-color: #475569; /* slate-600 */
}

body.dark-mode .popup-modal-header h3,
.dark .popup-modal-header h3 {
  color: #f8fafc; /* slate-50 */
}

body.dark-mode .popup-form-panel,
.dark .popup-form-panel {
  background: #1e293b; /* slate-800 */
}

body.dark-mode .popup-preview-panel,
.dark .popup-preview-panel {
  background: #0f172a; /* slate-900 */
  border-color: #475569; /* slate-600 */
}

body.dark-mode .popup-modal-footer,
.dark .popup-modal-footer {
  background: #0f172a; /* slate-900 */
  border-color: #475569; /* slate-600 */
}

body.dark-mode .btn-cancel,
.dark .btn-cancel {
  background: #334155; /* slate-700 */
  border-color: #475569; /* slate-600 */
  color: #f1f5f9; /* slate-100 */
}

body.dark-mode .btn-cancel:hover,
.dark .btn-cancel:hover {
  background: #475569; /* slate-600 */
}

body.dark-mode .analytics-card-value,
.dark .analytics-card-value {
  color: #f8fafc; /* slate-50 */
}

body.dark-mode .analytics-card-label,
.dark .analytics-card-label {
  color: #94a3b8; /* slate-400 */
}

body.dark-mode .in-app-popups-header h2,
.dark .in-app-popups-header h2 {
  color: #f8fafc; /* slate-50 */
}

/* Empty State - Dark Mode */
body.dark-mode .popups-empty-state,
.dark .popups-empty-state {
  background: #1e293b; /* slate-800 */
  border: 1px solid #475569; /* slate-600 */
  border-radius: 8px;
}

body.dark-mode .popups-empty-state svg,
.dark .popups-empty-state svg {
  color: #475569; /* slate-600 */
}

body.dark-mode .popups-empty-state h3,
.dark .popups-empty-state h3 {
  color: #f1f5f9; /* slate-100 */
}

body.dark-mode .popups-empty-state p,
.dark .popups-empty-state p {
  color: #94a3b8; /* slate-400 */
}

/* Feature Toggle - Dark Mode */
body.dark-mode .feature-toggle-label,
.dark .feature-toggle-label {
  color: #cbd5e1; /* slate-300 */
}

/* Form Sections - Dark Mode */
body.dark-mode .form-section-title,
.dark .form-section-title {
  color: #f1f5f9; /* slate-100 */
}

body.dark-mode .form-section-title svg,
.dark .form-section-title svg {
  color: #94a3b8; /* slate-400 */
}

/* Hole Selection - Dark Mode */
body.dark-mode .hole-checkbox-label,
.dark .hole-checkbox-label {
  background: #334155; /* slate-700 */
  color: #cbd5e1; /* slate-300 */
}

body.dark-mode .hole-checkbox-label:hover,
.dark .hole-checkbox-label:hover {
  background: #475569; /* slate-600 */
}

body.dark-mode .hole-checkbox:checked + .hole-checkbox-label,
.dark .hole-checkbox:checked + .hole-checkbox-label,
body.dark-mode .hole-checkbox-label.selected,
.dark .hole-checkbox-label.selected {
  background: rgba(16, 185, 129, 0.2);
  border-color: #10b981;
  color: #34d399;
}

body.dark-mode .hole-select-btn,
.dark .hole-select-btn {
  background: #334155; /* slate-700 */
  border-color: #475569; /* slate-600 */
  color: #cbd5e1; /* slate-300 */
}

body.dark-mode .hole-select-btn:hover,
.dark .hole-select-btn:hover {
  background: #475569; /* slate-600 */
}

/* Radio/Toggle - Dark Mode */
body.dark-mode .radio-label,
.dark .radio-label {
  background: #334155; /* slate-700 */
  color: #cbd5e1; /* slate-300 */
}

body.dark-mode .radio-label:hover,
.dark .radio-label:hover {
  background: #475569; /* slate-600 */
}

body.dark-mode .radio-option:checked + .radio-label,
.dark .radio-option:checked + .radio-label {
  background: rgba(16, 185, 129, 0.2);
  border-color: #10b981;
  color: #34d399;
}

body.dark-mode .toggle-switch,
.dark .toggle-switch {
  background: #475569; /* slate-600 */
}

body.dark-mode .toggle-switch.active,
.dark .toggle-switch.active {
  background: #10b981;
}

/* Image Upload - Dark Mode */
body.dark-mode .image-upload-area,
.dark .image-upload-area {
  border-color: #475569; /* slate-600 */
  background: #0f172a; /* slate-900 */
}

body.dark-mode .image-upload-area:hover,
.dark .image-upload-area:hover {
  border-color: #10b981;
  background: rgba(16, 185, 129, 0.1);
}

body.dark-mode .image-upload-icon,
.dark .image-upload-icon {
  color: #64748b; /* slate-500 */
}

body.dark-mode .image-upload-text,
.dark .image-upload-text {
  color: #94a3b8; /* slate-400 */
}

body.dark-mode .image-upload-hint,
.dark .image-upload-hint {
  color: #64748b; /* slate-500 */
}

/* Color Picker - Dark Mode */
body.dark-mode .color-picker-input,
.dark .color-picker-input {
  border-color: #475569; /* slate-600 */
}

body.dark-mode .color-picker-group span,
.dark .color-picker-group span {
  color: #94a3b8 !important; /* slate-400 */
}

/* Preview Panel - Dark Mode */
body.dark-mode .preview-label,
.dark .preview-label {
  color: #94a3b8; /* slate-400 */
}

body.dark-mode .phone-mockup,
.dark .phone-mockup {
  background: #0f172a; /* slate-900 */
}

body.dark-mode .phone-screen,
.dark .phone-screen {
  background: #1e293b; /* slate-800 */
}

/* Status Badge - Dark Mode */
body.dark-mode .status-badge.inactive,
.dark .status-badge.inactive {
  background: #334155; /* slate-700 */
  color: #94a3b8; /* slate-400 */
}

body.dark-mode .status-badge.inactive .status-dot,
.dark .status-badge.inactive .status-dot {
  background: #64748b; /* slate-500 */
}

/* Hole Badge - Dark Mode */
body.dark-mode .hole-badge,
.dark .hole-badge {
  background: rgba(16, 185, 129, 0.2);
  color: #34d399;
}

/* Action Buttons - Dark Mode */
body.dark-mode .action-btn.edit,
.dark .action-btn.edit {
  background: rgba(59, 130, 246, 0.2);
  color: #60a5fa;
}

body.dark-mode .action-btn.edit:hover,
.dark .action-btn.edit:hover {
  background: rgba(59, 130, 246, 0.3);
}

body.dark-mode .action-btn.delete,
.dark .action-btn.delete {
  background: rgba(239, 68, 68, 0.2);
  color: #f87171;
}

body.dark-mode .action-btn.delete:hover,
.dark .action-btn.delete:hover {
  background: rgba(239, 68, 68, 0.3);
}

/* Modal Close Button - Dark Mode */
body.dark-mode .popup-modal-close,
.dark .popup-modal-close {
  background: #334155; /* slate-700 */
  color: #cbd5e1; /* slate-300 */
}

body.dark-mode .popup-modal-close:hover,
.dark .popup-modal-close:hover {
  background: #475569; /* slate-600 */
}

/* ========================================
   RESPONSIVE ADJUSTMENTS
   ======================================== */

@media (max-width: 768px) {
  .in-app-popups-header {
    flex-direction: column;
    align-items: stretch;
  }

  .popups-table-container {
    overflow-x: auto;
  }

  .popups-table {
    min-width: 600px;
  }

  .popup-modal {
    max-height: 100vh;
    border-radius: 8px;
  }

  .popup-form-panel {
    max-height: calc(100vh - 140px);
  }

  .analytics-summary {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 480px) {
  .analytics-summary {
    grid-template-columns: 1fr;
  }
}
