/* Road Condition Preview Panel */
.road-condition-preview-panel {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 85%;
  max-width: 1400px;
  height: 80vh;
  max-height: 800px;
  background: white;
  border: 3px solid #00555F;
  border-radius: 16px;
  box-shadow: 0 10px 40px rgba(0, 85, 95, 0.3), 0 0 0 1000px rgba(0, 0, 0, 0.5);
  z-index: 8000;
  display: none;
  flex-direction: column;
  overflow: hidden;
  animation: slideIn 0.3s ease-out;
}

@keyframes slideIn {
  from {
    opacity: 0;
    transform: translate(-50%, -45%);
  }
  to {
    opacity: 1;
    transform: translate(-50%, -50%);
  }
}

.road-condition-preview-header {
  padding: 20px 28px;
  background: linear-gradient(135deg, #00555F 0%, #007a8a 100%);
  color: white;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 2px solid #003d45;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.road-condition-preview-header h3 {
  margin: 0;
  font-size: 22px;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 12px;
  letter-spacing: 0.5px;
}

.road-condition-preview-header h3 i {
  font-size: 24px;
  opacity: 0.95;
}

.road-condition-preview-header .segment-info {
  font-size: 15px;
  opacity: 0.95;
  font-weight: 500;
  margin-left: 8px;
  padding-left: 12px;
  border-left: 2px solid rgba(255, 255, 255, 0.4);
}

.road-condition-preview-close {
  background: none;
  border: none;
  color: white;
  font-size: 28px;
  cursor: pointer;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 4px;
  transition: background 0.2s;
  line-height: 1;
}

.road-condition-preview-close:hover {
  background: rgba(255, 255, 255, 0.2);
}

.road-condition-preview-content {
  display: flex;
  flex: 1;
  overflow: hidden;
}

/* Segment List */
.segment-list {
  width: 280px;
  background: linear-gradient(to bottom, #f8f9fa 0%, #f0f1f3 100%);
  border-right: 2px solid #d0d2d6;
  overflow-y: auto;
  flex-shrink: 0;
  box-shadow: 2px 0 8px rgba(0, 0, 0, 0.05);
}

.segment-item {
  padding: 18px 20px;
  border-bottom: 1px solid #e0e0e0;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  display: flex;
  align-items: center;
  gap: 14px;
  position: relative;
}

.segment-item::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  height: 100%;
  width: 4px;
  background: transparent;
  transition: background 0.3s;
}

.segment-item:hover {
  background: linear-gradient(90deg, #e8f4f5 0%, #f8f9fa 100%);
  transform: translateX(4px);
}

.segment-item:hover::before {
  background: #00555F;
}

.segment-item.active {
  background: linear-gradient(90deg, #00555F 0%, #007a8a 100%);
  color: white;
  box-shadow: 0 2px 8px rgba(0, 85, 95, 0.3);
}

.segment-item.active::before {
  background: #ffeb3b;
}

.segment-item.active .segment-condition {
  color: rgba(255, 255, 255, 0.95);
}

.segment-indicator {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 18px;
  color: white;
  flex-shrink: 0;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
  transition: transform 0.3s;
}

.segment-item:hover .segment-indicator {
  transform: scale(1.1);
}

.segment-item.active .segment-indicator {
  box-shadow: 0 4px 12px rgba(255, 255, 255, 0.4);
}

.segment-details {
  flex: 1;
}

.segment-name {
  font-weight: 600;
  font-size: 15px;
  margin-bottom: 6px;
  letter-spacing: 0.3px;
}

.segment-condition {
  font-size: 12px;
  color: #666;
  display: flex;
  align-items: center;
  gap: 6px;
}

.condition-badge {
  padding: 2px 8px;
  border-radius: 10px;
  font-size: 11px;
  font-weight: 600;
}

/* Drive Vision View */
.drive-vision-view {
  flex: 1;
  display: flex;
  flex-direction: column;
  background: linear-gradient(135deg, #1a1a1a 0%, #0a0a0a 100%);
  position: relative;
  overflow: hidden;
}

.drive-vision-image {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #1a1a1a;
  position: relative;
  overflow: hidden;
  min-height: 0;
}

.drive-vision-image img {
  width: auto;
  height: 100%;
  max-width: 100%;
  object-fit: cover;
  border-radius: 4px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
}

.drive-vision-placeholder {
  text-align: center;
  color: #999;
  padding: 40px;
}

.drive-vision-placeholder i {
  font-size: 64px;
  margin-bottom: 16px;
  display: block;
  opacity: 0.5;
}

.drive-vision-placeholder p {
  margin: 0;
  font-size: 16px;
}

.drive-vision-overlay {
  position: absolute;
  top: 20px;
  left: 20px;
  background: rgba(0, 85, 95, 0.95);
  color: white;
  padding: 16px 20px;
  border-radius: 12px;
  backdrop-filter: blur(10px);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.4);
  border: 2px solid rgba(255, 255, 255, 0.2);
  min-width: 250px;
}

.drive-vision-overlay h4 {
  margin: 0 0 12px 0;
  font-size: 18px;
  font-weight: 700;
  letter-spacing: 0.5px;
  border-bottom: 2px solid rgba(255, 255, 255, 0.3);
  padding-bottom: 8px;
}

.drive-vision-overlay .condition-info {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 15px;
  margin-bottom: 12px;
}

.condition-status {
  padding: 6px 14px;
  border-radius: 16px;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.5px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
}

/* Text-only display when no image available */
.drive-vision-text-only {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 40px;
  text-align: center;
  background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
  border-radius: 12px;
  margin: 20px;
  min-height: 400px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
}

.drive-vision-text-only .road-condition-icon {
  margin-bottom: 16px;
}

.drive-vision-text-only h3 {
  margin: 0 0 16px 0;
  color: #333;
  font-size: 24px;
  font-weight: 700;
  letter-spacing: 0.5px;
}

.drive-vision-text-only .condition-badge-large {
  display: inline-block;
  padding: 12px 24px;
  border-radius: 8px;
  color: white;
  font-weight: 700;
  font-size: 18px;
  margin-bottom: 24px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
  text-transform: uppercase;
  letter-spacing: 1px;
}

.drive-vision-text-only .road-condition-details {
  text-align: left;
  background: white;
  padding: 20px 24px;
  border-radius: 12px;
  width: 100%;
  max-width: 400px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
  border: 1px solid #e0e0e0;
}

.drive-vision-text-only .road-condition-details div {
  margin-bottom: 12px;
  font-size: 15px;
  color: #444;
  display: flex;
  justify-content: space-between;
  border-bottom: 1px solid #f0f0f0;
  padding-bottom: 8px;
}

.drive-vision-text-only .road-condition-details div:last-child {
  margin-bottom: 0;
  border-bottom: none;
  padding-bottom: 0;
}

.drive-vision-text-only .road-condition-details strong {
  color: #00555F;
  font-weight: 600;
}

/* Navigation Controls */
.drive-vision-controls {
  background: linear-gradient(to top, rgba(0, 0, 0, 0.95) 0%, rgba(0, 0, 0, 0.85) 100%);
  padding: 16px 24px;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 20px;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.control-btn {
  background: linear-gradient(135deg, #00555F 0%, #007a8a 100%);
  color: white;
  border: 2px solid rgba(255, 255, 255, 0.3);
  width: 48px;
  height: 48px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  font-size: 20px;
  box-shadow: 0 2px 8px rgba(0, 85, 95, 0.4);
}

.control-btn:hover {
  background: linear-gradient(135deg, #007a8a 0%, #009aaa 100%);
  border-color: rgba(255, 255, 255, 0.6);
  transform: scale(1.15);
  box-shadow: 0 4px 12px rgba(0, 122, 138, 0.6);
}

.control-btn:disabled {
  opacity: 0.3;
  cursor: not-allowed;
  transform: none;
}

.control-info {
  color: white;
  font-size: 15px;
  font-weight: 600;
  min-width: 140px;
  text-align: center;
  letter-spacing: 0.5px;
  padding: 8px 16px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 20px;
}

/* Condition Colors */
.condition-good { background: #4caf50; }
.condition-fair { background: #ffeb3b; color: #333; }
.condition-poor { background: #ff9800; }
.condition-critical { background: #f44336; }
.condition-unknown { background: #9e9e9e; }

/* Scrollbar */
.segment-list::-webkit-scrollbar {
  width: 8px;
}

.segment-list::-webkit-scrollbar-track {
  background: #e0e0e0;
}

.segment-list::-webkit-scrollbar-thumb {
  background: #00555F;
  border-radius: 4px;
}

/* Responsive */
@media (max-width: 1024px) {
  .road-condition-preview-panel {
    width: 90%;
    max-width: 1200px;
  }
}

@media (max-width: 768px) {
  .road-condition-preview-panel {
    width: 95%;
    height: 85vh;
    max-height: 90vh;
    top: 50%;
    left: 50%;
  }
  
  .road-condition-preview-header {
    padding: 14px 16px;
  }
  
  .road-condition-preview-header h3 {
    font-size: 16px;
    flex-wrap: wrap;
    gap: 8px;
  }
  
  .road-condition-preview-header .segment-info {
    font-size: 13px;
    margin-left: 0;
    padding-left: 0;
    border-left: none;
    border-top: 1px solid rgba(255, 255, 255, 0.3);
    padding-top: 8px;
    margin-top: 8px;
    width: 100%;
  }
  
  .road-condition-preview-close {
    width: 32px;
    height: 32px;
    font-size: 24px;
  }
  
  .road-condition-preview-content {
    flex-direction: column;
  }
  
  .segment-list {
    width: 100%;
    max-height: 180px;
    border-right: none;
    border-bottom: 2px solid #d0d2d6;
  }
  
  .segment-item {
    padding: 12px 14px;
  }
  
  .segment-indicator {
    width: 40px;
    height: 40px;
    font-size: 15px;
  }
  
  .segment-name {
    font-size: 14px;
  }
  
  .segment-condition {
    font-size: 11px;
  }
  
  .drive-vision-view {
    min-height: 300px;
  }
  
  .drive-vision-overlay {
    top: 10px;
    left: 10px;
    right: 10px;
    padding: 10px 12px;
    min-width: auto;
    width: auto;
  }
  
  .drive-vision-overlay h4 {
    font-size: 16px;
  }
  
  .drive-vision-overlay .condition-info {
    font-size: 13px;
  }
  
  .control-btn {
    width: 42px;
    height: 42px;
    font-size: 16px;
  }
  
  .control-info {
    font-size: 13px;
    min-width: 120px;
    padding: 6px 12px;
  }
}

@media (max-width: 480px) {
  .road-condition-preview-panel {
    width: 100%;
    height: 100vh;
    max-height: 100vh;
    border-radius: 0;
    top: 0;
    left: 0;
    transform: none;
  }
  
  .road-condition-preview-header {
    padding: 12px 14px;
  }
  
  .road-condition-preview-header h3 {
    font-size: 14px;
  }
  
  .road-condition-preview-header .segment-info {
    font-size: 12px;
  }
  
  .road-condition-preview-close {
    width: 30px;
    height: 30px;
    font-size: 22px;
  }
  
  .segment-list {
    max-height: 150px;
  }
  
  .segment-item {
    padding: 10px 12px;
  }
  
  .segment-indicator {
    width: 36px;
    height: 36px;
    font-size: 14px;
  }
  
  .segment-name {
    font-size: 13px;
  }
  
  .drive-vision-view {
    min-height: 250px;
  }
  
  .drive-vision-overlay {
    top: 8px;
    left: 8px;
    right: 8px;
    padding: 8px 10px;
  }
  
  .drive-vision-overlay h4 {
    font-size: 14px;
    margin-bottom: 8px;
    padding-bottom: 6px;
  }
  
  .drive-vision-overlay .condition-info {
    font-size: 12px;
    margin-bottom: 8px;
  }
  
  .control-btn {
    width: 38px;
    height: 38px;
    font-size: 14px;
  }
  
  .control-info {
    font-size: 12px;
    min-width: 100px;
    padding: 5px 10px;
  }
}

