/* ==========================================
   ENHANCED SYSTEMS STYLES
   Estilos para notificações, validação, loading, etc
   ========================================== */

/* ========== NOTIFICATIONS ========== */
.notifications-container {
  position: fixed;
  top: 2rem;
  right: 2rem;
  z-index: 10000;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  max-width: 400px;
  pointer-events: none;
}

.notification {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-left: 4px solid var(--primary);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  opacity: 0;
  transform: translateX(100%) scale(0.95);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  pointer-events: auto;
  overflow: hidden;
  max-width: 100%;
}

.notification.show {
  opacity: 1;
  transform: translateX(0) scale(1);
}

.notification.hiding {
  opacity: 0;
  transform: translateX(100%) scale(0.95);
}

.notification-content {
  display: flex;
  gap: 1rem;
  padding: 1rem 1.25rem;
  align-items: flex-start;
}

.notification-icon {
  font-size: 1.5rem;
  line-height: 1;
  flex-shrink: 0;
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.notification-body {
  flex: 1;
  min-width: 0;
}

.notification-title {
  font-weight: 600;
  font-size: 0.9375rem;
  margin-bottom: 0.25rem;
  color: var(--text-primary);
}

.notification-message {
  font-size: 0.875rem;
  color: var(--text-secondary);
  line-height: 1.5;
}

.notification-actions {
  display: flex;
  gap: 0.5rem;
  margin-top: 0.75rem;
}

.notification-action {
  padding: 0.375rem 0.75rem;
  font-size: 0.8125rem;
  font-weight: 500;
  border: 1px solid var(--border-color);
  background: var(--bg-tertiary);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: var(--transition);
}

.notification-action:hover {
  background: var(--bg-primary);
  border-color: var(--primary);
}

.notification-close {
  position: absolute;
  top: 0.75rem;
  right: 0.75rem;
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  background: transparent;
  color: var(--text-muted);
  font-size: 1.5rem;
  line-height: 1;
  cursor: pointer;
  border-radius: var(--radius-sm);
  transition: var(--transition);
}

.notification-close:hover {
  background: var(--bg-tertiary);
  color: var(--text-primary);
}

.notification-progress {
  height: 3px;
  background: var(--primary);
  width: 100%;
  animation: notification-progress-shrink 4s linear forwards;
  opacity: 0.3;
}

@keyframes notification-progress-shrink {
  from { width: 100%; }
  to { width: 0%; }
}

/* Notification types */
.notification-success {
  border-left-color: var(--success);
}

.notification-success .notification-icon {
  color: var(--success);
}

.notification-error {
  border-left-color: var(--danger);
}

.notification-error .notification-icon {
  color: var(--danger);
}

.notification-warning {
  border-left-color: var(--warning);
}

.notification-warning .notification-icon {
  color: var(--warning);
}

.notification-info {
  border-left-color: var(--primary);
}

.notification-info .notification-icon {
  color: var(--primary);
}

.notification-loading .notification-icon {
  animation: loading-spin 1s linear infinite;
}

/* ========== VALIDATION ========== */
.validation-error {
  display: none;
  font-size: 0.8125rem;
  color: var(--danger);
  margin-top: 0.375rem;
  padding-left: 0.25rem;
}

.form-input.invalid,
.form-select.invalid,
.form-textarea.invalid {
  border-color: var(--danger);
  background-color: rgba(220, 53, 69, 0.05);
}

.form-input.valid,
.form-select.valid,
.form-textarea.valid {
  border-color: var(--success);
  background-color: rgba(25, 135, 84, 0.05);
}

.form-input.invalid:focus,
.form-select.invalid:focus,
.form-textarea.invalid:focus {
  border-color: var(--danger);
  box-shadow: 0 0 0 3px rgba(220, 53, 69, 0.1);
}

.form-input.valid:focus,
.form-select.valid:focus,
.form-textarea.valid:focus {
  border-color: var(--success);
  box-shadow: 0 0 0 3px rgba(25, 135, 84, 0.1);
}

/* ========== LANGUAGE SELECTOR ========== */
.language-selector {
  padding: 0.5rem 0.75rem;
  font-size: 0.875rem;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  background: var(--bg-secondary);
  color: var(--text-primary);
  cursor: pointer;
  transition: var(--transition);
  min-width: 150px;
}

.language-selector:hover {
  border-color: var(--primary);
}

.language-selector:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(13, 110, 253, 0.1);
}

/* ========== HISTORY VIEWER ========== */
.history-viewer {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.history-controls {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
  align-items: center;
}

.history-list {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  max-height: 600px;
  overflow-y: auto;
  padding: 0.5rem;
}

.history-entry {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 1rem;
  transition: var(--transition);
}

.history-entry:hover {
  border-color: var(--primary);
  box-shadow: var(--shadow-sm);
}

.history-entry-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.75rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--border-light);
}

.history-mission-badge {
  font-size: 0.75rem;
  font-weight: 600;
  padding: 0.25rem 0.5rem;
  border-radius: var(--radius-sm);
  text-transform: uppercase;
}

.mission-peaceful {
  background: var(--success-light);
  color: var(--success);
}

.mission-war {
  background: var(--danger-light);
  color: var(--danger);
}

.mission-holding {
  background: var(--warning-light);
  color: var(--warning);
}

.history-entry-details {
  display: flex;
  flex-direction: column;
  gap: 0.375rem;
  font-size: 0.875rem;
  color: var(--text-secondary);
  margin-bottom: 0.75rem;
}

.history-entry-actions {
  display: flex;
  gap: 0.5rem;
  justify-content: flex-end;
}

.btn-icon {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--border-color);
  background: var(--bg-tertiary);
  border-radius: var(--radius-md);
  cursor: pointer;
  font-size: 1rem;
  transition: var(--transition);
}

.btn-icon:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-sm);
  border-color: var(--primary);
}

/* ========== LOGGER VIEWER ========== */
.logger-viewer {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.logger-controls {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
  align-items: center;
}

.logger-logs {
  max-height: 500px;
  overflow-y: auto;
  background: var(--bg-primary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 1rem;
}

.logger-entry {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.8125rem;
  padding: 0.5rem;
  margin-bottom: 0.5rem;
  border-radius: var(--radius-sm);
  display: flex;
  gap: 0.75rem;
  align-items: flex-start;
}

.logger-entry-error {
  background: rgba(220, 53, 69, 0.1);
  border-left: 3px solid var(--danger);
}

.logger-entry-warn {
  background: rgba(255, 193, 7, 0.1);
  border-left: 3px solid var(--warning);
}

.logger-entry-info {
  background: rgba(13, 110, 253, 0.1);
  border-left: 3px solid var(--primary);
}

.logger-entry-debug,
.logger-entry-trace {
  background: rgba(108, 117, 125, 0.1);
  border-left: 3px solid var(--secondary);
}

.logger-time {
  color: var(--text-muted);
  flex-shrink: 0;
}

.logger-level {
  font-weight: 600;
  flex-shrink: 0;
  min-width: 50px;
}

.logger-module {
  color: var(--primary);
  flex-shrink: 0;
}

.logger-message {
  color: var(--text-primary);
  flex: 1;
}

/* ========== EMPTY STATES ========== */
.empty-state {
  text-align: center;
  padding: 3rem 2rem;
  color: var(--text-muted);
}

.empty-state p {
  margin: 0 0 0.5rem 0;
  font-size: 1rem;
}

.empty-state small {
  font-size: 0.875rem;
}

/* ========== RESPONSIVE ========== */
@media (max-width: 768px) {
  .notifications-container {
    left: 1rem;
    right: 1rem;
    max-width: none;
  }

  .notification {
    max-width: 100%;
  }

  .history-controls,
  .logger-controls {
    flex-direction: column;
    align-items: stretch;
  }

  .history-controls > *,
  .logger-controls > * {
    width: 100%;
  }

  .history-entry-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.5rem;
  }
}

/* ========== DARK THEME ========== */
body.dark-theme .notification {
  background: var(--bg-tertiary);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}

body.dark-theme .form-input.invalid,
body.dark-theme .form-select.invalid {
  background-color: rgba(220, 53, 69, 0.15);
}

body.dark-theme .form-input.valid,
body.dark-theme .form-select.valid {
  background-color: rgba(25, 135, 84, 0.15);
}

body.dark-theme .history-entry {
  background: var(--bg-tertiary);
}

body.dark-theme .logger-logs {
  background: var(--bg-tertiary);
}

body.dark-theme .logger-entry-error {
  background: rgba(248, 81, 73, 0.15);
}

body.dark-theme .logger-entry-warn {
  background: rgba(210, 153, 34, 0.15);
}

body.dark-theme .logger-entry-info {
  background: rgba(88, 166, 255, 0.15);
}
