/* Berthing Schedule */
.berthing-content {
    display: flex;
    flex-direction: column;
    height: 100%;
    gap: 15px;
}

.header-dashboard {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background-color: white;
  padding: 20px 35px;
  border-radius: 20px;
    box-shadow: rgba(0, 0, 0, 0.1) 0px 4px 12px;
}

.header-left,
.header-right {
    display: flex;
    align-items: center;
}

.icon-dashboard {
  font-size: 42px;
  margin-right: 18px;
    color: #074173;
}

.period-text {
    font-weight: bold;
  font-size: 28px;
    color: #074173;
}

.filter-buttons {
    display: flex;
  gap: 15px;
}

.filter-btn {
  padding: 15px 30px;
    border: 2px solid #074173;
    background: white;
    color: #074173;
  font-size: 18px;
    font-weight: 700;
  border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.filter-btn:hover {
    background: #f0f0f0;
}

.filter-btn.active {
    background: #074173;
    color: white;
}

.filter-btn i {
  margin-right: 8px;
  font-size: 20px;
}

.header-right {
  gap: 30px;
}

.update-info {
    display: flex;
    align-items: center;
}

.update-info .last-update-badge {
    display: flex;
    align-items: center;
  gap: 12px;
  padding: 12px 24px;
  border-radius: 25px;
  font-size: 18px;
    font-weight: 500;
    background: #f0f0f0;
    color: #666;
}

.update-info .last-update-badge #last-update-time {
  font-size: 20px;
  font-weight: 600;
}

.update-info .last-update-badge i {
  font-size: 20px;
}

.update-info .last-update-badge i {
    color: #888;
}

.loading-dashboard {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    gap: 20px;
    color: #074173;
}

.loading-dashboard .loading-spinner {
  width: 80px;
  height: 80px;
  border: 6px solid #e0e0e0;
    border-top-color: #074173;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

.loading-dashboard p {
  font-size: 24px;
}

@keyframes spin {
  0% {
    transform: rotate(0deg);
  }
  100% {
    transform: rotate(360deg);
  }
}

.dashboard-wrapper {
    width: 100%;
  height: calc(100vh - 280px);
    overflow: auto;
    position: relative;
    padding: 0;
    margin: 0;
    background-color: #ededed;
  border-radius: 20px;
    box-shadow: rgba(0, 0, 0, 0.1) 0px 4px 12px;
}

#dashboard-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: auto;
  min-width: 3600px;
    padding: 0;
    margin: 0;
    background-color: #ededed;
}

.bercos-grid {
    display: flex;
    width: 100%;
  max-width: 3600px;
    margin: 0 auto;
}

#bercos-superiores,
#bercos-inferiores {
    display: flex;
    width: 100%;
}

.berco {
    color: green;
    font-weight: bold;
    text-align: center;
    display: flex;
    flex-direction: column;
    padding: 5px;
  padding-left: 95px;
    gap: 20px;
}

#bercos-superiores .berco {
    justify-content: flex-end;
}

#bercos-inferiores .berco {
    justify-content: flex-start;
}

.coluna-bercos-1,
.coluna-bercos-2,
.coluna-bercos-3,
.coluna-bercos-4 {
    align-items: center;
}

#pier-wrapper {
    display: block;
    width: 100%;
  max-width: 3600px;
  margin: 20px auto 0 auto;
  transform: scale(0.92);
  transform-origin: center top;
}

#pier-background {
    width: 100%;
    height: auto;
}

/* Navio Container */
.navio-container {
    position: relative;
  width: 550px;
    font-family: Arial, sans-serif;
    cursor: pointer;
    transition: transform 0.2s;
}

.navio-container table,
.navio-container-cg table,
.navio-tabela,
.navio-tabela-invertida {
    display: none !important;
}

.navio-container:hover {
    transform: scale(1.05);
}

.navio-img {
    width: 125%;
    display: block;
}

.navio-container-cg {
    position: relative;
  width: 550px;
    font-family: Arial, sans-serif;
    cursor: pointer;
    transition: transform 0.2s;
}

.navio-container-cg:hover {
    transform: scale(1.05);
}

.navio-img-cg {
  height: 230px;
    display: block;
}

.navio-overlay-cg {
    position: absolute;
  top: 33px;
  left: 82px;
    width: 100%;
  padding: 9px;
    box-sizing: border-box;
  font-size: 18px;
    color: black;
}

.navio-viagem-cg {
  font-size: 20px;
    position: absolute;
    left: 0;
  top: 22px;
    display: block;
    font-weight: normal;
    color: #074173;
}

.navio-nome-cg {
  font-size: 20px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  max-width: 247px;
    text-align: left;
}

.navio-obs-cg {
  width: 156px;
  height: 101px;
    background-color: transparent;
  padding: 4px 6px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.navio-obs-cg-text {
  font-size: 16px;
    line-height: 1.2;
    font-weight: bold;
    color: #074173;
    text-align: justify;
    text-justify: inter-word;
    text-align-last: left;
    display: -webkit-box;
    -webkit-line-clamp: 5;
    line-clamp: 5;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
    word-break: break-word;
    hyphens: auto;
}

.navio-overlay {
    position: absolute;
  top: 24px;
  left: 101px;
    width: 100%;
  padding: 9px;
    box-sizing: border-box;
  font-size: 20px;
    color: black;
}

.navio-header {
    position: relative;
    display: block;
  line-height: 26px;
  margin-bottom: 9px;
  margin-top: 4px;
    align-items: center;
    display: flex;
    color: #074173;
}

.navio-nome {
  font-size: 20px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  max-width: 293px;
    text-align: left;
}

.navio-viagem {
    position: absolute;
    left: 0;
  top: 26px;
    display: block;
    font-weight: bold;
    color: #074173;
  font-size: 20px;
}

.navio-body {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    justify-content: space-between;
}

.navio-body-cg {
    display: flex;
    align-items: stretch;
    gap: 5px;
}

.navio-datas-cg {
    width: auto;
  font-size: 18px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: flex-start;
    text-align: left;
  margin-top: 18px;
    margin-right: 0px;
}

.navio-datas-cg div {
  margin-bottom: 5px;
    line-height: 1.4;
}

.navio-datas {
    text-align: left;
    flex: 1;
  margin-top: 22px;
  min-width: 220px;
  font-size: 20px;
}

.navio-datas div {
  margin-bottom: 5px;
    line-height: 1.4;
}

.navio-operacao {
  font-size: 20px;
    font-weight: bold;
    color: black;
    text-align: center;
  margin-left: 64px;
  margin-top: -18px;
}

.navio-operacao-cg {
  font-size: 20px;
    font-weight: bold;
    color: black;
    text-align: center;
  margin-top: -18px;
}

.navio-guindaste {
  width: 73px;
  height: 73px;
    margin-right: 0px;
  margin-top: 7px;
    flex-shrink: 0;
}

.navio-guindaste-cg {
  width: 64px;
  height: 64px;
  margin-top: 4px;
  margin-left: 33px;
}

.navio-sequencia {
    position: absolute;
  left: 9px;
    top: 36%;
  font-size: 36px;
    font-weight: bold;
    color: white;
  padding: 4px 7px;
  border-radius: 5px;
    white-space: nowrap;
}

.navio-sequencia-cg {
    position: absolute;
  left: 4px;
    top: 35.5%;
  font-size: 36px;
    font-weight: bold;
    color: white;
  padding: 4px 7px;
  border-radius: 5px;
    white-space: nowrap;
}

/* Modal */
.modal-navio-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    z-index: 9999;
    justify-content: center;
    align-items: center;
}

.modal-navio-overlay.active {
    display: flex;
}

.modal-navio-content {
    position: relative;
    background-color: white;
    padding: 20px;
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    animation: zoomIn 0.3s ease;
}

@keyframes zoomIn {
    from {
        transform: scale(0.5);
        opacity: 0;
    }
    to {
        transform: scale(1);
        opacity: 1;
    }
}

.modal-navio-close {
    position: absolute;
    top: 10px;
    right: 10px;
    font-size: 30px;
    font-weight: bold;
    color: #333;
    cursor: pointer;
    background: none;
    border: none;
    z-index: 10000;
}

.modal-navio-close:hover {
    color: #ff0000;
}

.navio-container-modal {
    transform: scale(2);
    pointer-events: none;
}

.navio-container-cg-modal {
    transform: scale(2);
    pointer-events: none;
}

.navio-container-modal .navio-operacao,
.navio-container-modal .navio-operacao-cg {
    color: #ffffff;
}

/* Balsa */
.navio-container.is-balsa {
    overflow: visible;
}

.navio-container.is-balsa .navio-img {
    width: 138%;
  margin-left: -37px;
}

.navio-container.is-balsa .navio-sequencia {
  left: 18px;
}

.navio-container.is-balsa .navio-guindaste {
  width: 73px;
  height: 73px;
  margin-top: 7px;
    margin-right: 0px;
}

.navio-container.is-balsa .navio-body {
  gap: 18px;
    justify-content: space-between;
}

.navio-container.is-balsa .navio-nome {
  max-width: 293px;
}

.navio-container.is-balsa .navio-datas {
  margin-top: 22px;
}

.legend-container {
  position: fixed;
  bottom: 60px;
  right: 45px;
  width: 260px;
  background: rgba(255, 255, 255, 0.98);
  backdrop-filter: blur(10px);
  border-radius: 16px;
  box-shadow: 0 8px 32px rgba(7, 65, 115, 0.15);
  border: 1px solid rgba(7, 65, 115, 0.1);
  z-index: 1000;
  user-select: none;
  overflow: hidden;
  cursor: move;
  transition: box-shadow 0.3s ease;
}

.legend-container * {
  cursor: move;
}

.legend-container:hover {
  box-shadow: 0 10px 40px rgba(7, 65, 115, 0.2);
}

.legend-container.dragging {
  cursor: grabbing;
  box-shadow: 0 12px 48px rgba(7, 65, 115, 0.25);
}

.legend-header {
  display: flex;
  align-items: center;
  padding: 14px 18px;
  background: linear-gradient(135deg, #074173 0%, #0a5a9a 100%);
  color: white;
  font-weight: 600;
  font-size: 15px;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  pointer-events: none;
}

.legend-header i.fa-info-circle {
  margin-right: 10px;
  font-size: 16px;
  opacity: 0.95;
}

.legend-body {
  padding: 18px;
  background: #fafbfc;
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 14px;
  background: white;
  border-radius: 10px;
  border-left: 4px solid #1dd200;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.legend-item:hover {
  transform: translateX(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.legend-icon {
  width: 38px;
  height: 38px;
  object-fit: contain;
  flex-shrink: 0;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.1));
}

.legend-item span {
  font-size: 14px;
  color: #2c3e50;
  font-weight: 600;
  letter-spacing: 0.3px;
}

@media (max-width: 1920px) {
  .legend-container {
    width: 240px;
    bottom: 50px;
    right: 35px;
  }

  .legend-header {
    padding: 12px 16px;
    font-size: 14px;
  }

  .legend-body {
    padding: 16px;
  }

  .legend-item {
    padding: 10px 12px;
  }

  .legend-icon {
    width: 34px;
    height: 34px;
  }

  .legend-item span {
    font-size: 13px;
  }
}

@media (max-width: 1366px) {
  .legend-container {
    width: 220px;
    bottom: 45px;
    right: 25px;
  }

  .legend-header {
    padding: 11px 14px;
    font-size: 13px;
  }

  .legend-body {
    padding: 14px;
  }

  .legend-item {
    padding: 9px 11px;
  }

  .legend-icon {
    width: 32px;
    height: 32px;
  }

  .legend-item span {
    font-size: 12px;
  }
}

@media (max-width: 1024px) {
  .legend-container {
    width: 200px;
    bottom: 40px;
    right: 20px;
  }

  .legend-header {
    padding: 10px 12px;
    font-size: 12px;
  }

  .legend-body {
    padding: 12px;
  }

  .legend-item {
    padding: 8px 10px;
  }

  .legend-icon {
    width: 30px;
    height: 30px;
  }

  .legend-item span {
    font-size: 11px;
  }
}

@media (max-width: 768px) {
  .legend-container {
    width: 180px;
    bottom: 35px;
    right: 15px;
  }

  .legend-header {
    padding: 9px 11px;
    font-size: 11px;
  }

  .legend-body {
    padding: 10px;
  }

  .legend-item {
    padding: 7px 9px;
  }

  .legend-icon {
    width: 28px;
    height: 28px;
  }

  .legend-item span {
    font-size: 10px;
  }
}
