@import url('animations.css');

/* ==========================================================================
   TOLS.SITE - PROFESSIONAL DESKTOP/WEB UI DIALOG & NOTIFICATION SYSTEM
   Engineered clean aesthetics (Linear / GitHub / Vercel style)
   No AI glows, no cartoonish paddings, razor-sharp human design.
   ========================================================================== */

/* --- Backdrop & Overlay --- */
.tols-modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.6);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 99999;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.18s ease, visibility 0.18s ease;
  padding: 1rem;
}

.tols-modal-backdrop.active {
  opacity: 1;
  visibility: visible;
}

/* --- Dialog Container --- */
.tols-modal-card {
  background: var(--surface, #ffffff);
  color: var(--text, #0f172a);
  border: 1px solid var(--border, #e2e8f0);
  border-radius: 12px;
  max-width: 440px;
  width: 100%;
  box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.1), 0 20px 48px -10px rgba(0, 0, 0, 0.18);
  transform: translateY(8px) scale(0.98);
  opacity: 0;
  transition: transform 0.2s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.18s ease;
  overflow: hidden;
  font-family: var(--font-sans, -apple-system, BlinkMacSystemFont, "Plus Jakarta Sans", "Inter", sans-serif);
  display: flex;
  flex-direction: column;
}

.tols-modal-backdrop.active .tols-modal-card {
  transform: translateY(0) scale(1);
  opacity: 1;
}

/* --- Header Row --- */
.tols-modal-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.1rem 1.25rem 0.85rem;
  border-bottom: 1px solid var(--border, #e2e8f0);
}

.tols-modal-title-row {
  display: flex;
  align-items: center;
  gap: 0.65rem;
}

.tols-modal-icon {
  width: 28px;
  height: 28px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.tols-modal-icon.warning {
  background: #fef3c7;
  color: #b45309;
}

.tols-modal-icon.error {
  background: #fee2e2;
  color: #b91c1c;
}

.tols-modal-icon.success {
  background: #d1fae5;
  color: #047857;
}

.tols-modal-icon.info {
  background: #e0e7ff;
  color: #4338ca;
}

.tols-modal-title {
  font-size: 0.98rem;
  font-weight: 700;
  color: var(--text, #0f172a);
  margin: 0;
  letter-spacing: -0.01em;
}

.tols-modal-close {
  background: transparent;
  border: none;
  color: var(--text-muted, #64748b);
  cursor: pointer;
  padding: 0.25rem 0.4rem;
  border-radius: 6px;
  display: flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.72rem;
  transition: background 0.15s ease, color 0.15s ease;
}

.tols-modal-close:hover {
  background: var(--surface-hover, #f1f5f9);
  color: var(--text, #0f172a);
}

.tols-modal-close kbd {
  background: var(--surface-raised, #f1f5f9);
  border: 1px solid var(--border, #cbd5e1);
  border-radius: 4px;
  padding: 0.1rem 0.3rem;
  font-size: 0.65rem;
  font-family: inherit;
  font-weight: 600;
  color: var(--text-muted, #64748b);
}

/* --- Body & Guidelines --- */
.tols-modal-body {
  padding: 1.15rem 1.25rem;
  font-size: 0.88rem;
  line-height: 1.55;
  color: var(--text, #334155);
}

.tols-modal-desc {
  margin: 0 0 1rem 0;
  color: var(--text-muted, #475569);
}

.tols-modal-guide {
  background: var(--surface-raised, #f8fafc);
  border: 1px solid var(--border, #e2e8f0);
  border-radius: 8px;
  padding: 0.85rem 1rem;
  font-size: 0.82rem;
}

.tols-guide-title {
  font-weight: 700;
  color: var(--text, #0f172a);
  margin-bottom: 0.4rem;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.tols-guide-list {
  margin: 0;
  padding-left: 1.15rem;
  color: var(--text-muted, #475569);
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.tols-guide-list li strong {
  color: var(--text, #0f172a);
}

.tols-guide-list code {
  background: rgba(0, 0, 0, 0.06);
  padding: 0.1rem 0.3rem;
  border-radius: 4px;
  font-family: var(--font-mono, monospace);
  font-size: 0.75rem;
}

/* --- Footer Row --- */
.tols-modal-footer {
  padding: 0.85rem 1.25rem;
  background: var(--surface-raised, #f8fafc);
  border-top: 1px solid var(--border, #e2e8f0);
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.6rem;
}

.tols-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  padding: 0.48rem 0.95rem;
  font-size: 0.82rem;
  font-weight: 600;
  border-radius: 7px;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease, transform 0.1s ease;
  border: 1px solid transparent;
  line-height: 1;
}

.tols-btn:active {
  transform: scale(0.98);
}

.tols-btn-secondary {
  background: var(--surface, #ffffff);
  color: var(--text, #334155);
  border-color: var(--border, #cbd5e1);
}

.tols-btn-secondary:hover {
  background: var(--surface-hover, #f1f5f9);
  border-color: var(--border-focus, #94a3b8);
}

.tols-btn-primary {
  background: var(--accent, #2563eb);
  color: #ffffff;
  border-color: var(--accent, #2563eb);
}

.tols-btn-primary:hover {
  filter: brightness(1.08);
}

/* --- TOAST NOTIFICATIONS (Subtle Linear/Raycast Style) --- */
.tols-toast-container {
  position: fixed;
  bottom: 20px;
  right: 20px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  z-index: 999999;
  pointer-events: none;
  max-width: 360px;
}

.tols-toast {
  pointer-events: auto;
  background: var(--surface, #ffffff);
  color: var(--text, #0f172a);
  border: 1px solid var(--border, #e2e8f0);
  border-radius: 8px;
  padding: 0.65rem 0.95rem;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08), 0 1px 2px rgba(0, 0, 0, 0.04);
  display: flex;
  align-items: center;
  gap: 0.65rem;
  transform: translateY(12px);
  opacity: 0;
  transition: transform 0.18s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.15s ease;
  font-family: inherit;
  cursor: pointer;
}

.tols-toast.show {
  transform: translateY(0);
  opacity: 1;
}

.tols-toast.hide {
  transform: translateY(10px);
  opacity: 0;
}

.tols-toast-icon {
  width: 18px;
  height: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.tols-toast-icon.warning { color: #d97706; }
.tols-toast-icon.error { color: #dc2626; }
.tols-toast-icon.success { color: #059669; }
.tols-toast-icon.info { color: #2563eb; }

.tols-toast-text {
  flex: 1;
  font-size: 0.8125rem;
  font-weight: 500;
  line-height: 1.4;
}

/* --- DARK MODE OVERRIDES (Linear / Raycast Dark) --- */
[data-theme="dark"] .tols-modal-card {
  background: #111827;
  color: #f8fafc;
  border-color: #1f293d;
  box-shadow: 0 12px 36px rgba(0, 0, 0, 0.6), 0 0 0 1px rgba(255, 255, 255, 0.06);
}

[data-theme="dark"] .tols-modal-top {
  border-color: #1f293d;
}

[data-theme="dark"] .tols-modal-icon.warning { background: rgba(245, 158, 11, 0.16); color: #f59e0b; }
[data-theme="dark"] .tols-modal-icon.error { background: rgba(239, 68, 68, 0.16); color: #ef4444; }
[data-theme="dark"] .tols-modal-icon.success { background: rgba(16, 185, 129, 0.16); color: #10b981; }
[data-theme="dark"] .tols-modal-icon.info { background: rgba(59, 130, 246, 0.16); color: #60a5fa; }

[data-theme="dark"] .tols-modal-title { color: #f8fafc; }
[data-theme="dark"] .tols-modal-body { color: #cbd5e1; }
[data-theme="dark"] .tols-modal-desc { color: #94a3b8; }
[data-theme="dark"] .tols-modal-guide {
  background: #0b0f19;
  border-color: #1f293d;
}
[data-theme="dark"] .tols-guide-title { color: #e2e8f0; }
[data-theme="dark"] .tols-guide-list { color: #94a3b8; }
[data-theme="dark"] .tols-guide-list li strong { color: #f8fafc; }
[data-theme="dark"] .tols-guide-list code { background: rgba(255, 255, 255, 0.08); color: #e2e8f0; }

[data-theme="dark"] .tols-modal-footer {
  background: #0b0f19;
  border-color: #1f293d;
}

[data-theme="dark"] .tols-modal-close kbd {
  background: #1f293d;
  border-color: #334155;
  color: #94a3b8;
}

[data-theme="dark"] .tols-btn-secondary {
  background: #1e293b;
  color: #f1f5f9;
  border-color: #334155;
}

[data-theme="dark"] .tols-btn-secondary:hover {
  background: #334155;
}

[data-theme="dark"] .tols-toast {
  background: #111827;
  color: #f8fafc;
  border-color: #1f293d;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
}
