/* OpenCode Plugin Styles */

/* Main container */
.opencode-container {
  display: flex;
  flex-direction: column;
  height: 100%;
  overflow: hidden;
}

/* Header */
.opencode-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 12px;
  border-bottom: 1px solid var(--background-modifier-border);
  background-color: var(--background-secondary);
  flex-shrink: 0;
}

.opencode-header-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 600;
}

.opencode-header-title svg {
  width: 16px;
  height: 16px;
}

.opencode-header-actions {
  display: flex;
  gap: 4px;
}

.opencode-header-actions button {
  background: transparent;
  border: none;
  padding: 4px 6px;
  border-radius: 4px;
  cursor: pointer;
  color: var(--text-muted);
}

.opencode-header-actions button:hover {
  background-color: var(--background-modifier-hover);
  color: var(--text-normal);
}

.opencode-header-actions button svg {
  width: 16px;
  height: 16px;
}

/* iframe container */
.opencode-iframe-container {
  flex: 1;
  overflow: hidden;
  position: relative;
}

.opencode-iframe {
  width: 100%;
  height: 100%;
  border: none;
  background-color: var(--background-primary);
}

/* Status container (for stopped/starting/error states) */
.opencode-status-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100%;
  padding: 24px;
  text-align: center;
  gap: 16px;
}

.opencode-status-icon {
  width: 48px;
  height: 48px;
  color: var(--text-muted);
}

.opencode-status-icon svg {
  width: 100%;
  height: 100%;
}

.opencode-status-container h3 {
  margin: 0;
  font-size: 1.2em;
}

.opencode-status-message {
  color: var(--text-muted);
  max-width: 300px;
  margin: 0;
}

.opencode-status-container button {
  margin-top: 8px;
}

.opencode-status-container button + button {
  margin-left: 8px;
}

/* Error state */
.opencode-status-container.opencode-error .opencode-status-icon {
  color: var(--text-error);
}

/* Loading spinner */
.opencode-loading {
  display: flex;
  justify-content: center;
  align-items: center;
}

.opencode-spinner {
  width: 32px;
  height: 32px;
  border: 3px solid var(--background-modifier-border);
  border-top-color: var(--interactive-accent);
  border-radius: 50%;
  animation: opencode-spin 1s linear infinite;
}

@keyframes opencode-spin {
  to {
    transform: rotate(360deg);
  }
}

/* Settings tab styles */
.opencode-settings-status {
  margin-top: 12px;
  padding: 12px;
  background-color: var(--background-secondary);
  border-radius: 8px;
}

.opencode-status-line {
  margin-bottom: 8px;
}

.opencode-status-line a {
  color: var(--text-accent);
}

.opencode-status-badge {
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 0.85em;
  font-weight: 500;
}

.opencode-status-badge.status-stopped {
  background-color: var(--background-modifier-border);
  color: var(--text-muted);
}

.opencode-status-badge.status-starting {
  background-color: var(--text-warning);
  color: var(--background-primary);
}

.opencode-status-badge.status-running {
  background-color: var(--text-success);
  color: var(--background-primary);
}

.opencode-status-badge.status-error {
  background-color: var(--text-error);
  color: var(--background-primary);
}

.opencode-settings-buttons {
  display: flex;
  gap: 8px;
  margin-top: 12px;
}

.opencode-status-waiting {
  color: var(--text-muted);
  font-style: italic;
}
