/* Maya 2.0 ULTRA - Hosting View */
.hosting-view {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
}

.hosting-tabs {
  display: flex;
  gap: var(--space-1);
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: var(--space-1);
  overflow-x: auto;
}

.hosting-tab {
  padding: var(--space-2) var(--space-4);
  font-size: var(--text-sm);
  font-weight: 500;
  color: var(--text-secondary);
  border-radius: var(--radius-sm);
  transition: all var(--transition-fast);
  white-space: nowrap;
}

.hosting-tab:hover {
  color: var(--text-primary);
  background: var(--bg-secondary);
}

.hosting-tab.active {
  background: var(--accent);
  color: var(--text-inverse);
}

.hosting-tab-panel {
  display: none;
}

.hosting-tab-panel.active {
  display: block;
  animation: fadeIn var(--transition-fast) ease-out;
}

/* App cards */
.apps-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: var(--space-4);
}

.app-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  transition: all var(--transition);
}

.app-card:hover {
  box-shadow: var(--shadow);
  border-color: var(--border-strong);
}

.app-card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  padding: var(--space-4);
  gap: var(--space-3);
  border-bottom: 1px solid var(--border);
}

.app-card-info {
  flex: 1;
  min-width: 0;
}

.app-card-name {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  font-size: var(--text-base);
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: var(--space-1);
}

.app-card-kind {
  font-size: var(--text-xs);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 2px 8px;
  border-radius: var(--radius-sm);
  background: var(--bg-tertiary);
  color: var(--text-tertiary);
}

.app-card-status {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  flex-shrink: 0;
}

.status-indicator {
  width: 8px;
  height: 8px;
  border-radius: 50%;
}

.status-running { background: var(--success); }
.status-stopped { background: var(--text-tertiary); }
.status-error { background: var(--error); }
.status-starting { background: var(--warning); animation: pulse 1.5s infinite; }
.status-deploying { background: var(--info); animation: pulse 1.5s infinite; }

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

.app-card-body {
  padding: var(--space-4);
}

.app-card-fields {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  margin-bottom: var(--space-3);
}

.app-field {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  font-size: var(--text-sm);
}

.app-field-label {
  color: var(--text-tertiary);
  min-width: 80px;
  flex-shrink: 0;
}

.app-field-value {
  color: var(--text-primary);
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  word-break: break-all;
}

.app-field-value a {
  color: var(--text-link);
}

.app-card-env {
  margin-top: var(--space-3);
  padding-top: var(--space-3);
  border-top: 1px solid var(--border);
}

.app-env-toggle {
  font-size: var(--text-sm);
  color: var(--text-link);
  cursor: pointer;
}

.app-env-toggle:hover {
  text-decoration: underline;
}

.app-env-list {
  margin-top: var(--space-2);
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
}

.app-env-item {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  font-size: var(--text-xs);
  font-family: var(--font-mono);
  color: var(--text-secondary);
}

.app-env-key {
  font-weight: 500;
  color: var(--text-primary);
}

.app-card-footer {
  display: flex;
  gap: var(--space-2);
  padding: var(--space-3) var(--space-4);
  border-top: 1px solid var(--border);
  background: var(--bg-secondary);
}

.app-action-btn {
  flex: 1;
  font-size: var(--text-xs);
  padding: var(--space-1) var(--space-2);
}

.app-action-btn svg {
  width: 14px;
  height: 14px;
}

/* App detail */
.app-detail {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  width: 560px;
  max-width: 100vw;
  background: var(--bg-card);
  border-left: 1px solid var(--border);
  box-shadow: var(--shadow-xl);
  z-index: var(--z-modal);
  display: flex;
  flex-direction: column;
  animation: slideInRight var(--transition) ease-out;
}

.app-detail-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-4) var(--space-5);
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}

.app-detail-body {
  flex: 1;
  min-width: 0;
  overflow-y: auto;
  padding: var(--space-5);
}

.app-detail-section {
  margin-bottom: var(--space-5);
}

.app-detail-section-title {
  font-size: var(--text-xs);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-tertiary);
  margin-bottom: var(--space-3);
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

.app-logs {
  background: var(--bg-tertiary);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: var(--space-3);
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  line-height: 1.6;
  max-height: 400px;
  overflow-y: auto;
  color: var(--text-secondary);
}

.app-log-line {
  margin-bottom: 2px;
  white-space: pre-wrap;
  word-break: break-word;
}

.app-log-line.error { color: var(--error); }
.app-log-line.warn { color: var(--warning); }
.app-log-line.info { color: var(--info); }

/* Pipeline wizard */
.pipeline-wizard {
  display: flex;
  flex-direction: column;
  gap: var(--space-5);
}

.pipeline-step {
  display: none;
}

.pipeline-step.active {
  display: block;
  animation: fadeIn var(--transition-fast) ease-out;
}

.pipeline-progress {
  display: flex;
  align-items: center;
  gap: var(--space-4);
  margin-bottom: var(--space-5);
  padding: var(--space-4);
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.pipeline-step-indicator {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  flex: 1;
}

.pipeline-step-circle {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--bg-tertiary);
  border: 2px solid var(--border);
  color: var(--text-tertiary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: var(--text-sm);
  flex-shrink: 0;
  transition: all var(--transition);
}

.pipeline-step-circle.active {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--text-inverse);
}

.pipeline-step-circle.completed {
  background: var(--success);
  border-color: var(--success);
  color: var(--text-inverse);
}

.pipeline-step-line {
  flex: 1;
  height: 2px;
  background: var(--border);
}

.pipeline-step-line.completed {
  background: var(--success);
}

.pipeline-step-label {
  font-size: var(--text-xs);
  font-weight: 500;
  color: var(--text-tertiary);
  text-align: center;
  min-width: 100px;
}

.pipeline-step-label.active {
  color: var(--accent);
}

.pipeline-form {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
}

.pipeline-form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-4);
}

@media (max-width: 640px) {
  .pipeline-form-row {
    grid-template-columns: 1fr;
  }
}

.pipeline-plan {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: var(--space-4);
}

.pipeline-plan-steps {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

.pipeline-plan-step {
  display: flex;
  gap: var(--space-3);
  padding: var(--space-3);
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.pipeline-plan-step-number {
  flex-shrink: 0;
  width: 28px;
  height: 28px;
  border-radius: var(--radius-full);
  background: var(--accent-light);
  color: var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: var(--text-sm);
}

.pipeline-plan-step-content {
  flex: 1;
  min-width: 0;
}

.pipeline-plan-step-title {
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: var(--space-1);
}

.pipeline-plan-step-desc {
  font-size: var(--text-xs);
  color: var(--text-tertiary);
}

/* Deploy pipeline status */
.pipeline-status {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
}

.pipeline-status-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: var(--space-5);
}

.pipeline-status-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--space-4);
}

.pipeline-status-title {
  font-size: var(--text-lg);
  font-weight: 600;
}

.pipeline-status-badge {
  font-size: var(--text-xs);
  font-weight: 600;
  padding: 4px 12px;
  border-radius: var(--radius-full);
}

.pipeline-status-pending { background: var(--info-light); color: var(--info); }
.pipeline-status-running { background: var(--warning-light); color: var(--warning); }
.pipeline-status-completed { background: var(--success-light); color: var(--success); }
.pipeline-status-failed { background: var(--error-light); color: var(--error); }

.pipeline-status-details {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: var(--space-4);
}

.pipeline-detail-item {
  padding: var(--space-3);
  background: var(--bg-secondary);
  border-radius: var(--radius);
}

.pipeline-detail-label {
  font-size: var(--text-xs);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-tertiary);
  margin-bottom: var(--space-1);
}

.pipeline-detail-value {
  font-size: var(--text-base);
  font-weight: 500;
  color: var(--text-primary);
}

/* Remote deploy */
.remote-deploy-form {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
}

.remote-deploy-form .form-group {
  margin-bottom: 0;
}

/* Registry */
.registry-table {
  width: 100%;
}

.registry-table th,
.registry-table td {
  padding: var(--space-3) var(--space-4);
  text-align: left;
  border-bottom: 1px solid var(--border);
}

.registry-table th {
  background: var(--bg-secondary);
  font-weight: 600;
  font-size: var(--text-xs);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-tertiary);
}

.registry-table tbody tr:hover {
  background: var(--bg-secondary);
}

.registry-app-name {
  font-weight: 600;
  color: var(--text-primary);
}

.registry-app-image {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  color: var(--text-secondary);
}

.registry-monitor-toggle {
  display: flex;
  align-items: center;
}

/* Mobile adjustments */
@media (max-width: 768px) {
  .apps-grid {
    grid-template-columns: 1fr;
  }
  .hosting-tabs {
    overflow-x: auto;
  }
  .app-detail {
    width: 100%;
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  }
  .pipeline-progress {
    flex-wrap: wrap;
  }
  .pipeline-step-line {
    display: none;
  }
}