/* =====================================================
   BASE MODAL
   ===================================================== */

.drag-modal {
  position: fixed;
  top: 100px;
  left: 100px;

  min-width: 320px;
  min-height: 180px;
  max-width: 95vw;
  max-height: 90vh;

  background: #fff;
  border-radius: 8px;

  box-shadow:
    0 10px 30px rgba(0,0,0,.25),
    0 0 0 1px rgba(0,0,0,.05);

  display: none;
  z-index: 1000;

  /* NÃO vira flex para não quebrar drag/resize */
  overflow: hidden;
}

.drag-modal-content {
  display: flex;
  flex-direction: column;
  height: 100%;
}

/* =====================================================
   HEADER
   ===================================================== */

.drag-modal-header {
  cursor: move;
  user-select: none;

  padding: 10px 12px;
  background: linear-gradient(135deg, #212529, #343a40);
  color: #fff;

  display: flex;
  align-items: center;
  justify-content: space-between;
}

.drag-modal-title {
    margin-top: 0px;
    margin-bottom: 0px;
    align-items: center;

    font-size: 14px;
    font-weight: 600;

    display: flex;
    gap: 6px;
}

/* ações (minimizar / fechar custom) */
.drag-modal-header > div {
  display: flex;
  gap: 6px;
}

.drag-modal-header button {
  background: transparent;
  border: none;
  color: #fff;

  cursor: pointer;
  font-size: 14px;

  width: 26px;
  height: 26px;
  border-radius: 6px;

  transition: background .2s ease;
}

.drag-modal-header button:hover {
  background: rgba(255,255,255,.15);
}

/* botão close bootstrap */
.drag-modal-header .btn-close {
  filter: invert(1);
  opacity: .8;
}

.drag-modal-header .btn-close:hover {
  opacity: 1;
}

/* =====================================================
   BODY
   ===================================================== */

.drag-modal-body {
  padding: 14px;

  /* garante expansão correta no resize */
  overflow-y: auto;
  max-height: calc(90vh - 110px);
}

/* =====================================================
   FORM LAYOUT (SEM ALTERAR ESTRUTURA)
   ===================================================== */

.form-floating-multiple label {
  font-size: 13px;
  font-weight: 500;
  color: #495057;
  margin-bottom: 2px;
}

.form-control,
.custom-select {
  border-radius: 6px;
  border: 1px solid #ced4da;

  padding: 8px 10px;
  font-size: 14px;

  transition: border-color .2s ease, box-shadow .2s ease;
}

.form-control:focus,
.custom-select:focus {
  border-color: #0d6efd;
  box-shadow: 0 0 0 2px rgba(13,110,253,.15);
  outline: none;
}

/* espaçamento melhor entre linhas */
.row.my-1 {
  margin-top: 8px !important;
  margin-bottom: 8px !important;
}

/* =====================================================
   FOOTER
   ===================================================== */

.drag-modal-footer {
  padding: 12px 14px;
  padding-right: 22px;

  background: #f8f9fa;
  border-top: 1px solid #e9ecef;

  display: flex;
  justify-content: flex-end;
  gap: 8px;

  margin-top: auto;
}

/* =====================================================
   MINIMIZED
   ===================================================== */

.drag-modal.minimized, .drag-modal.closed {
  pointer-events: none;
  transform: translateY(200vh);
}

/* =====================================================
   RESIZE HANDLE
   ===================================================== */

.drag-modal-resize {
  position: absolute;
  right: 4px;
  bottom: 4px;

  width: 14px;
  height: 14px;

  cursor: se-resize;
  opacity: .4;

  background:#00000069;
  border-radius: 5px;
}

.drag-modal-resize:hover {
  opacity: .8;
  background: black;
}

/* =====================================================
   BACKDROP
   ===================================================== */

.drag-modal-backdrop {
  position: fixed;
  inset: 0;

  background: rgba(0,0,0,.4);
  z-index: 900;
}

/* =====================================================
   TASKBAR BASE
   ===================================================== */

.drag-modal-taskbar {
  position: fixed;
  background: rgba(130,130,130,.27);

  z-index: 5000;
  display: none;
  gap: 6px;
  padding: 6px;

  pointer-events: auto;
  backdrop-filter: blur(6px);
}

/* =====================================================
   TASKBAR BOTTOM
   ===================================================== */

.drag-modal-taskbar.bottom {
  bottom: 0;
  left: 0;
  right: 0;

  height: 42px;

  flex-direction: row;
  align-items: center;
}

/* =====================================================
   TASKBAR RIGHT (AUTO-HIDE)
   ===================================================== */

.drag-modal-taskbar.right {
  top: 50%;
  right: 0;

  transform: translateY(-50%);

  flex-direction: column;
  width: 38px;
  max-height: 70vh;

  overflow: hidden;
  border-radius: 6px 0 0 6px;

  transition: width .25s ease;
}

.drag-modal-taskbar.right:hover {
  width: 160px;
}

/* =====================================================
   TASKBAR BUTTONS
   ===================================================== */

.drag-modal-taskbar button {
  background: rgba(30,30,30,.45);
  color: #fff;

  border: none;
  padding: 6px;
  border-radius: 4px;

  cursor: pointer;

  text-align: left;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;

  transition: background .2s ease;
}

.drag-modal-taskbar button:hover {
  background: #2b2b2b;
}
