/* Gestor de ventanas del escritorio (window-manager.js) */

/* Mientras se arrastra o redimensiona una ventana, los iframes no capturan el mouse:
   si no, el que queda bajo el cursor se queda con los eventos y el arrastre se traba. */
.tgwm-dragging iframe {
  pointer-events: none !important;
}

.tgwm-dragging {
  user-select: none;
}

/* Vista previa del snap */
.tgwm-snap-preview {
  position: absolute;
  z-index: 9000;
  pointer-events: none;
  box-sizing: border-box;
  border: 2px solid rgba(64, 158, 240, 0.75);
  border-radius: 8px;
  background: rgba(64, 158, 240, 0.18);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  opacity: 0;
  transition: left 0.12s ease, top 0.12s ease, width 0.12s ease, height 0.12s ease, opacity 0.12s ease;
}

.tgwm-snap-preview.visible {
  opacity: 1;
}

/* Paneles flotantes: layouts, Snap Assist y menú contextual */
.tgwm-layouts,
.tgwm-assist,
.tgwm-menu {
  position: fixed;
  z-index: 2100;
  color: #ffffff;
  background: rgba(37, 48, 58, 0.88);
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 10px;
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.35);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  font-size: 13px;
}

/* Menú de layouts (hover en maximizar) */
.tgwm-layouts {
  padding: 8px 10px 10px;
}

.tgwm-layouts-title,
.tgwm-assist-title {
  font-size: 12px;
  font-weight: 600;
  opacity: 0.8;
  margin-bottom: 8px;
}

.tgwm-layouts-grid {
  display: grid;
  grid-template-columns: repeat(3, 84px);
  gap: 8px;
}

.tgwm-layout {
  position: relative;
  width: 84px;
  height: 52px;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.06);
}

.tgwm-layout-zone {
  position: absolute;
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  border: 2px solid transparent;
  background-clip: padding-box;
  background-color: rgba(255, 255, 255, 0.22);
  border-radius: 5px;
  cursor: pointer;
}

.tgwm-layout-zone:hover {
  background-color: rgba(57, 133, 219, 0.95);
}

/* Snap Assist */
.tgwm-assist-backdrop {
  position: fixed;
  inset: 0;
  z-index: 2090;
  background: transparent;
}

.tgwm-assist {
  box-sizing: border-box;
  padding: 14px;
  overflow: auto;
}

.tgwm-assist-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 10px;
}

.tgwm-assist-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 96px;
  padding: 10px;
  color: #ffffff;
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 8px;
  cursor: pointer;
}

.tgwm-assist-card:hover {
  background: rgba(57, 133, 219, 0.6);
}

.tgwm-assist-card .material-symbols-outlined {
  font-size: 32px;
}

.tgwm-assist-label {
  font-size: 12px;
  font-weight: 600;
  text-align: center;
  line-height: 1.2;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

/* Menú contextual de la taskbar */
.tgwm-menu {
  min-width: 210px;
  padding: 5px;
}

.tgwm-menu-item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 6px 10px;
  color: #ffffff;
  background: transparent;
  border: 0;
  border-radius: 6px;
  text-align: left;
  cursor: pointer;
}

.tgwm-menu-item .material-symbols-outlined {
  font-size: 18px;
  opacity: 0.85;
}

.tgwm-menu-item:hover:not(:disabled) {
  background: rgba(57, 133, 219, 0.85);
}

.tgwm-menu-item:disabled {
  opacity: 0.4;
  cursor: default;
}

.tgwm-menu-sep {
  height: 1px;
  margin: 4px 6px;
  background: rgba(255, 255, 255, 0.15);
}
