.car-dashboard-optimizer {
  background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
  border-radius: 16px;
  padding: 24px;
  color: white;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.car-dashboard-optimizer.loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 200px;
}

.car-dashboard-optimizer.error {
  background: linear-gradient(135deg, #2e1a1a 0%, #3e1616 100%);
  border-color: rgba(255, 100, 100, 0.3);
}

.car-dashboard-optimizer.not-car {
  background: linear-gradient(135deg, #1a2e1a 0%, #163e16 100%);
  border-color: rgba(100, 255, 100, 0.3);
}

.loading-spinner {
  width: 40px;
  height: 40px;
  border: 3px solid rgba(255, 255, 255, 0.3);
  border-top: 3px solid #4CAF50;
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin-bottom: 16px;
}

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

.optimizer-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 24px;
  padding-bottom: 16px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.optimizer-header h3 {
  margin: 0;
  font-size: 24px;
  font-weight: 600;
  background: linear-gradient(45deg, #4CAF50, #81C784);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.car-indicator {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(76, 175, 80, 0.2);
  padding: 8px 16px;
  border-radius: 20px;
  border: 1px solid rgba(76, 175, 80, 0.3);
}

.car-icon {
  font-size: 18px;
}

.status-overview {
  margin-bottom: 24px;
}

.status-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
}

.status-item {
  display: flex;
  align-items: center;
  gap: 12px;
  background: rgba(255, 255, 255, 0.05);
  padding: 16px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  transition: all 0.3s ease;
}

.status-item.ready {
  background: rgba(76, 175, 80, 0.1);
  border-color: rgba(76, 175, 80, 0.3);
}

.status-item.pending {
  background: rgba(255, 193, 7, 0.1);
  border-color: rgba(255, 193, 7, 0.3);
}

.status-item.active {
  background: rgba(33, 150, 243, 0.1);
  border-color: rgba(33, 150, 243, 0.3);
  animation: pulse 2s infinite;
}

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

.status-icon {
  font-size: 24px;
  min-width: 32px;
  text-align: center;
}

.status-text h4 {
  margin: 0 0 4px 0;
  font-size: 14px;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.9);
}

.status-text p {
  margin: 0;
  font-size: 12px;
  color: rgba(255, 255, 255, 0.7);
}

.cache-statistics {
  margin-bottom: 24px;
  background: rgba(255, 255, 255, 0.03);
  padding: 20px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.cache-statistics h4 {
  margin: 0 0 16px 0;
  font-size: 16px;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.9);
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 16px;
}

.stat-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.stat-label {
  font-size: 12px;
  color: rgba(255, 255, 255, 0.7);
  font-weight: 500;
}

.stat-value {
  font-size: 14px;
  color: #4CAF50;
  font-weight: 600;
}

.action-buttons {
  display: flex;
  gap: 12px;
  margin-bottom: 24px;
  flex-wrap: wrap;
}

.action-button {
  flex: 1;
  min-width: 200px;
  padding: 12px 20px;
  border: none;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.action-button:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.action-button.primary {
  background: linear-gradient(45deg, #4CAF50, #66BB6A);
  color: white;
}

.action-button.primary:hover:not(:disabled) {
  background: linear-gradient(45deg, #45a049, #5cb85c);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(76, 175, 80, 0.3);
}

.action-button.secondary {
  background: linear-gradient(45deg, #2196F3, #42A5F5);
  color: white;
}

.action-button.secondary:hover:not(:disabled) {
  background: linear-gradient(45deg, #1976D2, #1E88E5);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(33, 150, 243, 0.3);
}

.action-button.tertiary {
  background: linear-gradient(45deg, #FF9800, #FFB74D);
  color: white;
}

.action-button.tertiary:hover:not(:disabled) {
  background: linear-gradient(45deg, #F57C00, #FF8F00);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(255, 152, 0, 0.3);
}

.optimizer-settings {
  background: rgba(255, 255, 255, 0.03);
  padding: 20px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  margin-bottom: 24px;
}

.optimizer-settings h4 {
  margin: 0 0 20px 0;
  font-size: 16px;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.9);
}

.settings-grid {
  display: grid;
  gap: 16px;
}

.setting-item {
  padding: 16px;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.setting-item label {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 14px;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.9);
  cursor: pointer;
}

.setting-item input[type="checkbox"] {
  width: 18px;
  height: 18px;
  accent-color: #4CAF50;
}

.setting-item input[type="range"] {
  flex: 1;
  margin: 0 12px;
  accent-color: #4CAF50;
}

.range-value {
  min-width: 60px;
  text-align: right;
  color: #4CAF50;
  font-weight: 600;
}

.setting-description {
  margin: 8px 0 0 30px;
  font-size: 12px;
  color: rgba(255, 255, 255, 0.6);
}

.progress-section {
  background: rgba(255, 255, 255, 0.03);
  padding: 20px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.progress-section h4 {
  margin: 0 0 16px 0;
  font-size: 16px;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.9);
}

.progress-item {
  margin-bottom: 12px;
}

.progress-item span {
  display: block;
  font-size: 14px;
  color: rgba(255, 255, 255, 0.8);
  margin-bottom: 8px;
}

.progress-bar {
  width: 100%;
  height: 6px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 3px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  border-radius: 3px;
  animation: progressAnimation 2s ease-in-out infinite;
}

.progress-fill.handoff {
  background: linear-gradient(90deg, #FF9800, #FFB74D);
}

.progress-fill.caching {
  background: linear-gradient(90deg, #2196F3, #42A5F5);
}

.progress-fill.startup {
  background: linear-gradient(90deg, #4CAF50, #66BB6A);
}

@keyframes progressAnimation {
  0% { width: 0%; }
  50% { width: 70%; }
  100% { width: 100%; }
}

.basic-status {
  background: rgba(255, 255, 255, 0.05);
  padding: 16px;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  margin-top: 16px;
}

.basic-status p {
  margin: 8px 0;
  font-size: 14px;
  color: rgba(255, 255, 255, 0.8);
}

/* Responsive Design */
@media (max-width: 768px) {
  .car-dashboard-optimizer {
    padding: 16px;
  }
  
  .optimizer-header {
    flex-direction: column;
    gap: 12px;
    align-items: flex-start;
  }
  
  .status-grid {
    grid-template-columns: 1fr;
  }
  
  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  
  .action-buttons {
    flex-direction: column;
  }
  
  .action-button {
    min-width: unset;
  }
}

/* Car Dashboard Specific Styles */
@media (orientation: landscape) and (min-width: 1024px) {
  .car-dashboard-optimizer {
    font-size: 16px;
  }
  
  .optimizer-header h3 {
    font-size: 28px;
  }
  
  .status-item {
    padding: 20px;
  }
  
  .status-icon {
    font-size: 28px;
  }
  
  .action-button {
    padding: 16px 24px;
    font-size: 16px;
  }
}