/* ═══════════════════════════════════════════════════════════════
   GeoAgro SRP — Responsive Layout Styles
   v1.0.0
   
   Estilos para handles de redimensionamento e comportamento
   responsivo do mapa e painéis
═══════════════════════════════════════════════════════════════ */

/* ── Handle de Resize (vertical) ─────────────────────────────── */
.srp-resize-handle {
  position: relative;
  user-select: none;
  -webkit-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
  touch-action: none;
  z-index: 100;
}

.srp-resize-handle-vertical {
  height: 6px;
  width: 100%;
  background: linear-gradient(
    180deg,
    rgba(200, 200, 200, 0.4) 0%,
    rgba(100, 100, 100, 0.6) 50%,
    rgba(200, 200, 200, 0.4) 100%
  );
  cursor: row-resize;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0;
  padding: 0;
  border: none;
  transition: background 0.2s ease, box-shadow 0.2s ease;
}

.srp-resize-handle-vertical:hover {
  background: linear-gradient(
    180deg,
    rgba(150, 150, 150, 0.6) 0%,
    rgba(80, 80, 80, 0.8) 50%,
    rgba(150, 150, 150, 0.6) 100%
  );
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12);
}

.srp-resize-handle-vertical.active {
  background: linear-gradient(
    180deg,
    rgba(100, 100, 100, 0.8) 0%,
    rgba(50, 50, 50, 1) 50%,
    rgba(100, 100, 100, 0.8) 100%
  );
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.srp-resize-handle-inner {
  width: 30px;
  height: 2px;
  background: rgba(80, 80, 80, 0.7);
  border-radius: 1px;
  opacity: 0.6;
  transition: opacity 0.2s ease;
  pointer-events: none;
}

.srp-resize-handle-vertical:hover .srp-resize-handle-inner,
.srp-resize-handle-vertical.active .srp-resize-handle-inner {
  opacity: 0.9;
}

/* ── Cursor durante dragging ────────────────────────────────── */
body.srp-layout-dragging {
  cursor: row-resize !important;
  user-select: none;
  -webkit-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
}

body.srp-layout-dragging * {
  cursor: row-resize !important;
  user-select: none;
  -webkit-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
}

/* ── Container do mapa (responsivo) ───────────────────────── */
#mapa-pinda-container {
  transition: height 0.05s linear;
  /* Altura é definida via JavaScript quando redimensionada */
}

/* ── Rodapé se ajusta automaticamente ────────────────────── */
#mapa-pinda-wrap > div:last-child,
#mapa-pinda-footer {
  /* Rodapé ocupará espaço restante disponível */
  flex-shrink: 0;
}

/* ── Modo de drag visual ────────────────────────────────── */
.srp-layout-dragging #mapa-pinda-container {
  pointer-events: none;
  opacity: 0.95;
}

.srp-layout-dragging #mapa-pinda {
  pointer-events: none;
}

/* ── Accessibility (focus visible) ──────────────────────── */
.srp-resize-handle:focus-visible {
  outline: 2px solid var(--srp-verde-escuro, #1b5e20);
  outline-offset: 2px;
}

/* ── Media Queries para responsividade ──────────────────── */

/* Tablets/Mobile - reduzir tamanhos */
@media (max-width: 1024px) {
  .srp-resize-handle-vertical {
    height: 8px;
  }

  .srp-resize-handle-inner {
    width: 24px;
    height: 2px;
  }
}

@media (max-width: 768px) {
  .srp-resize-handle-vertical {
    height: 10px;
  }

  .srp-resize-handle-inner {
    width: 20px;
    height: 2px;
  }

  /* Em mobile, permitir redimensionamento mais agressivo */
  body.srp-layout-dragging {
    background: rgba(0, 0, 0, 0.02);
  }
}

/* ── Dark mode support ──────────────────────────────────── */
@media (prefers-color-scheme: dark) {
  .srp-resize-handle-vertical {
    background: linear-gradient(
      180deg,
      rgba(100, 100, 100, 0.4) 0%,
      rgba(60, 60, 60, 0.6) 50%,
      rgba(100, 100, 100, 0.4) 100%
    );
  }

  .srp-resize-handle-vertical:hover {
    background: linear-gradient(
      180deg,
      rgba(120, 120, 120, 0.6) 0%,
      rgba(80, 80, 80, 0.8) 50%,
      rgba(120, 120, 120, 0.6) 100%
    );
  }

  .srp-resize-handle-vertical.active {
    background: linear-gradient(
      180deg,
      rgba(140, 140, 140, 0.8) 0%,
      rgba(100, 100, 100, 1) 50%,
      rgba(140, 140, 140, 0.8) 100%
    );
  }

  .srp-resize-handle-inner {
    background: rgba(180, 180, 180, 0.7);
  }
}

/* ── Animations suave ───────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  .srp-resize-handle-vertical,
  .srp-resize-handle-inner,
  #mapa-pinda-container {
    transition: none;
  }
}

/* ── Print styles ───────────────────────────────────────── */
@media print {
  .srp-resize-handle {
    display: none;
  }

  body.srp-layout-dragging {
    cursor: auto;
    user-select: auto;
  }
}
