/**
 * Estilos para o PlaygroundConsole
 */

.playground-console-container {
  display: flex;
  flex-direction: column;
  height: 100%;
  border-radius: 8px;
  overflow: hidden;
  transition:
    background-color 0.3s ease,
    color 0.3s ease;
}

/* Tema Dark (padrão) */
.playground-console-theme-dark {
  background-color: #1e1e1e;
  color: #d4d4d4;
}

.playground-console-theme-dark .playground-console-header {
  background-color: #252526;
  border-bottom: 1px solid #333;
}

.playground-console-theme-dark .playground-console-title {
  color: #cccccc;
}

.playground-console-theme-dark .playground-console-content {
  background-color: #1e1e1e;
}

.playground-console-theme-dark .playground-console-empty {
  color: #888;
}

/* Tema Light */
.playground-console-theme-light {
  background-color: #ffffff;
  color: #333333;
}

.playground-console-theme-light .playground-console-header {
  background-color: #f5f5f5;
  border-bottom: 1px solid #ddd;
}

.playground-console-theme-light .playground-console-title {
  color: #333333;
}

.playground-console-theme-light .playground-console-content {
  background-color: #ffffff;
}

.playground-console-theme-light .playground-console-empty {
  color: #666;
}

.playground-console-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 16px;
  transition: background-color 0.3s ease;
}

.playground-console-title {
  font-size: 14px;
  font-weight: 600;
}

.playground-console-clear-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  background: var(--action-green); /* hero/action button color */
  color: black;
  border: none;
  padding: 6px 12px;
  border-radius: 9999px;
  cursor: pointer;
  font-size: 13px;
  font-weight: 500;
  transition: all 0.2s;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.playground-console-clear-btn:hover:not(:disabled) {
  transform: scale(1.05);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

.playground-console-clear-btn:hover:not(:disabled) {
  transform: scale(1.05);
  box-shadow: 0 4px 8px rgba(237, 27, 47, 0.3);
}

.playground-console-clear-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  box-shadow: none;
}

.playground-console-clear-btn svg {
  width: 16px;
  height: 16px;
}

.playground-console-content {
  flex: 1;
  overflow-y: auto;
  padding: 8px;
  font-family: "Consolas", "Monaco", "Courier New", monospace;
  font-size: 13px;
  line-height: 1.6;
  transition: background-color 0.3s ease;
}

.playground-console-empty {
  padding: 16px;
  text-align: center;
  font-style: italic;
  transition: color 0.3s ease;
}

.playground-console-entry {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 6px 8px;
  margin-bottom: 2px;
  border-radius: 4px;
  transition: background-color 0.1s;
}

.playground-console-entry:hover {
  background-color: #2a2a2a;
}

.playground-console-theme-light .playground-console-entry:hover {
  background-color: #f0f0f0;
}

.playground-console-icon {
  flex-shrink: 0;
  font-size: 14px;
}

.playground-console-timestamp {
  flex-shrink: 0;
  color: #858585;
  font-size: 11px;
  margin-top: 2px;
}

.playground-console-message {
  flex: 1;
  word-break: break-word;
  white-space: pre-wrap;
}

/* Tipos de mensagem - Dark theme */
.playground-console-theme-dark
  .playground-console-log
  .playground-console-message {
  color: #d4d4d4;
}

.playground-console-theme-dark .playground-console-error {
  background-color: #3d1f1f;
  border-left: 3px solid #f48771;
}

.playground-console-theme-dark
  .playground-console-error
  .playground-console-message {
  color: #f48771;
}

.playground-console-theme-dark .playground-console-success {
  background-color: #1f3d1f;
  border-left: 3px solid #73c991;
}

.playground-console-theme-dark
  .playground-console-success
  .playground-console-message {
  color: #73c991;
}

.playground-console-theme-dark .playground-console-alert {
  background-color: #3d3d1f;
  border-left: 3px solid #dcdcaa;
}

.playground-console-theme-dark
  .playground-console-alert
  .playground-console-message {
  color: #dcdcaa;
}

/* Tipos de mensagem - Light theme */
.playground-console-theme-light
  .playground-console-log
  .playground-console-message {
  color: #333333;
}

.playground-console-theme-light .playground-console-error {
  background-color: #ffe6e6;
  border-left: 3px solid #d32f2f;
}

.playground-console-theme-light
  .playground-console-error
  .playground-console-message {
  color: #d32f2f;
}

.playground-console-theme-light .playground-console-success {
  background-color: #e6ffe6;
  border-left: 3px solid #388e3c;
}

.playground-console-theme-light
  .playground-console-success
  .playground-console-message {
  color: #388e3c;
}

.playground-console-theme-light .playground-console-alert {
  background-color: #fff8e6;
  border-left: 3px solid #f57c00;
}

.playground-console-theme-light
  .playground-console-alert
  .playground-console-message {
  color: #f57c00;
}

/* Scrollbar styling - Seguindo padrão do globals.css */
.playground-console-content::-webkit-scrollbar {
  width: 8px;
}

.playground-console-content::-webkit-scrollbar-track {
  background: transparent;
}

.playground-console-content::-webkit-scrollbar-thumb {
  background: linear-gradient(
    45deg,
    var(--brand-primary) 0%,
    var(--brand-secondary) 50%,
    var(--brand-accent) 100%
  );
  border-radius: 4px;
}

.playground-console-content::-webkit-scrollbar-thumb:hover {
  background: linear-gradient(
    45deg,
    var(--brand-dark) 0%,
    var(--brand-secondary) 50%,
    var(--brand-purple-dark) 100%
  );
}

.playground-console-content {
  scrollbar-width: thin;
  scrollbar-color: var(--brand-primary) transparent;
}
