/* Gantt Chart Styles*/

/* Header Bar */
.header {
  background: #2c3e50 !important;
  color: white;
  padding: 15px 25px;
  margin: -20px -20px 25px -20px; /* Negative margins for full width */
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
  display: flex;
  align-items: center;
  position: relative;
  z-index: 1000;
}

.header-title {
  font-size: 1.5rem;
  font-weight: 600;
  letter-spacing: 0.5px;
  margin: 0 30px 0 0; /* Space between title and controls */
  padding: 5px 0;
}

/* Adjust controls container */
.controls {
  margin: 0;
  padding: 0;
  gap: 8px;
  align-items: center;
}

/* Modified body padding */
body {
  padding: 0 20px 20px 20px !important;
  margin: 0;
}

body {
  font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
  background-color: #f5f6fa;
  margin: 0;
  padding: 20px;
}

/* Timeline container */
/* Note height is set to 800px for Gantt for full screen */
#timeline {
  width: 100%;
  height: 800px; /*Adjusted up from 500px*/
  background: white;
  border-radius: 8px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
  border: 1px solid #e0e0e0;
  margin: 20px 0;
  overflow: hidden;
  position: relative;
  padding-top: 50px; /* Add top padding */
  height: calc(800px - 30px); /* Reduce height by padding amount */
}

/* Control bar */
.controls {
  background: #ffffff;
  padding: 12px 20px;
  border-radius: 8px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.05);
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 20px;
}

/* Buttons */
button {
  padding: 8px 16px;
  background: linear-gradient(to bottom, #4a90e2, #357abd);
  color: white;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  font-size: 14px;
  font-weight: 500;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  gap: 6px;
}

button:hover {
  background: linear-gradient(to bottom, #357abd, #2a65a0);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

button:active {
  transform: translateY(1px);
}

/* File input */
input[type="file"] {
  padding: 8px 16px;
  background: linear-gradient(to bottom, #6c757d, #5a6268);
  color: white;
  border-radius: 4px;
  cursor: pointer;
  position: relative;
  overflow: hidden;
  transition: all 0.2s ease;
}

input[type="file"]:hover {
  background: linear-gradient(to bottom, #5a6268, #495057);
}

input[type="file"]::-webkit-file-upload-button {
  visibility: hidden;
}

/* Icons (add font awesome link in HTML for icons) */
button i {
  font-size: 14px;
}

/* Responsive design */
@media (max-width: 768px) {
  .controls {
    padding: 10px;
    gap: 8px;
  }

  button,
  input[type="file"] {
    font-size: 13px;
    padding: 6px 12px;
  }
}

/* Custom current time line */
.vis-current-time {
  background-color: #ff4757 !important;
  width: 2px !important;
  z-index: 1000;
}

.vis-current-time.live {
  animation: pulse 1s infinite;
}

@keyframes pulse {
  0% {
    opacity: 1;
  }
  50% {
    opacity: 0.5;
  }
  100% {
    opacity: 1;
  }
}

/* Context Menu */
.context-menu {
  position: absolute;
  background: white;
  border: 1px solid #ddd;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
  z-index: 10000;
  min-width: 160px;
  display: none;
  font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
}

.context-menu-item {
  padding: 8px 16px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  color: #333;
}

.context-menu-item:hover {
  background: #f5f6fa;
}

.context-menu-item i {
  width: 18px;
  color: #666;
}

.context-menu-divider {
  border-top: 1px solid #eee;
  margin: 4px 0;
}

/* Shipment coloring */

/* Regular shipment color (blue) */
.shipment-event {
  background-color: #64b5f6 !important;
  border-color: #1976d2 !important;
}

/* Other color for maintenance or gaps (red) */
.other-event {
  background-color: #db8f0d !important;
  border-color: #db8f0d !important;
}

.vis-item.vis-range .vis-item-content {
  padding: 5px;
  font-weight: 500;
  color: #fff;
}

/* When select Gantt item change to yellow highlight */
.vis-item.vis-selected {
  background-color: #ffeb3b !important;
  border-color: #fbc02d !important;
}

.context-menu {
  z-index: 10000; /* Ensure menu appears above timeline */
}

/* Enable selection */
.vis-item {
  cursor: pointer;
  user-select: none;
}

.context-menu-buttons {
  margin-top: 10px;
}

.delete-btn {
  background: #ff4444 !important;
  margin-top: 5px;
  width: 100%;
}

.delete-btn:hover {
  background: #cc0000 !important;
}

.context-menu-main {
  padding: 8px 0;
}

.context-menu-header {
  display: flex;
  align-items: center;
  margin-bottom: 15px;
  padding-bottom: 10px;
  border-bottom: 1px solid #eee;
}

.context-menu-header h4 {
  margin: 0 auto;
}

.back-btn {
  background: none;
  border: none;
  padding: 5px;
  cursor: pointer;
  color: #666;
}

.back-btn:hover {
  color: #333;
}

.context-menu-form {
  padding: 10px;
  min-width: 220px;
}

.context-menu-item {
  padding: 8px 16px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  color: #333;
}

.context-menu-item:hover {
  background: #f5f6fa;
}

.context-menu-divider {
  border-top: 1px solid #eee;
  margin: 4px 0;
}

/* Textfield form for volume*/
.form-group input[type="number"] {
  width: 100%;
  padding: 6px;
  border: 1px solid #ddd;
  border-radius: 4px;
  appearance: textfield; /* Standard property */
}

.form-group input[type="number"]::-webkit-outer-spin-button,
.form-group input[type="number"]::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

/* Tooltip for on hover */
.tooltip {
  position: absolute;
  background: white;
  border: 1px solid #ccc;
  padding: 12px;
  border-radius: 4px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
  pointer-events: none;
  z-index: 10000;
  min-width: 200px;
  display: none;
}

.tooltip-arrow {
  position: absolute;
  width: 10px;
  height: 10px;
  background: white;
  transform: rotate(45deg);
  border-right: 1px solid #ccc;
  border-bottom: 1px solid #ccc;
  top: -5px;
  left: 20px;
}

.tooltip-content div {
  margin: 4px 0;
  padding: 4px 0;
  border-bottom: 1px solid #eee;
  line-height: 1.4;
}

.tooltip-content div:last-child {
  border-bottom: none;
}

.tooltip strong {
  display: inline-block;
  width: 60px;
  color: #666;
}

/* On hover tooltip */
.vis-panel.vis-left {
  width: 120px !important; /* Make berth labels column wider */
}

.vis-item {
  cursor: pointer;
  transition: transform 0.2s ease;
}

.vis-item:hover {
  transform: scale(1.02);
  z-index: 1000;
}

/* Sheet selector styling */
.sheet-selector {
  padding: 8px 16px;
  border: 1px solid #ddd;
  border-radius: 4px;
  background: white;
  margin-left: 10px;
}

#sheetContainer {
  margin-top: 10px;
}

/* Multi-select */
button.active-multiselect {
  background: #4caf50;
  color: white;
}

.context-menu.multiselect-context {
  min-width: 200px;
}

/* Selection box styling */
.vis-selectable {
  cursor: crosshair !important;
}

.vis-selectable .vis-selection {
  background-color: rgba(255, 0, 0, 0.1) !important;
  border: 2px solid #ff0000 !important;
  border-radius: 4px;
}

.vis-selection {
  border: 2px solid #ff0000 !important;
  background-color: rgba(255, 0, 0, 0.1) !important;
  z-index: 1000;
  display: block !important;
}

/* Prevent glitches when moving */
.vis-item {
  transition: none !important;
}

/* Overlap warning */
.vis-item.overlap-event {
  background-color: #ffcccc !important;
  border-color: #ff0000 !important;
}

.selection-box {
  position: absolute;
  border: 2px dashed #ff0000;
  background-color: rgba(255, 0, 0, 0.1);
  z-index: 1000;
}
