/**
 * SweetAlert2 — sistem geneli dark/light tema
 * Yüklendiği her sayfada çalışır. Dark, html.dark veya html[data-theme="dark"]
 * ile belirlenir; bu seçiciler yoksa işletim sistemi tercihine (prefers-color-scheme) düşer.
 */

/* --- Ortak biçim (açık tema varsayılan) --- */
.swal2-popup {
  border-radius: 20px !important;
  box-shadow: 0 24px 60px -16px rgba(15, 23, 42, 0.25), 0 8px 24px -12px rgba(15, 23, 42, 0.15) !important;
  font-family: 'Plus Jakarta Sans', 'Inter', system-ui, -apple-system, sans-serif !important;
}
.swal2-title { font-weight: 800 !important; letter-spacing: -0.02em !important; }
.swal2-styled {
  border-radius: 12px !important;
  font-weight: 700 !important;
  box-shadow: none !important;
  padding: 0.625em 1.4em !important;
}
.swal2-styled:focus { box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.35) !important; }
.swal2-input, .swal2-textarea, .swal2-select {
  border-radius: 12px !important;
}

/* =====================================================================
   DARK — açık işaretleyici (html.dark / [data-theme="dark"])
   ===================================================================== */
html.dark .swal2-container .swal2-popup,
html[data-theme="dark"] .swal2-container .swal2-popup,
body.dark .swal2-container .swal2-popup,
body[data-theme="dark"] .swal2-container .swal2-popup {
  background: #16181d !important;
  color: #e7e9ee !important;
}

html.dark .swal2-title, html[data-theme="dark"] .swal2-title,
body.dark .swal2-title, body[data-theme="dark"] .swal2-title { color: #f5f6f8 !important; }

html.dark .swal2-html-container, html[data-theme="dark"] .swal2-html-container,
html.dark .swal2-content, html[data-theme="dark"] .swal2-content,
body.dark .swal2-html-container, body[data-theme="dark"] .swal2-html-container { color: #c3c7d1 !important; }

html.dark .swal2-close, html[data-theme="dark"] .swal2-close,
body.dark .swal2-close, body[data-theme="dark"] .swal2-close { color: #8a90a0 !important; }
html.dark .swal2-close:hover, html[data-theme="dark"] .swal2-close:hover { color: #f5f6f8 !important; }

html.dark .swal2-input, html[data-theme="dark"] .swal2-input,
html.dark .swal2-textarea, html[data-theme="dark"] .swal2-textarea,
html.dark .swal2-select, html[data-theme="dark"] .swal2-select,
body.dark .swal2-input, body[data-theme="dark"] .swal2-input {
  background: #0f1115 !important;
  color: #e7e9ee !important;
  border: 1px solid #2a2e37 !important;
  box-shadow: none !important;
}
html.dark .swal2-input::placeholder, html[data-theme="dark"] .swal2-input::placeholder { color: #6b7180 !important; }

html.dark .swal2-footer, html[data-theme="dark"] .swal2-footer,
body.dark .swal2-footer, body[data-theme="dark"] .swal2-footer {
  border-top-color: #2a2e37 !important;
  color: #c3c7d1 !important;
}

html.dark .swal2-timer-progress-bar, html[data-theme="dark"] .swal2-timer-progress-bar {
  background: rgba(255, 255, 255, 0.25) !important;
}

/* Varsayılan onay/iptal butonları koyu zeminde okunur kalsın */
html.dark .swal2-cancel, html[data-theme="dark"] .swal2-cancel,
body.dark .swal2-cancel, body[data-theme="dark"] .swal2-cancel {
  background: #272b33 !important;
  color: #e7e9ee !important;
}

/* =====================================================================
   DARK — işaretleyici yokken işletim sistemi tercihine göre
   (açıkça light seçilmiş sayfaları etkilememek için :not ile korunur)
   ===================================================================== */
@media (prefers-color-scheme: dark) {
  html:not(.dark):not([data-theme]):not([data-theme="light"]) .swal2-popup {
    background: #16181d !important;
    color: #e7e9ee !important;
  }
  html:not(.dark):not([data-theme]):not([data-theme="light"]) .swal2-title { color: #f5f6f8 !important; }
  html:not(.dark):not([data-theme]):not([data-theme="light"]) .swal2-html-container,
  html:not(.dark):not([data-theme]):not([data-theme="light"]) .swal2-content { color: #c3c7d1 !important; }
  html:not(.dark):not([data-theme]):not([data-theme="light"]) .swal2-input,
  html:not(.dark):not([data-theme]):not([data-theme="light"]) .swal2-textarea,
  html:not(.dark):not([data-theme]):not([data-theme="light"]) .swal2-select {
    background: #0f1115 !important; color: #e7e9ee !important; border: 1px solid #2a2e37 !important;
  }
  html:not(.dark):not([data-theme]):not([data-theme="light"]) .swal2-cancel {
    background: #272b33 !important; color: #e7e9ee !important;
  }
}
