/* module-styles.css - Styling for all modules */

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


.module-palette .module-item.pattern-item { display: none; visibility: hidden;}

/*
body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  line-height: 1.6;
  color: #333;
}

h1,h2,h3,h4,h5,h6 { font-family: "Montserrat", system-ui,-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,Oxygen,Ubuntu,Cantarell,"Fira Sans","Droid Sans","Helvetica Neue",sans-serif;
font-weight: 700;}
*/
/* Text Module */
.module-text {
  margin: 0;
}

/* Image Module */
.module-image {
  margin: 0;
}

.module-image img {
  display: block;
}

.module-image .caption {
  padding: 10px;
  font-size: 14px;
  color: #666;
  text-align: center;
}

/* Spacer Module */
/* In preview: wrapper + spacer both invisible */
.module-wrapper-v2:has(.module-spacer:not(.module-spacer-edit)) {
  background: transparent !important;
  border: none !important;
  padding: 0 !important;
  box-shadow: none !important;
}

.module-spacer {
  width: 100%;
  height: 100%;
  min-height: 30px;
}

.module-spacer-edit {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  border: 2px dashed rgba(150, 150, 150, 0.5);
  border-radius: 8px;
  background: repeating-linear-gradient(
    45deg,
    transparent,
    transparent 10px,
    rgba(150, 150, 150, 0.05) 10px,
    rgba(150, 150, 150, 0.05) 20px
  );
  color: #999;
  font-size: 12px;
  min-height: 40px;
}

.module-spacer-edit .spacer-icon {
  font-size: 24px;
  opacity: 0.5;
}

.module-spacer-edit .spacer-label {
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  opacity: 0.6;
}

/* Button Module */
.module-button {
  text-align: center;
  margin: 8px 0;
}

.button {
  display: inline-block;
  padding: 10px 24px;
  text-decoration: none;
  border-radius: 4px;
  transition: all 0.3s;
  font-weight: 600;
}

.button-primary {
  background: #007bff;
  color: white;
}

.button-primary:hover {
  background: #0056b3;
}

.button-secondary {
  background: #6c757d;
  color: white;
}

.button-ghost {
  background: transparent;
  border: 2px solid #007bff;
  color: #007bff;
}

.button-small {
  padding: 8px 20px;
  font-size: 14px;
}

.button-medium {
  padding: 12px 30px;
  font-size: 16px;
}

.button-large {
  padding: 16px 40px;
  font-size: 18px;
}

/* Section Layouts */
.module-section {
  display: block;
}

.layout-hero {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  min-height: 40vh;
}

.layout-two-column {
  display: grid;
  grid-template-columns: 1fr 1fr;
}

.layout-three-column {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
}

.layout-sidebar {
  display: grid;
  grid-template-columns: 2fr 1fr;
}

@media (max-width: 768px) {

  .layout-two-column,
  .layout-three-column,
  .layout-sidebar {
    grid-template-columns: 1fr;
  }
}

/* Canvas Module */
.module-canvas {
  position: relative;
  overflow: hidden;
}

.canvas-point {
  cursor: pointer;
}

.point-marker {
  width: 12px;
  height: 12px;
  background: #ff4444;
  border: 2px solid white;
  border-radius: 50%;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.point-content {
  display: none;
  position: absolute;
  top: 20px;
  left: 0;
  background: white;
  padding: 15px;
  border-radius: 4px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  min-width: 200px;
  z-index: 10;
}

.canvas-point:hover .point-content {
  display: block;
}

.point-content h4 {
  margin-bottom: 8px;
  color: #333;
}

.point-content p {
  color: #666;
  font-size: 14px;
}

/* Error styling */
.error {
  padding: 20px;
  background: #f8d7da;
  color: #721c24;
  border: 1px solid #f5c6cb;
  border-radius: 4px;
  margin: 20px 0;
}


/* NAV */

/* Navigation Module */
.module-navigation {
  padding: 15px 20px;
}

.nav-items {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
}

/* Horizontal navigation (default) */
.nav-horizontal .nav-items {
  flex-direction: row;
  justify-content: flex-start;
}

/* Vertical navigation */
.nav-vertical .nav-items {
  flex-direction: column;
  align-items: flex-start;
}

/* Bullets mode */
.nav-bullets .nav-items {
  list-style: disc;
  padding-left: 20px;
}

.nav-bullets .nav-item {
  list-style: inherit;
}

.nav-item {
  list-style: none;
}

.nav-item a {
  text-decoration: none;
  padding: 6px 12px;
  display: block;
  transition: opacity 0.2s;
}

.nav-item a:hover {
  opacity: 0.8;
}

/* Position variants */
.nav-top {
  position: sticky;
  top: 0;
  z-index: 100;
}

.nav-bottom {
  position: sticky;
  bottom: 0;
  z-index: 100;
}

/* ROW MODULE - Flexible row container */
.module-row {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.row-empty-state,
.section-empty-state {
  padding: 40px 20px;
  text-align: center;
  color: #999;
  font-style: italic;
  border: 2px dashed #ddd;
  border-radius: 8px;
  background: #f9f9f9;
  width: 100%;
}

.section-empty-state {
  padding: 20px;
  font-size: 14px;
}

/* Section as flex child */
.module-section {
  flex: 1;
  min-width: 200px;
  display: flex;
  flex-direction: column;
  gap: 15px;
}

@media (max-width: 768px) {
  .module-row {
    flex-direction: column;
  }

  .module-section {
    min-width: 100%;
  }
}
/* ========================================
   FLUID GRID SYSTEM
   Smoothly scales spacing with viewport
   No breakpoints needed!
   ======================================== */

:root {
  /* Fluid spacing values - scale with viewport width */
  --grid-gap: clamp(0.25rem, .25vw, .25rem);      /* 8px → 32px */
  --section-padding: clamp(.5rem, .5vw, .5rem); /* 16px → 80px */
  --vertical-spacing: clamp(.5rem, .5vw, .5rem); /* 16px → 48px */
}

/* Base module styling */
.module-editable,
.module-content,
.module-text,
.module-image,
.module-button,
.module-form,
.module-section {
  box-sizing: border-box;
  margin-bottom: var(--vertical-spacing);
}

@media (max-width: 640px) {
  :root {
    --vertical-spacing: 0;
    --grid-gap: 0;
    --section-padding: 0;
  }
}


/* Sections also get fluid padding */
.module-section {
  padding: var(--section-padding);
}

.module-content {
  background: transparent;
  border: 0px solid #cccccc;
  padding: 2px; 
  color: #333;

}

/* ========================================
   BONUS: Fluid Typography (if you want)
   ======================================== */

/*
:root {
  --fluid-text-base: clamp(1rem, 2vw, 1.125rem);
  --fluid-text-lg: clamp(1.25rem, 3vw, 1.5rem);
  --fluid-text-xl: clamp(1.5rem, 4vw, 2rem);
  --fluid-text-2xl: clamp(2rem, 5vw, 3rem);
}

.module-text h1 { font-size: var(--fluid-text-2xl); }
.module-text h2 { font-size: var(--fluid-text-xl); }
.module-text h3 { font-size: var(--fluid-text-lg); }
.module-text p { font-size: var(--fluid-text-base); }
*/

/* =====================================================================
   PAGE MANAGER PANEL — Templates + All Pages
   ===================================================================== */

#pageManagerPanel {
  max-height: 60vh;
  overflow-y: auto;
  font-size: 12px;
}

.pm-section { margin-bottom: 8px; }

.pm-section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 6px 10px;
  background: #2a2a3e;
  color: #aaa;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 1px;
  cursor: pointer;
  user-select: none;
  border-radius: 4px 4px 0 0;
}

.pm-section-body { padding: 2px 0; }
.pm-section-body.collapsed { display: none; }

.pm-badge {
  background: #444;
  color: #ccc;
  padding: 1px 6px;
  border-radius: 8px;
  font-size: 10px;
}

.pm-item {
  display: flex;
  align-items: center;
  padding: 5px 10px;
  cursor: pointer;
  border-bottom: 1px solid #1a1a2e;
  gap: 6px;
}

.pm-item:hover { background: #2a2a3e; }

.pm-item-name {
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: #ddd;
}

.pm-match-count {
  color: #888;
  font-size: 11px;
}

.pm-item-actions {
  display: flex;
  gap: 2px;
}

.pm-btn-sm {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 12px;
  padding: 2px;
  opacity: 0.6;
}

.pm-btn-sm:hover { opacity: 1; }

.pm-btn-add {
  display: block;
  width: 100%;
  padding: 6px;
  background: none;
  border: 1px dashed #444;
  color: #888;
  cursor: pointer;
  font-size: 11px;
  margin-top: 4px;
  border-radius: 4px;
}

.pm-btn-add:hover { border-color: #888; color: #ccc; }

.pm-page-list { max-height: 40vh; overflow-y: auto; }

.pm-assign-label {
  font-size: 10px;
  color: #888;
  cursor: pointer;
  padding: 2px 6px;
  border-radius: 4px;
}

.pm-assign-label:hover { background: #333; color: #fff; }

.pm-unique .pm-assign-label { color: #4CAF50; }
.pm-assigned .pm-assign-label { color: #64b5f6; }
.pm-auto-assigned .pm-assign-label { color: #64b5f680; font-style: italic; }
.pm-unassigned .pm-assign-label { color: #ff9800; }

.pm-current { background: #1a1a3e !important; border-left: 3px solid #667eea; }

.pm-stats {
  padding: 6px 10px;
  color: #666;
  text-align: center;
}

/* Assignment menu */
.pm-assign-menu {
  background: #1e1e2e;
  border: 1px solid #444;
  border-radius: 6px;
  box-shadow: 0 4px 16px rgba(0,0,0,0.4);
  min-width: 150px;
  overflow: hidden;
}

.pm-assign-option {
  padding: 8px 12px;
  color: #ddd;
  cursor: pointer;
  font-size: 12px;
}

.pm-assign-option:hover { background: #333; }

/* Template config dialog */
.pm-config-dialog {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0,0,0,0.7);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10001;
}

.pm-config-inner {
  background: #1e1e2e;
  color: #ddd;
  padding: 20px;
  border-radius: 10px;
  min-width: 360px;
  max-width: 90vw;
}

.pm-config-inner h3 { margin: 0 0 16px; color: #fff; }

.pm-config-row {
  margin-bottom: 10px;
}

.pm-config-row label {
  display: block;
  font-size: 11px;
  color: #999;
  margin-bottom: 4px;
}

.pm-config-row input,
.pm-config-row select {
  width: 100%;
  padding: 6px 8px;
  background: #2a2a3e;
  border: 1px solid #444;
  color: #ddd;
  border-radius: 4px;
  font-size: 13px;
}

.pm-btn-primary {
  flex: 1;
  padding: 8px 16px;
  background: #667eea;
  color: white;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  font-weight: 600;
}

.pm-btn-primary:hover { background: #5a6fd6; }

.pm-btn-secondary {
  flex: 1;
  padding: 8px 16px;
  background: #333;
  color: #ccc;
  border: none;
  border-radius: 6px;
  cursor: pointer;
}

.pm-btn-secondary:hover { background: #444; }
