/* =================================
   MODALS - Style x0ne minimaliste
   Un seul style, réutilisable partout
   ================================= */

/* Overlay - fond sombre couvrant tout */
.modal, .simple-modal {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.92);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}

.modal.active, .simple-modal:not(.hidden) {
  display: flex;
}

/* Content - style login */
.modal-content, .simple-modal-content {
  background: var(--bg-card);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-lg);
  max-width: 600px;
  width: 90%;
  max-height: 85vh;
  overflow-y: auto;
  box-shadow: var(--shadow-card);
  color: var(--text);
  font-family: var(--font-mono);
  text-align: left;
}

.modal-content.large, .simple-modal-content.large {
  max-width: 800px;
}

/* Header */
.modal-header, .simple-modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: var(--space-sm) var(--space-md);
  border-bottom: 1px solid var(--border-card);
}

.modal-header h3, .simple-modal-header h3 {
  margin: 0;
  color: var(--text);
  font-weight: 400;
  font-size: 0.8rem;
  font-family: var(--font-mono);
}

/* Close button */
.modal-close, .simple-modal-close {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 1.2rem;
  cursor: pointer;
  padding: var(--space-xs);
  transition: color var(--transition-fast);
}

.modal-close:hover, .simple-modal-close:hover {
  color: var(--text);
}

/* Body */
.modal-body, .simple-modal-content form {
  padding: var(--space-md);
}

/* Footer */
.modal-footer {
  padding: var(--space-sm) var(--space-md);
  border-top: 1px solid var(--border-card);
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.65rem;
  color: var(--text-muted);
}

/* Simple Modal Overlay */
.simple-modal-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: -1;
}

/* Simple Form Styles (Admin) */
.simple-form {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.simple-field {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.simple-field label {
  color: rgba(255, 255, 255, 0.6);
  font-size: 0.75rem;
  font-family: 'JetBrains Mono', monospace;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.simple-field input,
.simple-field textarea,
.simple-field select {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 4px;
  padding: 0.75rem 1rem;
  color: rgba(255, 255, 255, 0.9);
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.875rem;
  transition: all 0.2s ease;
}

.simple-field input:focus,
.simple-field textarea:focus,
.simple-field select:focus {
  outline: none;
  border-color: rgba(74, 144, 217, 0.5);
  background: rgba(74, 144, 217, 0.05);
}

.simple-field input::placeholder,
.simple-field textarea::placeholder {
  color: rgba(255, 255, 255, 0.3);
}

.simple-field small,
.simple-field .field-hint {
  color: rgba(255, 255, 255, 0.4);
  font-size: 0.7rem;
}

.simple-field.hidden {
  display: none;
}

.simple-actions {
  display: flex;
  gap: 0.75rem;
  justify-content: flex-end;
  margin-top: 0.5rem;
  padding-top: 1rem;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.simple-actions button {
  padding: 0.6rem 1.25rem;
  border-radius: 4px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.8rem;
  cursor: pointer;
  transition: all 0.2s ease;
}

.simple-actions button[type="button"] {
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: rgba(255, 255, 255, 0.6);
}

.simple-actions button[type="button"]:hover {
  border-color: rgba(255, 255, 255, 0.3);
  color: rgba(255, 255, 255, 0.9);
}

.simple-actions button[type="submit"] {
  background: transparent;
  border: 1px solid rgba(74, 144, 217, 0.5);
  color: rgba(74, 144, 217, 0.9);
}

.simple-actions button[type="submit"]:hover {
  background: rgba(74, 144, 217, 0.1);
  border-color: rgba(74, 144, 217, 0.7);
  color: #4a90d9;
}

.simple-actions button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* Checkbox Label */
.checkbox-label {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  cursor: pointer;
  color: rgba(255, 255, 255, 0.7);
  font-size: 0.85rem;
}

.checkbox-label input[type="checkbox"] {
  width: 16px;
  height: 16px;
  accent-color: #4a90d9;
}

/* AI Options Section */
.ai-options-section {
  background: rgba(74, 144, 217, 0.05);
  border: 1px solid rgba(74, 144, 217, 0.15);
  border-radius: 4px;
  padding: 1rem;
  margin-top: 0.5rem;
}

/* =================================
   🎮 GAMING NOTIFICATIONS SYSTEM
   ================================= */

.notification {
  position: fixed;
  top: 20px;
  right: 20px;
  background: var(--x0ne-bg-primary);
  border: 1px solid var(--x0ne-border);
  border-radius: var(--x0ne-radius-md);
  padding: var(--x0ne-spacing-md);
  box-shadow: var(--x0ne-shadow-lg);
  z-index: var(--x0ne-z-notification);
  transform: translateX(400px);
  opacity: 0;
  transition: var(--x0ne-transition-slow);
  max-width: 400px;
  min-width: 300px;
  font-family: var(--x0ne-font-mono);
}

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

.notification-success {
  border-left: 3px solid var(--x0ne-accent);
  background: rgba(0, 255, 157, 0.05);
  box-shadow: 0 0 10px rgba(0, 255, 157, 0.2);
}

.notification-error {
  border-left: 3px solid var(--x0ne-danger);
  background: rgba(255, 56, 96, 0.05);
  box-shadow: 0 0 10px rgba(255, 56, 96, 0.2);
}

.notification-warning {
  border-left: 3px solid var(--x0ne-warning);
  background: rgba(255, 240, 0, 0.05);
  box-shadow: 0 0 10px rgba(255, 240, 0, 0.2);
}

.notification-info {
  border-left: 3px solid var(--x0ne-primary);
  background: rgba(128, 191, 255, 0.05);
  box-shadow: 0 0 10px rgba(128, 191, 255, 0.2);
}

.notification-content {
  display: flex;
  align-items: flex-start;
  gap: var(--x0ne-spacing-sm);
}

.notification-icon {
  font-size: 1.2rem;
  flex-shrink: 0;
  margin-top: 2px;
}

.notification-message {
  font-size: 0.9rem;
  color: var(--x0ne-text-primary);
  line-height: 1.4;
  font-family: var(--x0ne-font-mono);
}

/* Gaming Notification Stack */
.notification:nth-child(n+2) {
  margin-top: calc(var(--x0ne-spacing-md) * -1);
  transform: translateX(400px) translateY(calc((var(--x0ne-spacing-lg) + 60px) * var(--notification-index, 1)));
}

.notification.notification-show:nth-child(n+2) {
  transform: translateX(0) translateY(calc((var(--x0ne-spacing-lg) + 60px) * var(--notification-index, 1)));
}

/* =================================
   🎮 GAMING PREVIEW COMPONENTS
   ================================= */

.preview-container {
  max-height: 60vh;
  overflow-y: auto;
  background: var(--x0ne-bg-secondary);
  border: 1px solid var(--x0ne-border);
  border-radius: var(--x0ne-radius-md);
}

.preview-content {
  background: var(--x0ne-bg-primary);
  border: 1px solid var(--x0ne-border);
  border-radius: var(--x0ne-radius-md);
  margin: var(--x0ne-spacing-md) 0;
}

.preview-code,
.preview-json {
  margin: 0;
  padding: var(--x0ne-spacing-md);
  background: transparent;
  color: var(--x0ne-text-primary);
  font-family: var(--x0ne-font-code);
  font-size: 0.85rem;
  line-height: 1.4;
  white-space: pre-wrap;
  overflow-x: auto;
}

.preview-json {
  color: var(--x0ne-accent);
}

/* =================================
   🎮 GAMING RESPONSIVE MODALS
   ================================= */

@media (max-width: 768px) {
  .modal-content {
    width: 95%;
    max-height: 95%;
    margin: 20px;
    border-radius: var(--x0ne-radius-md);
  }
  
  .modal-header {
    padding: var(--x0ne-spacing-md);
  }
  
  .modal-body {
    padding: var(--x0ne-spacing-md);
  }
  
  .notification {
    right: 10px;
    left: 10px;
    max-width: none;
    transform: translateY(-100px);
  }
  
  .notification.notification-show {
    transform: translateY(0);
  }
  
  .notification:nth-child(n+2) {
    transform: translateY(calc(-100px + (var(--x0ne-spacing-lg) + 60px) * var(--notification-index, 1)));
  }
  
  .notification.notification-show:nth-child(n+2) {
    transform: translateY(calc((var(--x0ne-spacing-lg) + 60px) * var(--notification-index, 1)));
  }
}

/* =================================
   ⚡ GAMING ACCESSIBILITY
   ================================= */

/* Focus trap for modals */
.modal[aria-hidden="false"] {
  display: flex;
}

.modal[aria-hidden="true"] {
  display: none;
}

/* Gaming keyboard navigation */
.modal-close:focus-visible {
  outline: 2px solid var(--x0ne-accent);
  outline-offset: 2px;
  box-shadow: 0 0 10px rgba(0, 255, 157, 0.5);
}

/* Screen reader support */
.notification[role="alert"] {
  /* Automatically announced by screen readers */
}

/* Gaming reduced motion support */
@media (prefers-reduced-motion: reduce) {
  .modal-content {
    animation: none;
  }
  
  .notification {
    transition: opacity var(--x0ne-transition-fast);
  }
  
  .notification.notification-show {
    transform: none;
  }
}

/* =================================
   VARIANTE CONSOLE/TERMINAL
   Pour les outputs de test/log
   ================================= */

.modal-console .modal-content {
  max-width: 780px;
  height: 70vh;
  display: flex;
  flex-direction: column;
}

.modal-console .modal-body {
  flex: 1;
  overflow-y: auto;
  padding: 0;
}

/* Console output */
.console-output {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: var(--text);
  margin: 0;
  line-height: 1.6;
  padding: var(--space-md);
  white-space: pre-wrap;
  word-break: break-all;
}

/* Status colors */
.success { color: var(--success); }
.error { color: var(--error); }

/* Email buttons - style login */
.email-actions {
  display: inline-flex;
  gap: var(--space-sm);
  margin-left: var(--space-md);
}

.btn-email {
  background: transparent;
  border: 1px solid var(--border-card);
  color: var(--accent-light);
  padding: var(--space-xs) var(--space-sm);
  font-size: 0.6rem;
  font-family: var(--font-mono);
  cursor: pointer;
  border-radius: var(--radius-sm);
  transition: all var(--transition-fast);
}

.btn-email:hover {
  border-color: var(--accent-light);
  background: var(--accent-glow);
}
