/* ZenithKernel Islands Styling */

/* Base island container */
.zenith-island {
  position: relative;
  border-radius: 8px;
  background: #ffffff;
  border: 1px solid #e1e5e9;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  transition: all 0.2s ease-in-out;
  overflow: hidden;
}

.zenith-island:hover {
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  border-color: #d1d9e0;
}

/* Island loading states */
.zenith-island[data-hydration-status="pending"] {
  opacity: 0.7;
  background: #f8f9fa;
}

.zenith-island[data-hydration-status="hydrating"] {
  background: linear-gradient(45deg, #f8f9fa 25%, transparent 25%, transparent 75%, #f8f9fa 75%, #f8f9fa),
              linear-gradient(45deg, #f8f9fa 25%, transparent 25%, transparent 75%, #f8f9fa 75%, #f8f9fa);
  background-size: 20px 20px;
  background-position: 0 0, 10px 10px;
  animation: shimmer 1s linear infinite;
}

.zenith-island[data-hydration-status="hydrated"] {
  opacity: 1;
  background: #ffffff;
}

.zenith-island[data-hydration-status="error"] {
  border-color: #dc3545;
  background: #fff5f5;
}

@keyframes shimmer {
  0% { background-position: 0 0, 10px 10px; }
  100% { background-position: 20px 20px, 30px 30px; }
}

/* ECS Counter Island */
.ecs-counter-island {
  padding: 20px;
  text-align: center;
  min-width: 200px;
}

.ecs-counter-island h3 {
  margin: 0 0 16px 0;
  color: #2c3e50;
  font-size: 18px;
  font-weight: 600;
}

.ecs-counter-display {
  font-size: 48px;
  font-weight: bold;
  color: #3498db;
  margin: 16px 0;
  font-family: 'Courier New', monospace;
}

.ecs-counter-controls {
  display: flex;
  gap: 12px;
  justify-content: center;
  margin-top: 16px;
}

.ecs-counter-btn {
  padding: 8px 16px;
  border: none;
  border-radius: 6px;
  background: #3498db;
  color: white;
  font-weight: 500;
  cursor: pointer;
  transition: background-color 0.2s;
}

.ecs-counter-btn:hover {
  background: #2980b9;
}

.ecs-counter-btn:active {
  transform: translateY(1px);
}

.ecs-counter-btn.danger {
  background: #e74c3c;
}

.ecs-counter-btn.danger:hover {
  background: #c0392b;
}

.ecs-entity-info {
  margin-top: 16px;
  padding: 12px;
  background: #f8f9fa;
  border-radius: 4px;
  font-size: 12px;
  color: #6c757d;
}

/* Hydra Status Island */
.hydra-status-island {
  padding: 20px;
  min-width: 300px;
}

.hydra-status-island h3 {
  margin: 0 0 16px 0;
  color: #2c3e50;
  font-size: 18px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 8px;
}

.connection-indicator {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  display: inline-block;
}

.connection-indicator.connected {
  background: #27ae60;
  box-shadow: 0 0 6px rgba(39, 174, 96, 0.5);
}

.connection-indicator.disconnected {
  background: #e74c3c;
  box-shadow: 0 0 6px rgba(231, 76, 60, 0.5);
}

.status-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.status-card {
  padding: 12px;
  background: #f8f9fa;
  border-radius: 6px;
  border-left: 4px solid #3498db;
}

.status-card h4 {
  margin: 0 0 8px 0;
  font-size: 14px;
  color: #34495e;
  font-weight: 500;
}

.status-value {
  font-size: 24px;
  font-weight: bold;
  color: #2c3e50;
  font-family: 'Courier New', monospace;
}

.recent-events {
  margin-top: 16px;
}

.recent-events h4 {
  margin: 0 0 8px 0;
  font-size: 14px;
  color: #34495e;
}

.event-list {
  max-height: 120px;
  overflow-y: auto;
  background: #f8f9fa;
  border-radius: 4px;
  padding: 8px;
}

.event-item {
  padding: 4px 8px;
  margin: 2px 0;
  background: white;
  border-radius: 3px;
  font-size: 12px;
  color: #6c757d;
  border-left: 3px solid #3498db;
}

/* Hydra Registry Island */
.hydra-registry-island {
  padding: 20px;
  min-width: 400px;
}

.hydra-registry-island h3 {
  margin: 0 0 16px 0;
  color: #2c3e50;
  font-size: 18px;
  font-weight: 600;
}

.registry-controls {
  display: flex;
  gap: 12px;
  margin-bottom: 16px;
}

.registry-btn {
  padding: 6px 12px;
  border: 1px solid #dee2e6;
  border-radius: 4px;
  background: white;
  color: #495057;
  font-size: 12px;
  cursor: pointer;
  transition: all 0.2s;
}

.registry-btn:hover {
  background: #f8f9fa;
  border-color: #adb5bd;
}

.registry-btn.active {
  background: #3498db;
  color: white;
  border-color: #3498db;
}

.instance-list {
  margin-bottom: 16px;
}

.instance-item {
  padding: 12px;
  margin: 8px 0;
  background: #f8f9fa;
  border-radius: 6px;
  border-left: 4px solid #3498db;
  cursor: pointer;
  transition: all 0.2s;
}

.instance-item:hover {
  background: #e9ecef;
  transform: translateX(2px);
}

.instance-item.selected {
  background: #e3f2fd;
  border-left-color: #2196f3;
}

.instance-name {
  font-weight: 600;
  color: #2c3e50;
  margin-bottom: 4px;
}

.instance-type {
  font-size: 12px;
  color: #6c757d;
  background: white;
  padding: 2px 6px;
  border-radius: 3px;
  display: inline-block;
}

.instance-details {
  margin-top: 16px;
  padding: 16px;
  background: #f8f9fa;
  border-radius: 6px;
  border: 1px solid #dee2e6;
}

.instance-details h4 {
  margin: 0 0 12px 0;
  color: #2c3e50;
  font-size: 16px;
}

.detail-row {
  display: flex;
  justify-content: space-between;
  margin: 8px 0;
  padding: 4px 0;
  border-bottom: 1px solid #e9ecef;
}

.detail-label {
  font-weight: 500;
  color: #495057;
}

.detail-value {
  color: #6c757d;
  font-family: 'Courier New', monospace;
  font-size: 12px;
}

.management-actions {
  margin-top: 16px;
  display: flex;
  gap: 8px;
}

.action-btn {
  padding: 6px 12px;
  border: none;
  border-radius: 4px;
  font-size: 12px;
  cursor: pointer;
  transition: all 0.2s;
}

.action-btn.primary {
  background: #3498db;
  color: white;
}

.action-btn.primary:hover {
  background: #2980b9;
}

.action-btn.danger {
  background: #e74c3c;
  color: white;
}

.action-btn.danger:hover {
  background: #c0392b;
}

.action-btn.secondary {
  background: #6c757d;
  color: white;
}

.action-btn.secondary:hover {
  background: #5a6268;
}

/* Responsive design */
@media (max-width: 768px) {
  .zenith-island {
    margin: 8px;
  }
  
  .status-grid {
    grid-template-columns: 1fr;
  }
  
  .ecs-counter-controls {
    flex-direction: column;
  }
  
  .registry-controls {
    flex-wrap: wrap;
  }
}

/* Dark theme support */
@media (prefers-color-scheme: dark) {
  .zenith-island {
    background: #2c3e50;
    border-color: #34495e;
    color: #ecf0f1;
  }
  
  .zenith-island:hover {
    border-color: #4a5f7a;
  }
  
  .ecs-counter-island h3,
  .hydra-status-island h3,
  .hydra-registry-island h3 {
    color: #ecf0f1;
  }
  
  .status-card,
  .ecs-entity-info,
  .event-list,
  .instance-item,
  .instance-details {
    background: #34495e;
    color: #ecf0f1;
  }
  
  .registry-btn {
    background: #34495e;
    color: #ecf0f1;
    border-color: #4a5f7a;
  }
  
  .registry-btn:hover {
    background: #4a5f7a;
  }
}

/* Loading spinner for hydration */
.hydration-spinner {
  display: inline-block;
  width: 16px;
  height: 16px;
  border: 2px solid #f3f3f3;
  border-top: 2px solid #3498db;
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin-right: 8px;
}

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

/* Error states */
.error-message {
  padding: 12px;
  background: #fff5f5;
  border: 1px solid #fed7d7;
  border-radius: 6px;
  color: #c53030;
  font-size: 14px;
  margin: 8px 0;
}

.error-message::before {
  content: "⚠️ ";
  margin-right: 4px;
}
