/* Ant Design-style Alert, confirm modal, and Spin — no React runtime */

.antd-ui-root,
.antd-ui-spin {
  --antd-primary: #1677ff;
  --antd-danger: #ff4d4f;
  --antd-warning: #faad14;
  --antd-error: #ff4d4f;
  --antd-success: #52c41a;
  --antd-info: #1677ff;
  --antd-text: rgba(255, 255, 255, 0.88);
  --antd-muted: rgba(255, 255, 255, 0.45);
  --antd-bg: #1f1f1f;
  --antd-border: #424242;
  --antd-alert-bg: #2b2111;
  --antd-alert-border: #594214;
  --antd-alert-title: rgba(255, 255, 255, 0.88);
  --antd-btn-bg: #141414;
  --antd-btn-hover: #424242;
  --antd-mask: rgba(0, 0, 0, 0.45);
  font-family: 'Noto Sans Thai', 'Plus Jakarta Sans', sans-serif;
}

html[data-theme="light"] .antd-ui-root,
html[data-theme="light"] .antd-ui-spin {
  --antd-text: rgba(0, 0, 0, 0.88);
  --antd-muted: rgba(0, 0, 0, 0.45);
  --antd-bg: #fff;
  --antd-border: #d9d9d9;
  --antd-alert-bg: #fffbe6;
  --antd-alert-border: #ffe58f;
  --antd-alert-title: rgba(0, 0, 0, 0.88);
  --antd-btn-bg: #fff;
  --antd-btn-hover: #f5f5f5;
  --antd-mask: rgba(0, 0, 0, 0.45);
}

html[data-theme="light"] .antd-ui-root[data-type="error"] {
  --antd-alert-bg: #fff2f0;
  --antd-alert-border: #ffccc7;
}

html[data-theme="light"] .antd-ui-root[data-type="success"] {
  --antd-alert-bg: #f6ffed;
  --antd-alert-border: #b7eb8f;
}

html[data-theme="light"] .antd-ui-root[data-type="info"] {
  --antd-alert-bg: #e6f4ff;
  --antd-alert-border: #91caff;
}

.antd-ui-root[data-type="error"] {
  --antd-alert-bg: #2a1215;
  --antd-alert-border: #58181c;
}

.antd-ui-root[data-type="success"] {
  --antd-alert-bg: #162312;
  --antd-alert-border: #274916;
}

.antd-ui-root[data-type="info"] {
  --antd-alert-bg: #111a2c;
  --antd-alert-border: #15325b;
}

.antd-ui-root[hidden],
.antd-ui-spin[hidden] {
  display: none !important;
}

.antd-ui-root,
.antd-ui-spin {
  position: fixed;
  inset: 0;
}

.antd-ui-root {
  z-index: 30000;
}

.antd-ui-spin {
  z-index: 30010;
}

.antd-ui-mask {
  position: absolute;
  inset: 0;
  background: var(--antd-mask);
}

.antd-ui-wrap {
  position: relative;
  display: flex;
  min-height: 100%;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.antd-ui-modal {
  width: min(416px, 100%);
  padding: 20px 24px 16px;
  border: 1px solid var(--antd-border);
  border-radius: 8px;
  background: var(--antd-bg);
  box-shadow: 0 6px 16px 0 rgba(0, 0, 0, 0.32), 0 3px 6px -4px rgba(0, 0, 0, 0.48), 0 9px 28px 8px rgba(0, 0, 0, 0.2);
  animation: antdUiPop 0.18s ease;
}

@keyframes antdUiPop {
  from { opacity: 0; transform: translateY(-8px) scale(0.98); }
  to { opacity: 1; transform: none; }
}

.antd-ui-title {
  margin: 0 0 16px;
  color: var(--antd-text);
  font-size: 16px;
  font-weight: 700;
  line-height: 1.4;
}

.antd-ui-title[hidden],
.antd-ui-field[hidden] {
  display: none;
}

.antd-ui-root[data-mode="prompt"] .antd-ui-alert {
  display: none;
}

.antd-ui-field {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.antd-ui-field span {
  color: var(--antd-text);
  font-size: 14px;
  font-weight: 600;
}

.antd-ui-field input {
  width: 100%;
  height: 32px;
  padding: 4px 11px;
  border: 1px solid var(--antd-border);
  border-radius: 6px;
  background: var(--antd-btn-bg);
  color: var(--antd-text);
  font: inherit;
  font-size: 14px;
  outline: none;
}

.antd-ui-field input:hover {
  border-color: var(--antd-primary);
}

.antd-ui-field input:focus {
  border-color: var(--antd-primary);
  box-shadow: 0 0 0 2px rgba(22, 119, 255, 0.2);
}

.antd-ui-alert {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  padding: 12px 16px;
  border: 1px solid var(--antd-alert-border);
  border-radius: 8px;
  background: var(--antd-alert-bg);
}

.antd-ui-alert-icon {
  flex-shrink: 0;
  width: 22px;
  height: 22px;
  margin-top: 1px;
  color: var(--antd-warning);
}

.antd-ui-root[data-type="error"] .antd-ui-alert-icon {
  color: var(--antd-error);
}

.antd-ui-root[data-type="success"] .antd-ui-alert-icon {
  color: var(--antd-success);
}

.antd-ui-root[data-type="info"] .antd-ui-alert-icon {
  color: var(--antd-info);
}

.antd-ui-alert-icon svg {
  display: block;
  width: 22px;
  height: 22px;
}

.antd-ui-alert-body {
  min-width: 0;
  flex: 1;
}

.antd-ui-alert-title {
  color: var(--antd-alert-title);
  font-size: 16px;
  font-weight: 700;
  line-height: 1.4;
}

.antd-ui-alert-desc {
  margin-top: 4px;
  color: var(--antd-muted);
  font-size: 14px;
  line-height: 1.5;
}

.antd-ui-alert-desc:empty {
  display: none;
}

.antd-ui-error {
  margin: 12px 0 0;
  color: var(--antd-danger);
  font-size: 13px;
  line-height: 1.4;
}

.antd-ui-error:empty,
.antd-ui-error[hidden] {
  display: none;
}

.antd-ui-footer {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 16px;
}

.antd-ui-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-width: 74px;
  height: 32px;
  padding: 0 15px;
  border: 1px solid var(--antd-border, #424242);
  border-radius: 6px;
  background: var(--antd-btn-bg, #141414);
  color: var(--antd-text, rgba(255, 255, 255, 0.88));
  font: inherit;
  font-size: 14px;
  line-height: 1;
  cursor: pointer;
  text-decoration: none;
}

.antd-ui-btn:hover {
  border-color: var(--antd-primary, #1677ff);
  color: var(--antd-primary, #1677ff);
}

.antd-ui-btn-primary {
  border-color: var(--antd-primary, #1677ff);
  background: var(--antd-primary, #1677ff);
  color: #fff;
}

.antd-ui-btn-primary:hover {
  filter: brightness(1.08);
  color: #fff;
}

.antd-ui-btn-danger {
  border-color: var(--antd-danger);
  background: var(--antd-danger);
  color: #fff;
}

.antd-ui-btn-danger:hover {
  filter: brightness(1.08);
  color: #fff;
}

.antd-ui-btn[hidden] {
  display: none !important;
}

.antd-ui-btn:disabled {
  cursor: not-allowed;
  opacity: 0.55;
  filter: none;
}

.antd-ui-btn-spin {
  width: 12px;
  height: 12px;
  border: 2px solid rgba(255, 255, 255, 0.35);
  border-top-color: #fff;
  border-radius: 50%;
  animation: antdUiSpin 0.7s linear infinite;
}

.antd-ui-spin-box {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
  min-height: 100%;
  color: #fff;
  pointer-events: none;
}

.antd-ui-spin .antd-ui-mask {
  background: rgba(0, 0, 0, 0.55);
}

.antd-ui-spin-text {
  margin: 0;
  font-size: 14px;
  font-weight: 600;
}

.antd-ui-dot {
  position: relative;
  display: inline-block;
  width: 32px;
  height: 32px;
}

.antd-ui-dot i {
  position: absolute;
  width: 14px;
  height: 14px;
  background: var(--antd-primary);
  border-radius: 100%;
  opacity: 0.3;
  animation: antdUiDot 1s infinite linear alternate;
  transform: scale(0.75);
}

.antd-ui-dot i:nth-child(1) { top: 0; inset-inline-start: 0; animation-delay: 0s; }
.antd-ui-dot i:nth-child(2) { top: 0; inset-inline-end: 0; animation-delay: 0.4s; }
.antd-ui-dot i:nth-child(3) { inset-inline-end: 0; bottom: 0; animation-delay: 0.8s; }
.antd-ui-dot i:nth-child(4) { bottom: 0; inset-inline-start: 0; animation-delay: 1.2s; }

@keyframes antdUiDot {
  to { opacity: 1; }
}

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

body.antd-ui-lock {
  overflow: hidden;
}

/* Ant Design Form / Input / TextArea / Select — public PHP editors */

.antd-form,
.page-cms-edit,
.cms-drawer,
body.is-admin .vote-editor,
body.is-admin .event-hero,
body.is-admin .event-block,
.dash-form,
.settings-form,
.settings-form-card,
.account-modal form {
  --antd-primary: #1677ff;
  --antd-primary-soft: rgba(22, 119, 255, 0.2);
  --antd-text: rgba(255, 255, 255, 0.88);
  --antd-muted: rgba(255, 255, 255, 0.45);
  --antd-border: #424242;
  --antd-fill: #141414;
  --antd-fill-hover: #1f1f1f;
  --antd-btn-bg: #141414;
  --antd-control-h: 40px;
  color-scheme: dark;
}

html[data-theme="light"] .antd-form,
html[data-theme="light"] .page-cms-edit,
html[data-theme="light"] .cms-drawer,
html[data-theme="light"] body.is-admin .vote-editor,
html[data-theme="light"] body.is-admin .event-hero,
html[data-theme="light"] body.is-admin .event-block,
html[data-theme="light"] .dash-form,
html[data-theme="light"] .settings-form,
html[data-theme="light"] .settings-form-card,
html[data-theme="light"] .account-modal form {
  --antd-text: rgba(0, 0, 0, 0.88);
  --antd-muted: rgba(0, 0, 0, 0.45);
  --antd-border: #d9d9d9;
  --antd-fill: #fff;
  --antd-fill-hover: #fff;
  --antd-btn-bg: #fff;
  color-scheme: light;
}

.antd-form-item,
.page-cms-edit .cms-field,
.page-cms-edit .cms-title-field,
.page-cms-edit .cms-cover-field {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.antd-form-label,
.page-cms-edit .cms-field-label,
.page-cms-edit .editor-label,
body.is-admin .vote-editor label,
body.is-admin .vote-photos-label {
  margin: 0;
  color: var(--antd-text, rgba(255, 255, 255, 0.88));
  font-size: 14px;
  font-weight: 400;
  line-height: 1.57;
}

.antd-form-label em,
.page-cms-edit .cms-field-label em,
.page-cms-edit .editor-label em {
  margin-left: 2px;
  color: #ff4d4f;
  font-style: normal;
}

.antd-input,
.antd-form input:not([type="checkbox"]):not([type="radio"]):not([type="file"]):not([type="hidden"]):not([type="color"]),
.antd-form textarea,
.antd-form select,
.page-cms-edit input:not([type="checkbox"]):not([type="radio"]):not([type="file"]):not([type="hidden"]):not([type="color"]),
.page-cms-edit textarea,
.page-cms-edit select,
.cms-drawer input:not([type="checkbox"]):not([type="radio"]):not([type="file"]):not([type="hidden"]):not([type="color"]),
.cms-drawer textarea,
.cms-drawer select,
body.is-admin .vote-editor input:not([type="checkbox"]):not([type="file"]):not([type="hidden"]):not([type="color"]),
body.is-admin .vote-editor textarea,
body.is-admin .vote-editor select,
body.is-admin .event-block textarea,
body.is-admin .event-block input[type="url"],
body.is-admin .event-block input[type="text"],
.dash-form input:not([type="checkbox"]):not([type="radio"]):not([type="file"]):not([type="hidden"]),
.dash-form textarea,
.dash-form select,
.settings-form input:not([type="checkbox"]):not([type="search"]):not([type="file"]):not([type="hidden"]),
.settings-form textarea,
.settings-form-card input:not([type="checkbox"]):not([type="file"]):not([type="hidden"]),
.settings-form-card textarea,
.account-modal input:not([type="checkbox"]):not([type="file"]):not([type="hidden"]) {
  width: 100%;
  min-height: var(--antd-control-h, 40px);
  padding: 4px 11px;
  border: 1px solid var(--antd-border, #424242);
  border-radius: 6px;
  background: var(--antd-fill, #141414) !important;
  color: var(--antd-text, rgba(255, 255, 255, 0.88)) !important;
  -webkit-text-fill-color: var(--antd-text, rgba(255, 255, 255, 0.88));
  caret-color: var(--antd-text, rgba(255, 255, 255, 0.88));
  font: inherit;
  font-size: 14px;
  font-weight: 400;
  line-height: 1.57;
  outline: none;
  box-shadow: none;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.antd-form .editor-title,
.page-news-create .editor-title {
  min-height: 0;
  border: none !important;
  background: transparent !important;
  box-shadow: none !important;
  padding-left: 0;
  padding-right: 0;
  -webkit-text-fill-color: inherit;
}

.antd-form .cat-search input,
.page-news-create .cat-search input {
  min-height: 36px;
  background: transparent !important;
  border: none !important;
  box-shadow: none !important;
  padding-left: 0;
  padding-right: 0;
}

.antd-input-lg {
  min-height: 48px;
  padding: 8px 11px;
  font-size: 20px;
  font-weight: 600;
}

.antd-form textarea,
.page-cms-edit textarea:not(.editor-title),
.cms-drawer textarea,
body.is-admin .vote-editor textarea,
body.is-admin .event-block textarea,
.dash-form textarea,
.settings-form textarea,
.settings-form-card textarea {
  min-height: 96px;
  padding: 8px 11px;
  resize: vertical;
  line-height: 1.57;
}

.antd-input:hover,
.antd-form input:hover,
.antd-form textarea:hover,
.antd-form select:hover,
.page-cms-edit input:hover,
.page-cms-edit textarea:hover,
.page-cms-edit select:hover,
.cms-drawer input:hover,
.cms-drawer textarea:hover,
body.is-admin .vote-editor input:hover,
body.is-admin .vote-editor textarea:hover,
body.is-admin .event-block textarea:hover,
.dash-form input:hover,
.dash-form textarea:hover,
.settings-form input:hover,
.account-modal input:hover {
  border-color: var(--antd-primary, #1677ff);
}

.antd-input:focus,
.antd-form input:focus,
.antd-form textarea:focus,
.antd-form select:focus,
.page-cms-edit input:focus,
.page-cms-edit textarea:focus,
.page-cms-edit select:focus,
.cms-drawer input:focus,
.cms-drawer textarea:focus,
body.is-admin .vote-editor input:focus,
body.is-admin .vote-editor textarea:focus,
body.is-admin .event-block textarea:focus,
.dash-form input:focus,
.dash-form textarea:focus,
.settings-form input:focus,
.account-modal input:focus {
  border-color: var(--antd-primary, #1677ff);
  box-shadow: 0 0 0 2px var(--antd-primary-soft, rgba(22, 119, 255, 0.2));
}

.antd-form select,
.page-cms-edit select,
.cms-drawer select,
body.is-admin .vote-editor select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%238c8c8c' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 32px;
}

.antd-upload-drag,
.page-cms-edit .cms-cover-drop {
  border: 1px dashed var(--antd-border, #424242) !important;
  background: rgba(255, 255, 255, 0.04) !important;
  border-radius: 8px;
}

.antd-upload-drag:hover,
.page-cms-edit .cms-cover-drop:hover,
.page-cms-edit .cms-cover-drop:focus-visible {
  border-color: var(--antd-primary, #1677ff) !important;
}

.page-cms-edit .editor-foot .antd-ui-btn,
.cms-drawer-actions .antd-ui-btn {
  min-width: 74px;
}

.page-cms-edit .cms-drawer-actions .btn-primary,
.cms-drawer-actions .btn-primary {
  background: #1677ff;
  border-color: #1677ff;
  color: #fff;
  border-radius: 6px;
  font-weight: 400;
}

.page-cms-edit .cms-drawer-actions .btn-primary:hover,
.cms-drawer-actions .btn-primary:hover {
  background: #4096ff;
  border-color: #4096ff;
  color: #fff;
}

.page-cms-edit .cms-drawer-actions .btn-outline,
.cms-drawer-actions .btn-outline {
  background: #141414;
  border: 1px solid #424242;
  color: rgba(255, 255, 255, 0.88);
  border-radius: 6px;
  font-weight: 400;
}

.page-cms-edit .cms-drawer-actions .btn-outline:hover,
.cms-drawer-actions .btn-outline:hover {
  border-color: #1677ff;
  color: #1677ff;
}
