/**
 * Dialogs & Modals - Mortel Dîner
 */

/* === DIALOG === */
.dialog {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 1000;
  display: none;
  align-items: center;
  justify-content: center;
}

.dialog.active {
  display: flex;
}

.dialog__backdrop {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(4px);
}

.dialog__content {
  position: relative;
  background: var(--bg-card, #1a1a1a);
  border-radius: 12px;
  padding: 2rem;
  max-width: 500px;
  width: 90%;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
  z-index: 1;
  animation: slideUp 0.3s ease;
}

@keyframes slideUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.dialog__title {
  margin: 0 0 1.5rem 0;
  font-size: 1.5rem;
  color: var(--text-primary, #fff);
}

.dialog__actions {
  display: flex;
  gap: 1rem;
  margin-top: 1.5rem;
}

.dialog__actions button {
  flex: 1;
}

/* === MODAL === */
.modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 1000;
  display: none;
  align-items: center;
  justify-content: center;
}

.modal.active {
  display: flex;
}

.modal__backdrop {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(4px);
  cursor: pointer;
}

.modal__content {
  position: relative;
  background: var(--bg-card, #1a1a1a);
  border-radius: 12px;
  max-width: 600px;
  width: 90%;
  max-height: 80vh;
  overflow: auto;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
  z-index: 1;
  animation: slideUp 0.3s ease;
}

.modal__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.5rem;
  border-bottom: 1px solid var(--border-color, #333);
}

.modal__title {
  margin: 0;
  font-size: 1.5rem;
  color: var(--text-primary, #fff);
}

.modal__close {
  background: none;
  border: none;
  font-size: 2rem;
  color: var(--text-secondary, #aaa);
  cursor: pointer;
  padding: 0;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 4px;
  transition: all 0.2s;
}

.modal__close:hover {
  background: var(--bg-hover, #333);
  color: var(--text-primary, #fff);
}

.modal__body {
  padding: 1.5rem;
}

.modal__footer {
  padding: 1.5rem;
  border-top: 1px solid var(--border-color, #333);
  display: flex;
  gap: 1rem;
  justify-content: flex-end;
}

/* === SESSION DETAILS (dialogue restauration) === */
.session-details {
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid var(--border-color, #333);
  border-radius: 8px;
  padding: 1rem;
  margin-bottom: 1rem;
}

.session-details__row {
  display: flex;
  justify-content: space-between;
  padding: 0.5rem 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.session-details__row:last-child {
  border-bottom: none;
}

.session-details__row strong {
  color: var(--color-primary, #F4C430);
}

.session-details__prompt {
  text-align: center;
  color: var(--text-secondary, #aaa);
  font-size: 0.9rem;
  margin: 1rem 0 0 0;
}

/* === TOAST === */
.toast-container {
  position: fixed;
  top: 1rem;
  right: 1rem;
  z-index: 2000;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  pointer-events: none;
}

.toast {
  background: var(--bg-card, #1a1a1a);
  color: var(--text-primary, #fff);
  padding: 1rem 1.5rem;
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
  display: flex;
  align-items: center;
  gap: 0.75rem;
  min-width: 250px;
  max-width: 400px;
  pointer-events: auto;
  opacity: 0;
  transform: translateX(100%);
  transition: all 0.3s ease;
}

.toast--visible {
  opacity: 1;
  transform: translateX(0);
}

.toast__icon {
  font-size: 1.25rem;
  flex-shrink: 0;
}

.toast__message {
  flex: 1;
}

.toast--success {
  border-left: 4px solid var(--color-success, #4caf50);
}

.toast--error {
  border-left: 4px solid var(--color-error, #f44336);
}

.toast--warning {
  border-left: 4px solid var(--color-warning, #ff9800);
}

.toast--info {
  border-left: 4px solid var(--color-info, #2196f3);
}

/* === NOTIFICATION === */
.notification {
  background: var(--bg-card, #1a1a1a);
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
  min-width: 300px;
  max-width: 400px;
  pointer-events: auto;
  opacity: 0;
  transform: translateX(100%);
  transition: all 0.3s ease;
}

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

.notification__header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 1rem;
  border-bottom: 1px solid var(--border-color, #333);
}

.notification__icon {
  font-size: 1.25rem;
  flex-shrink: 0;
}

.notification__title {
  flex: 1;
  margin: 0;
  font-size: 1rem;
  color: var(--text-primary, #fff);
}

.notification__close {
  background: none;
  border: none;
  font-size: 1.5rem;
  color: var(--text-secondary, #aaa);
  cursor: pointer;
  padding: 0;
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 4px;
  transition: all 0.2s;
}

.notification__close:hover {
  background: var(--bg-hover, #333);
  color: var(--text-primary, #fff);
}

.notification__body {
  padding: 1rem;
  color: var(--text-secondary, #aaa);
}

.notification__actions {
  padding: 1rem;
  border-top: 1px solid var(--border-color, #333);
  display: flex;
  gap: 0.5rem;
  justify-content: flex-end;
}

.notification--success {
  border-left: 4px solid var(--color-success, #4caf50);
}

.notification--error {
  border-left: 4px solid var(--color-error, #f44336);
}

.notification--warning {
  border-left: 4px solid var(--color-warning, #ff9800);
}

.notification--info {
  border-left: 4px solid var(--color-info, #2196f3);
}

/* === SCREEN VISIBILITY === */
.screen {
  display: none;
  min-height: 100vh;
  padding: 2rem 0;
}

.screen.active {
  display: block;
}

/* === ANIMATIONS === */
.animate-slideIn {
  animation: slideIn 0.3s ease;
}

@keyframes slideIn {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* === WAITING SCREEN === */
.waiting {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 60vh;
  text-align: center;
  gap: 2rem;
}

.waiting__title {
  font-size: 2rem;
  margin: 0;
  color: var(--text-primary, #fff);
}

.waiting__text {
  font-size: 1.25rem;
  color: var(--text-secondary, #aaa);
  margin: 0;
}

.spinner {
  width: 48px;
  height: 48px;
  border: 4px solid var(--border-color, #333);
  border-top-color: var(--color-primary, #ff4757);
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

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

/* === QR SHARE === */
.lobby__qr {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.75rem;
  margin: 1rem 0;
}

.qr-share__code {
  background: #fff;
  padding: 0.75rem;
  border-radius: 8px;
  line-height: 0;
}

.qr-share__hint {
  margin: 0;
  color: var(--text-secondary, #aaa);
  font-size: 0.8rem;
  font-style: italic;
}
