/* Estilos Especializados para el Diseñador de Planos de Seguridad AiloNet Tech (QuickBooks Theme) */

.floorplan-workspace {
  display: flex;
  height: calc(100vh - 160px);
  min-height: 600px;
  background-color: #f8fafc;
  border-radius: 1rem;
  overflow: hidden;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -1px rgba(0, 0, 0, 0.03);
  border: 1px solid #e2e8f0;
}

/* Sidebar de herramientas y dispositivos */
.fp-sidebar {
  width: 320px;
  background-color: #ffffff;
  border-right: 1px solid #e2e8f0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  z-index: 10;
}

.fp-sidebar::-webkit-scrollbar {
  width: 6px;
}
.fp-sidebar::-webkit-scrollbar-thumb {
  background-color: #cbd5e1;
  border-radius: 3px;
}
.fp-sidebar::-webkit-scrollbar-thumb:hover {
  background-color: #94a3b8;
}
.fp-sidebar::-webkit-scrollbar-track {
  background: transparent;
}

.fp-tool-btn {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.5rem 0.75rem;
  background-color: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 0.5rem;
  color: #334155;
  font-size: 0.8125rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s ease;
  user-select: none;
}

.fp-tool-btn:hover {
  background-color: #f0fdf4;
  border-color: #2ca01c;
  color: #2ca01c;
  transform: translateY(-1px);
}

.fp-tool-btn.active {
  background-color: #2ca01c;
  border-color: #2ca01c;
  color: #ffffff;
  box-shadow: 0 2px 8px rgba(44, 160, 28, 0.3);
}

/* Área central de diseño */
.fp-canvas-area {
  flex: 1;
  position: relative;
  background-color: #f1f5f9;
  overflow: auto;
  display: flex;
  background-image: radial-gradient(#cbd5e1 1px, transparent 1px);
  background-size: 20px 20px;
}

#fpCanvas {
  margin: auto;
  background-color: #ffffff;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
  cursor: crosshair;
  border-radius: 4px;
}

/* Barra superior de controles del canvas */
.fp-topbar {
  position: absolute;
  top: 1rem;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(8px);
  border: 1px solid #cbd5e1;
  padding: 0.5rem 1rem;
  border-radius: 9999px;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  z-index: 20;
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
}

.fp-icon-badge {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  font-size: 1.25rem;
}

/* Panel de Propiedades del Dispositivo Seleccionado */
.fp-properties-panel {
  width: 300px;
  background-color: #ffffff;
  border-left: 1px solid #e2e8f0;
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  overflow-y: auto;
  color: #1e293b;
}

/* Leyenda del Plano */
.fp-legend-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.8rem;
  color: #475569;
}

.fp-legend-color {
  width: 12px;
  height: 12px;
  border-radius: 3px;
}

/* Control deslizante de ángulo */
.range-slider {
  -webkit-appearance: none;
  width: 100%;
  height: 6px;
  border-radius: 5px;
  background: #e2e8f0;
  outline: none;
}

.range-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #2ca01c;
  cursor: pointer;
  box-shadow: 0 0 6px rgba(44, 160, 28, 0.5);
}

/* ===================================================
   RESPONSIVIDAD Y OPTIMIZACIÓN TÁCTIL PARA MÓVILES
   =================================================== */

/* Evitar scroll de la página al arrastrar en el canvas táctil */
#fpCanvas {
  touch-action: none;
}

/* Pestañas móviles del diseñador de planos */
.fp-mobile-tab-btn {
  padding: 0.5rem 0.85rem;
  font-size: 0.75rem;
  font-weight: 700;
  border-radius: 0.5rem;
  background-color: #ffffff;
  border: 1px solid #cbd5e1;
  color: #475569;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.fp-mobile-tab-btn.active {
  background-color: #2ca01c;
  border-color: #2ca01c;
  color: #ffffff;
  box-shadow: 0 2px 6px rgba(44, 160, 28, 0.25);
}

@media (max-width: 1023px) {
  .floorplan-workspace {
    flex-direction: column;
    height: calc(100vh - 220px); 
    height: calc(100dvh - 220px); /* Adaptable height for mobile devices with dynamic viewport */
    min-height: 400px;
  }

  .fp-sidebar, .fp-properties-panel, .fp-canvas-area {
    flex: 1;
    width: 100%;
    max-height: 100%;
    overflow-y: auto;
  }

  .fp-sidebar {
    border-right: none;
    border-bottom: 1px solid #e2e8f0;
  }

  .fp-properties-panel {
    border-left: none;
    border-top: 1px solid #e2e8f0;
  }

  .fp-topbar {
    top: 0.5rem;
    padding: 0.35rem 0.75rem;
    gap: 0.5rem;
    font-size: 0.75rem;
    max-width: 95%;
    overflow-x: auto;
  }

  /* Ocultar / mostrar paneles según pestaña móvil */
  .fp-panel-view.hidden-mobile {
    display: none !important;
  }
}
