/* Updated Cargo Planner Styles to match new UI */

/* Tab button styling */
.tab-button {
  color: var(--primary-blue);
  font-weight: 600;
  transition: all 0.3s ease;
  background-color: #f1f5f9;
  text-align: center;
  border: 1px solid #e2e8f0;
  border-bottom: none;
}

.tab-button:hover {
  color: var(--accent-red);
  background-color: #f8fafc;
}

.tab-button.active {
  color: white;
  background-color: var(--accent-red);
  border-color: var(--accent-red);
}

/* Cargo List Item Styles */
.cargo-list-item {
  border-left: 3px solid var(--primary-blue);
  transition: all 0.2s ease;
  border-radius: 6px;
}

.cargo-list-item:hover {
  background-color: rgba(36, 32, 89, 0.05);
  transform: translateY(-2px);
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
}

.cargo-list-item.fragile {
  border-left-color: var(--accent-red);
}

/* Form Input Focus Styles */
input:focus,
select:focus,
textarea:focus {
  outline: none;
  border-color: var(--primary-blue);
  box-shadow: 0 0 0 2px rgba(36, 32, 89, 0.2);
}

/* Button styles to match new UI */
#btn-optimize,
#btn-reset,
#cargo-form button[type="submit"],
#btn-export {
  background-color: var(--accent-red);
  color: white;
  opacity: 1 !important;
  visibility: visible !important;
  position: relative;
  z-index: 5;
  border-radius: 30px;
  font-weight: 600;
  padding: 10px 20px;
  transition: all 0.3s ease;
  display: flex !important;
  align-items: center;
  justify-content: center;
}

#btn-optimize {
  background-color: var(--primary-blue);
}

#btn-reset {
  background-color: #6b7280;
}

#btn-export {
  position: relative;
  background-color: white;
  border: 2px solid var(--primary-blue);
  color: var(--primary-blue);
  transition: background-color 0.3s ease, color 0.3s ease, transform 0.3s ease;
  overflow: visible; /* Ensure content remains visible */
  display: flex !important;
  align-items: center;
  justify-content: center;
}

#btn-export i {
  margin-right: 8px;
  transition: color 0.3s ease;
}

#btn-export:hover {
  background-color: var(--primary-blue);
  color: white !important;
  transform: translateY(-2px);
}

#btn-export:hover i,
#btn-export:hover span {
  color: white !important;
  opacity: 1 !important;
  visibility: visible !important;
}

.submit-btn:before,
#btn-optimize:before,
#btn-reset:before,
#btn-export:before {
  display: none !important;
}

#cargo-form button[type="submit"]:hover,
#btn-optimize:hover,
#btn-reset:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
}

/* Container dimensions visibility */
.container-dimensions,
.container-capacity {
  background-color: #f7fafc;
  border-radius: 0.25rem;
  padding: 0.75rem;
  margin-bottom: 1rem;
  border: 1px solid #e2e8f0;
}

.container-dimensions .font-bold,
.container-capacity .font-bold {
  color: var(--primary-blue);
}

/* Checkbox styling to match new UI */
input[type="checkbox"] {
  appearance: none;
  -webkit-appearance: none;
  width: 18px;
  height: 18px;
  border: 2px solid #cbd5e0;
  border-radius: 4px;
  outline: none;
  cursor: pointer;
  position: relative;
  background-color: white;
  transition: all 0.2s ease;
}

input[type="checkbox"]:checked {
  background-color: var(--primary-blue);
  border-color: var(--primary-blue);
}

input[type="checkbox"]:checked::after {
  content: "";
  position: absolute;
  top: 2px;
  left: 5px;
  width: 6px;
  height: 10px;
  border: solid white;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}

/* Canvas container */
#visualization-canvas {
  background-color: #f9fafb;
  cursor: grab;
  width: 100% !important;
  height: 100% !important;
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}

#visualization-canvas:active {
  cursor: grabbing;
}

/* Visualization container */
.visualization-container {
  position: relative;
  height: 400px;
  max-height: 400px;
  border: 1px solid #e2e8f0;
  margin-top: 0.5rem;
  overflow: hidden;
  border-radius: 8px;
}

/* Loading spinner animation */
.loading-spinner {
  border: 3px solid rgba(255, 255, 255, 0.3);
  border-radius: 50%;
  border-top: 3px solid var(--accent-red);
  width: 24px;
  height: 24px;
  animation: spin 1s linear infinite;
  display: inline-block;
}

@keyframes spin {
  0% {
    transform: rotate(0deg);
  }
  100% {
    transform: rotate(360deg);
  }
}
