/* NEXUSCODE - Preview Pane Styles */

/* Preview Toolbar */
.preview-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: var(--tab-height);
  background: var(--bg-deep);
  border-bottom: 1px solid var(--border-subtle);
  padding: 0 var(--sp-3);
  flex-shrink: 0;
}

.preview-url-bar {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  padding: 3px var(--sp-3);
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-full);
  font-size: var(--text-xs);
  color: var(--text-muted);
  font-family: var(--font-mono);
  max-width: 300px;
  overflow: hidden;
}

.preview-actions {
  display: flex;
  align-items: center;
  gap: var(--sp-1);
}

.preview-action-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border: none;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  transition: all var(--duration-fast);
}

.preview-action-btn:hover {
  background: var(--bg-surface);
  color: var(--neon-cyan);
}

/* Preview Container */
.preview-container {
  flex: 1;
  position: relative;
  overflow: hidden;
  background: #ffffff;
  transition: all var(--duration-slow) var(--ease-out);
  display: flex;
  align-items: center;
  justify-content: center;
}

.preview-container.tablet-view {
  max-width: 768px;
  margin: 0 auto;
  border-left: 1px solid var(--border-default);
  border-right: 1px solid var(--border-default);
}

.preview-container.mobile-view {
  max-width: 375px;
  margin: 0 auto;
  border-left: 1px solid var(--border-default);
  border-right: 1px solid var(--border-default);
}

.preview-container.mobile-view,
.preview-container.tablet-view {
  height: 100%;
}

#previewFrame {
  width: 100%;
  height: 100%;
  border: none;
  background: white;
}

.preview-loading {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.9);
  z-index: 5;
}

/* Console Section */
.console-section {
  display: flex;
  flex-direction: column;
  background: var(--bg-base);
  border-top: 1px solid var(--border-subtle);
  height: 150px;
  flex-shrink: 0;
}

.console-section.collapsed {
  height: var(--console-header-height);
}

.console-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: var(--console-header-height);
  padding: 0 var(--sp-3);
  background: var(--bg-deep);
  border-bottom: 1px solid var(--border-subtle);
  flex-shrink: 0;
  cursor: pointer;
}

.console-header-left {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
}

.console-title {
  font-size: var(--text-xs);
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.console-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: var(--radius-full);
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  font-size: 10px;
  font-weight: 600;
  color: var(--text-muted);
}

.console-count.has-errors {
  background: rgba(255, 71, 87, 0.15);
  border-color: var(--neon-red-dim);
  color: var(--neon-red);
}

.console-header-right {
  display: flex;
  align-items: center;
  gap: var(--sp-1);
}

.console-filter-btn {
  padding: 2px 8px;
  border: none;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--text-muted);
  font-family: var(--font-ui);
  font-size: 10px;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--duration-fast);
}

.console-filter-btn:hover { color: var(--text-secondary); }
.console-filter-btn.active { color: var(--neon-cyan); background: var(--neon-cyan-ghost); }

.console-clear-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border: none;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  transition: all var(--duration-fast);
}

.console-clear-btn:hover { color: var(--neon-red); background: rgba(255, 71, 87, 0.1); }

/* Console Output */
.console-output {
  flex: 1;
  overflow-y: auto;
  padding: var(--sp-2);
  font-family: var(--font-mono);
  font-size: 12px;
  line-height: 1.6;
}

.console-empty {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100%;
  color: var(--text-muted);
  font-family: var(--font-ui);
  font-size: var(--text-xs);
}

.console-entry {
  display: flex;
  align-items: flex-start;
  gap: var(--sp-2);
  padding: 3px var(--sp-2);
  border-radius: var(--radius-sm);
  border-bottom: 1px solid var(--border-subtle);
  transition: background var(--duration-fast);
}

.console-entry:hover { background: var(--bg-surface); }

.console-entry-icon {
  flex-shrink: 0;
  width: 14px;
  height: 14px;
  margin-top: 2px;
}

.console-entry-message {
  flex: 1;
  word-break: break-all;
  color: var(--text-primary);
}

.console-entry.log .console-entry-icon { color: var(--text-muted); }
.console-entry.warn .console-entry-icon { color: var(--neon-yellow); }
.console-entry.warn { background: rgba(255, 217, 61, 0.04); }
.console-entry.error .console-entry-icon { color: var(--neon-red); }
.console-entry.error { background: rgba(255, 71, 87, 0.04); }

.console-entry-time {
  flex-shrink: 0;
  font-size: 10px;
  color: var(--text-muted);
}
