/**
 * @file tts-imbarco-veicoli.css
 * Stili modale Imbarco Veicoli per pannelli LCD
 */

/* ===== MODAL OVERLAY ===== */
.iv-modal-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.6);
  z-index: 10001;
  justify-content: center;
  align-items: center;
}

/* ===== MODAL CONTENT ===== */
.iv-modal-content {
  background: #fff;
  border-radius: 8px;
  box-shadow: 0 4px 30px rgba(0, 0, 0, 0.4);
  width: 90%;
  max-width: 850px;
  max-height: 90vh;
  overflow-y: auto;
  position: relative;
}

/* ===== CLOSE BUTTON ===== */
.iv-close-btn {
  position: absolute;
  top: 10px;
  right: 14px;
  font-size: 24px;
  color: #999;
  background: none;
  border: none;
  cursor: pointer;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  z-index: 1;
}

.iv-close-btn:hover {
  background: #f1f1f1;
  color: #333;
}

/* ===== HEADER ===== */
.iv-modal-header {
  padding: 16px 20px;
  border-bottom: 2px solid #e67e22;
  background: linear-gradient(135deg, #2c3e50, #34495e);
}

.iv-title {
  color: #fff;
  margin: 0 0 8px;
  font-size: 16px;
  font-weight: 700;
}

.iv-transit-info {
  color: #ddd;
  font-size: 13px;
}

.iv-info-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
}

.iv-info-item {
  padding: 2px 8px;
  background: rgba(255,255,255,0.1);
  border-radius: 4px;
}

.iv-info-status {
  margin-top: 6px;
  color: #f0ad4e;
  font-size: 12px;
}

/* ===== BODY ===== */
.iv-modal-body {
  padding: 16px 20px;
}

.iv-section {
  margin-bottom: 16px;
}

.iv-section-title {
  font-weight: 700;
  font-size: 13px;
  color: #2c3e50;
  margin-bottom: 8px;
  border-bottom: 1px solid #eee;
  padding-bottom: 4px;
}

.iv-label {
  font-weight: 600;
  font-size: 12px;
  color: #555;
  margin-right: 8px;
}

/* ===== LANE SELECTOR ===== */
.iv-lane-selector {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 10px;
}

.iv-lane-buttons {
  display: flex;
  gap: 6px;
}

.iv-lane-btn {
  width: 48px;
  height: 36px;
  border: 2px solid #bbb;
  border-radius: 6px;
  background: #f8f9fa;
  font-weight: 700;
  font-size: 14px;
  color: #333;
  cursor: pointer;
  transition: all 0.2s ease;
}

.iv-lane-btn:hover {
  border-color: #e67e22;
  background: #fff3e6;
}

.iv-lane-btn.iv-lane-active {
  border-color: #e67e22;
  background: #e67e22;
  color: #fff;
}

.iv-lane-btn.iv-lane-shared {
  border: 2px dashed #e67e22;
  color: #e67e22;
  background: #fff8f0;
}

.iv-lane-btn.iv-lane-shared.iv-lane-active {
  border-style: solid;
  background: #e67e22;
  color: #fff;
}

.iv-lane-btn.iv-lane-shared small,
.iv-lane-btn.iv-lane-full small {
  font-size: 8px;
  display: block;
  line-height: 1;
  font-weight: 400;
}

.iv-lane-btn.iv-lane-full {
  border-color: #ccc;
  background: #eee;
  color: #999;
  cursor: not-allowed;
  opacity: 0.6;
}

.iv-crowd-info {
  background: #fff3cd;
  border: 1px solid #ffc107;
  border-radius: 4px;
  padding: 6px 10px;
  margin-bottom: 8px;
  font-size: 12px;
  color: #856404;
}

.iv-checkbox-label {
  font-size: 12px;
  color: #555;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 4px;
}

/* ===== STATUS SELECTOR ===== */
.iv-status-selector {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
}

#iv-status-select {
  padding: 4px 8px;
  border: 1px solid #ccc;
  border-radius: 4px;
  font-size: 12px;
}

/* ===== ACTIVE SHIPS ===== */
.iv-active-ships {
  margin-bottom: 10px;
}

.iv-active-ships-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
}

.iv-ship-badge {
  display: inline-block;
  padding: 3px 8px;
  background: #e8f4f8;
  border: 1px solid #b3d7e8;
  border-radius: 12px;
  font-size: 11px;
  color: #2c3e50;
}

.iv-ship-badge.iv-ship-current {
  background: #d4edda;
  border-color: #28a745;
  font-weight: 700;
}

.iv-ship-delete-btn {
  background: none;
  border: none;
  color: #c0392b;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  padding: 0 2px;
  margin-left: 4px;
  line-height: 1;
  vertical-align: middle;
}

.iv-ship-delete-btn:hover {
  color: #e74c3c;
}

.iv-info-note {
  font-size: 12px;
  color: #888;
  font-style: italic;
}

/* ===== MAIN PREVIEW ===== */
.iv-main-preview-wrapper {
  text-align: center;
  margin-top: 8px;
}

#iv-main-canvas {
  border: 3px solid #00cccc;
  background: #000;
  image-rendering: pixelated;
  width: 100%;
  max-width: 528px;
  height: auto;
}

/* ===== CORSIE SELECTOR ===== */
.iv-corsie-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 6px;
  margin-bottom: 10px;
}

.iv-corsia-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 6px;
  border: 1px solid #ddd;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s;
  font-size: 11px;
}

.iv-corsia-item:hover {
  border-color: #e67e22;
  background: #fff8f0;
}

.iv-corsia-item.iv-corsia-disabled {
  opacity: 0.5;
  cursor: not-allowed;
  background: #f5f5f5;
}

.iv-corsia-label {
  font-weight: 700;
  color: #2c3e50;
}

.iv-corsia-occ {
  font-size: 10px;
  color: #e74c3c;
  margin-top: 2px;
}

/* ===== CORSIE PREVIEW ===== */
.iv-corsie-preview {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: center;
  margin-top: 8px;
}

.iv-corsia-preview-item {
  text-align: center;
}

.iv-corsia-canvas {
  border: 2px solid #00cccc;
  background: #000;
  width: 112px;
  height: 144px;
}

.iv-corsia-preview-label {
  font-size: 11px;
  font-weight: 700;
  margin-top: 2px;
  color: #555;
}

/* ===== FOOTER ===== */
.iv-modal-footer {
  padding: 12px 20px;
  border-top: 1px solid #eee;
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  background: #f8f9fa;
  border-radius: 0 0 8px 8px;
}

.iv-btn {
  padding: 8px 20px;
  border: none;
  border-radius: 6px;
  font-weight: 700;
  font-size: 13px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.iv-btn-cancel {
  background: #e9ecef;
  color: #495057;
}

.iv-btn-cancel:hover {
  background: #dee2e6;
}

.iv-btn-publish {
  background: #e67e22;
  color: #fff;
}

.iv-btn-publish:hover:not(:disabled) {
  background: #d35400;
}

.iv-btn-publish:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* ===== SHOW ALL TOGGLE ===== */
.iv-show-all-wrapper {
  margin-bottom: 12px;
  padding: 8px 12px;
  background: #f0f4f8;
  border: 1px solid #d0d8e0;
  border-radius: 6px;
}

.iv-show-all-toggle {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  font-size: 13px;
  font-weight: 600;
  color: #2c3e50;
  user-select: none;
}

.iv-show-all-toggle input[type="checkbox"] {
  width: 16px;
  height: 16px;
  accent-color: #e67e22;
  cursor: pointer;
}

.iv-toggle-label {
  flex: 1;
}

#iv-departures-count {
  font-weight: 400;
  color: #888;
  font-size: 12px;
}

/* ===== DEPARTURES LIST (accordion multi-nave) ===== */
.iv-departures-list {
  max-height: 320px;
  overflow-y: auto;
  margin-bottom: 12px;
  border: 1px solid #e0e0e0;
  border-radius: 6px;
}

/* ===== SHIP ROW ===== */
.iv-ship-row {
  border-bottom: 1px solid #eee;
  transition: background 0.15s, border-color 0.15s;
}

.iv-ship-row:last-child {
  border-bottom: none;
}

.iv-ship-row:hover {
  background: #fafafa;
}

.iv-ship-row.iv-ship-trigger {
  box-shadow: inset 3px 0 0 #e67e22;
}

.iv-ship-row.iv-ship-assigned {
  box-shadow: inset 3px 0 0 #28a745;
}

.iv-ship-row.iv-ship-trigger.iv-ship-assigned {
  box-shadow: inset 3px 0 0 #e67e22;
}

.iv-ship-row.iv-ship-checked {
  background: #fff8f0;
}

/* ===== SHIP HEADER (checkbox + info) ===== */
.iv-ship-header {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  cursor: pointer;
}

.iv-ship-checkbox {
  flex-shrink: 0;
}

.iv-ship-checkbox input[type="checkbox"] {
  width: 16px;
  height: 16px;
  accent-color: #e67e22;
  cursor: pointer;
}

.iv-ship-info {
  flex: 1;
  font-size: 12px;
  color: #333;
  line-height: 1.4;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 10px;
}

.iv-ship-info strong {
  color: #2c3e50;
  font-size: 13px;
}

.iv-ship-status-badge {
  display: inline-block;
  padding: 1px 6px;
  border-radius: 10px;
  font-size: 10px;
  font-weight: 700;
}

.iv-ship-status-badge.iv-badge-active {
  background: #d4edda;
  color: #155724;
  border: 1px solid #c3e6cb;
}

/* ===== SHIP CONFIG (expandable per-ship panel) ===== */
.iv-ship-config {
  padding: 8px 12px 10px 40px;
  background: #f8f9fa;
  border-top: 1px solid #eee;
}

.iv-ship-lane-row {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-wrap: wrap;
  margin-bottom: 6px;
}

.iv-ship-lane-btn {
  width: 40px;
  height: 28px;
  border: 2px solid #bbb;
  border-radius: 4px;
  background: #fff;
  font-weight: 700;
  font-size: 12px;
  color: #333;
  cursor: pointer;
  transition: all 0.15s ease;
  padding: 0;
}

.iv-ship-lane-btn:hover {
  border-color: #e67e22;
  background: #fff3e6;
}

.iv-ship-lane-btn.iv-lane-active {
  border-color: #e67e22;
  background: #e67e22;
  color: #fff;
}

.iv-ship-lane-btn.iv-lane-shared {
  border: 2px dashed #e67e22;
  color: #e67e22;
  background: #fff8f0;
}

.iv-ship-lane-btn.iv-lane-shared.iv-lane-active {
  border-style: solid;
  background: #e67e22;
  color: #fff;
}

.iv-ship-lane-btn.iv-lane-full {
  border-color: #ccc;
  background: #eee;
  color: #999;
  cursor: not-allowed;
  opacity: 0.6;
}

.iv-ship-lane-btn small {
  font-size: 7px;
  display: block;
  line-height: 1;
  font-weight: 400;
}

.iv-ship-status {
  padding: 3px 6px;
  border: 1px solid #ccc;
  border-radius: 4px;
  font-size: 11px;
  margin-left: 8px;
}

.iv-ship-solo-label {
  font-size: 11px;
  color: #555;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 3px;
  margin-left: 8px;
}

.iv-ship-corsie-row {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 10px;
  margin-top: 6px;
}

.iv-ship-corsia-label {
  font-size: 11px;
  color: #555;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 3px;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 600px) {
  .iv-modal-content {
    width: 95%;
    max-height: 95vh;
  }

  .iv-corsie-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .iv-lane-selector {
    flex-direction: column;
    align-items: flex-start;
  }

  .iv-ship-config {
    padding-left: 12px;
  }

  .iv-ship-info {
    font-size: 11px;
  }
}
