:root {
  --bg: #141d2b;
  --surface: #1a2536;
  --border: #2a3b4e;
  --neon: #9fef00;
  --neon-dim: #6b9e1a;
  --text: #b3b9c5;
  --text-bright: #e6eae6;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

body {
  background-color: var(--bg);
  color: var(--text);
  /* font-family: var(--font-mono); */
  line-height: 1.6;
  min-height: 100vh;
}

/* ========== TOAST NOTIFICATIONS (stacked) ========== */
.messages-container {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    z-index: 9999;
    /* بدون اندازه، فقط یک anchor */
    pointer-events: none;   /* کلیک روی فضای خالی نفوذ کند */
}

.message-toast {
    position: absolute;
    bottom: 0;
    right: 0;
    width: 340px;
    background: var(--surface, #1a2536);
    border: 1px solid var(--neon-dim, #6b9e1a);
    border-radius: 6px;
    overflow: hidden;
    box-shadow: 0 0 20px rgba(159, 239, 0, 0.2);
    animation: slideIn 0.3s ease-out;
    pointer-events: auto;   /* روی خود toast کلیک فعال شود */
    cursor: pointer;        /* نشانگر دست */
}

@keyframes slideIn {
    from { transform: translateX(100%); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

@keyframes fadeOut {
    from { opacity: 1; transform: translateX(0); }
    to { opacity: 0; transform: translateX(30px); }
}

/* نوار پیشرفت (progress) */
.toast-progress {
    height: 3px;
    background: var(--neon, #9fef00);
    animation: progressShrink 3.5s linear forwards;
}

@keyframes progressShrink {
    from { width: 100%; }
    to { width: 0%; }
}

.toast-content {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    padding: 1rem;
    font-family: var(--font-mono);
    font-size: 0.9rem;
}

.toast-icon {
    font-size: 1.2rem;
    flex-shrink: 0;
}

.toast-message {
    color: var(--text-bright, #e6eae6);
    flex: 1;         /* پیام فضای موجود را بگیرد */
    word-break: break-word;
}

.toast-close {
    cursor: pointer;
    color: var(--text);
    margin-left: auto;
    font-size: 1.5rem;
    font-weight: bold;
    line-height: 1;
    opacity: 0.6;
    transition: 0.2s;
    padding: 0 0.2rem;
}
.toast-close:hover {
    opacity: 1;
    color: var(--neon);
}

.message-success .toast-progress { background: #27c93f; }
.message-success { border-color: #27c93f; }
.message-success .toast-icon { color: #27c93f; }

.message-error .toast-progress { background: #ff5f56; }
.message-error { border-color: #ff5f56; }
.message-error .toast-icon { color: #ff5f56; }

.message-warning .toast-progress { background: #ffbd2e; }
.message-warning { border-color: #ffbd2e; }
.message-warning .toast-icon { color: #ffbd2e; }

.message-info .toast-progress { background: var(--neon, #9fef00); }
.message-info .toast-icon { color: var(--neon, #9fef00); }