/* ==========================================
   ACCID LAYER SYSTEM CSS (Filter-in-Place)
   ==========================================

   Layers are tags on modules, all in #moduleContainer.
   Switching layers shows/hides modules by their tag.
   No separate DOM containers needed for editing.
*/


/* ==================== HIDDEN LAYER MODULES ==================== */

/* Modules not on the active layer are hidden */
.layer-hidden {
  display: none !important;
}


/* ==================== BACKGROUND MODULE TYPES ==================== */

.module-background {
  width: 100%;
  height: 100%;
  min-height: 180px;
}


/* ==================== EDITOR: LAYER SWITCHER ==================== */

.layer-switcher {
  display: flex;
  flex-direction: column;
  gap: 4px;
  background: rgba(0, 0, 0, 0.85);
  padding: 0;
  border-radius: 0 12px 12px 0;
  position: fixed;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  z-index: 100000;
  box-shadow: 4px 0 20px rgba(0, 0, 0, 0.3);
  backdrop-filter: blur(10px);
  overflow: visible;
}

/* Closed: hide layer buttons, only tab visible */
.layer-switcher .layer-btn {
  display: none;
}

/* Open: show layer buttons with padding */
.layer-switcher--open {
  padding: 8px;
}

.layer-switcher--open .layer-btn {
  display: flex;
}

.layer-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 10px 14px;
  background: transparent;
  border: 2px solid transparent;
  border-radius: 8px;
  color: #888;
  cursor: pointer;
  transition: all 0.2s ease;
  min-width: 60px;
}

.layer-btn:hover {
  color: white;
  background: rgba(255, 255, 255, 0.1);
}

.layer-btn.active {
  color: white;
  border-color: #3b82f6;
  background: rgba(59, 130, 246, 0.25);
}

.layer-btn .layer-icon {
  font-size: 20px;
  line-height: 1;
}

.layer-btn .layer-label {
  font-size: 9px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  font-weight: 600;
}

/* Layer indicator dot */
.layer-btn::after {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
  opacity: 0.3;
  margin-top: 4px;
}

.layer-btn.active::after {
  opacity: 1;
  background: #3b82f6;
}

.layer-btn.has-content::after {
  background: #10b981;
  opacity: 0.8;
}


/* ==================== LAYER SWITCHER TOGGLE TAB ==================== */

.layer-switcher-tab {
  position: absolute;
  right: -32px;
  top: 50%;
  transform: translateY(-50%);
  width: 32px;
  height: 48px;
  background: rgba(0, 0, 0, 0.85);
  border: none;
  border-radius: 0 8px 8px 0;
  color: white;
  font-size: 16px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(10px);
  box-shadow: 4px 0 10px rgba(0, 0, 0, 0.2);
  transition: background 0.2s;
}

.layer-switcher-tab:hover {
  background: rgba(59, 130, 246, 0.5);
}

/* Tab always positioned on right edge of switcher */
.layer-switcher .layer-switcher-tab {
  right: -32px;
}


/* ==================== LAYER BADGE ON MODULES ==================== */

/* Small badge showing which layer a module belongs to (edit mode) */
.layer-badge {
  position: absolute;
  top: 4px;
  left: 4px;
  background: rgba(0, 0, 0, 0.7);
  color: white;
  font-size: 10px;
  padding: 2px 6px;
  border-radius: 4px;
  z-index: 5;
  pointer-events: none;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}


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

@media (max-width: 768px) {
  .layer-switcher {
    flex-direction: row;
    top: auto;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    border-radius: 12px 12px 0 0;
  }

  .layer-switcher-tab {
    right: auto;
    top: -36px;
    left: 50%;
    transform: translateX(-50%);
    width: 48px;
    height: 32px;
    border-radius: 8px 8px 0 0;
    box-shadow: 0 -4px 10px rgba(0, 0, 0, 0.2);
  }

  .layer-btn {
    padding: 8px 10px;
    min-width: 50px;
  }

  .layer-btn .layer-icon {
    font-size: 18px;
  }

  .layer-btn .layer-label {
    font-size: 8px;
  }
}


/* ==================== PRINT ==================== */

@media print {
  .layer-switcher {
    display: none;
  }
}
