/* ============================================================
   DIYSEO Admin Metabox Design System
   ============================================================ */

/* ── Design Tokens ───────────────────────────────────────── */
.ds-box {
  --ds-bg:           #06091c;
  --ds-surface:      #0c1038;
  --ds-input-bg:     rgba(255, 255, 255, 0.04);
  --ds-border:       rgba(255, 255, 255, 0.08);
  --ds-border-hover: rgba(255, 255, 255, 0.16);
  --ds-focus-ring:   rgba(99, 102, 241, 0.45);
  --ds-text:         #e2e8f0;
  --ds-text-muted:   #94a3b8;
  --ds-text-faint:   #4a5568;
  --ds-accent:       #6366f1;
  --ds-accent-dark:  #4f46e5;
  --ds-pink:         #ea188a;
  --ds-cyan:         #22d3ee;
  --ds-gradient:     linear-gradient(135deg, #6366f1 0%, #ea188a 100%);
  --ds-glow:         0 0 24px rgba(99, 102, 241, 0.2);
  --ds-radius:       14px;
  --ds-radius-sm:    9px;
  --ds-transition:   0.2s ease;

  position: relative;
  overflow: hidden;
  background-color: var(--ds-surface);
  border-radius: var(--ds-radius);
  padding: 24px;
  color: var(--ds-text);
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  font-size: 14px;
  border: 1px solid var(--ds-border);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5), inset 0 1px 0 rgba(255,255,255,0.04);
}

/* ── Aurora Glow Variant ─────────────────────────────────── */
.ds-box--aurora::before {
  content: '';
  position: absolute;
  top: -60%;
  left: -20%;
  width: 70%;
  height: 180%;
  background: radial-gradient(ellipse, rgba(99,102,241,0.12) 0%, transparent 65%);
  pointer-events: none;
  z-index: 0;
  animation: ds-aurora-drift 18s ease-in-out infinite alternate;
}
.ds-box--aurora::after {
  content: '';
  position: absolute;
  bottom: -60%;
  right: -20%;
  width: 60%;
  height: 160%;
  background: radial-gradient(ellipse, rgba(234,24,138,0.08) 0%, transparent 65%);
  pointer-events: none;
  z-index: 0;
  animation: ds-aurora-drift 22s ease-in-out infinite alternate-reverse;
}
.ds-box--aurora > * {
  position: relative;
  z-index: 1;
}
@keyframes ds-aurora-drift {
  from { transform: translate(0, 0) scale(1); }
  to   { transform: translate(8%, 6%) scale(1.08); }
}

/* ── Intro / Description Text ────────────────────────────── */
.ds-intro {
  font-size: 13px;
  color: var(--ds-text-muted);
  line-height: 1.6;
  margin-bottom: 22px;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--ds-border);
}
.ds-intro a {
  color: var(--ds-accent);
  text-decoration: none;
}
.ds-intro a:hover {
  text-decoration: underline;
}

/* ── Notices ─────────────────────────────────────────────── */
.ds-notice {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 16px 18px;
  border-radius: var(--ds-radius-sm);
  border-left: 3px solid var(--ds-pink);
  background: rgba(234, 24, 138, 0.06);
  margin-bottom: 20px;
}
.ds-notice__title {
  font-size: 13px;
  font-weight: 700;
  color: var(--ds-pink);
  margin: 0;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.ds-notice p {
  font-size: 13px;
  color: var(--ds-text-muted);
  margin: 0;
  line-height: 1.5;
}
.ds-notice a {
  color: var(--ds-text-muted);
  text-decoration: none;
}

/* ── Form Fields ─────────────────────────────────────────── */
.ds-field {
  margin-bottom: 16px;
}
.ds-field:last-of-type {
  margin-bottom: 0;
}
.ds-label {
  display: block;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ds-text-muted);
  margin-bottom: 7px;
}
.ds-input,
.ds-textarea,
.ds-select {
  width: 100%;
  padding: 10px 14px;
  border-radius: var(--ds-radius-sm);
  border: 1px solid var(--ds-border);
  background: var(--ds-input-bg);
  color: var(--ds-text);
  font-size: 14px;
  font-family: inherit;
  transition: border-color var(--ds-transition), box-shadow var(--ds-transition);
  box-sizing: border-box;
  -webkit-appearance: none;
  appearance: none;
}
.ds-input::placeholder,
.ds-textarea::placeholder {
  color: var(--ds-text-faint);
}
.ds-input:focus,
.ds-textarea:focus,
.ds-select:focus {
  outline: none;
  border-color: var(--ds-accent);
  box-shadow: 0 0 0 3px var(--ds-focus-ring);
}
.ds-input:hover,
.ds-textarea:hover,
.ds-select:hover {
  border-color: var(--ds-border-hover);
}
.ds-textarea {
  resize: vertical;
  min-height: 90px;
  line-height: 1.6;
}
.ds-select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%2394a3b8' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  padding-right: 36px;
  cursor: pointer;
}
.ds-select option {
  background: #0c1038;
  color: #e2e8f0;
}

/* ── Toggle Switch ───────────────────────────────────────── */
.ds-toggle-row {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 18px;
}
.ds-toggle-wrap {
  position: relative;
  display: inline-block;
  width: 44px;
  height: 24px;
  flex-shrink: 0;
}
.ds-toggle-wrap input {
  opacity: 0;
  width: 0;
  height: 0;
  position: absolute;
}
.ds-toggle-track {
  position: absolute;
  inset: 0;
  background: rgba(255,255,255,0.12);
  border-radius: 24px;
  cursor: pointer;
  transition: background var(--ds-transition);
}
.ds-toggle-track::after {
  content: '';
  position: absolute;
  top: 3px;
  left: 3px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 4px rgba(0,0,0,0.3);
  transition: transform var(--ds-transition);
}
.ds-toggle-wrap input:checked + .ds-toggle-track {
  background: var(--ds-gradient);
}
.ds-toggle-wrap input:checked + .ds-toggle-track::after {
  transform: translateX(20px);
}
.ds-toggle-label {
  font-size: 13px;
  font-weight: 500;
  color: var(--ds-text);
  cursor: pointer;
}

/* ── Checkbox Row ────────────────────────────────────────── */
.ds-check-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 16px;
  cursor: pointer;
}
.ds-check-row input[type="checkbox"] {
  width: 16px;
  height: 16px;
  border-radius: 4px;
  border: 1px solid var(--ds-border-hover);
  background: var(--ds-input-bg);
  accent-color: var(--ds-accent);
  cursor: pointer;
  flex-shrink: 0;
}
.ds-check-label {
  font-size: 13px;
  color: var(--ds-text-muted);
  line-height: 1.4;
}

/* ── Buttons ─────────────────────────────────────────────── */
.ds-btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 10px 20px;
  border-radius: var(--ds-radius-sm);
  font-size: 13px;
  font-weight: 600;
  font-family: inherit;
  border: none;
  cursor: pointer;
  text-decoration: none;
  transition: transform var(--ds-transition), box-shadow var(--ds-transition), opacity var(--ds-transition);
  -webkit-appearance: none;
}
.ds-btn:active {
  transform: scale(0.97) !important;
}
.ds-btn-primary {
  background: var(--ds-gradient);
  color: #fff;
  box-shadow: 0 4px 16px rgba(99,102,241,0.3);
}
.ds-btn-primary:hover {
  box-shadow: 0 6px 24px rgba(99,102,241,0.45);
  transform: translateY(-1px);
  opacity: 0.95;
}
.ds-btn-secondary {
  background: rgba(255,255,255,0.07);
  color: var(--ds-text);
  border: 1px solid var(--ds-border);
}
.ds-btn-secondary:hover {
  background: rgba(255,255,255,0.12);
  border-color: var(--ds-border-hover);
}
.ds-btn-cyan {
  background: linear-gradient(135deg, #22d3ee 0%, #6366f1 100%);
  color: #06091c;
  box-shadow: 0 4px 16px rgba(34,211,238,0.25);
}
.ds-btn-cyan:hover {
  box-shadow: 0 6px 24px rgba(34,211,238,0.4);
  transform: translateY(-1px);
}
.ds-btn-row {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 20px;
}

/* ── Loading Inline ──────────────────────────────────────── */
.ds-loading-inline {
  display: none;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--ds-accent);
  font-weight: 500;
}
.ds-loading-inline.is-visible {
  display: inline-flex;
}
.ds-loading-dots {
  display: flex;
  gap: 4px;
}
.ds-loading-dots span {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--ds-accent);
  animation: ds-dot-bounce 1.2s ease-in-out infinite;
}
.ds-loading-dots span:nth-child(2) { animation-delay: 0.2s; }
.ds-loading-dots span:nth-child(3) { animation-delay: 0.4s; }
@keyframes ds-dot-bounce {
  0%, 80%, 100% { transform: scale(0.7); opacity: 0.4; }
  40%           { transform: scale(1);   opacity: 1; }
}

/* ── Full-Screen Loading Overlay ─────────────────────────── */
.ds-overlay {
  position: fixed;
  inset: 0;
  background: rgba(6, 9, 28, 0.88);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 999999;
}
.ds-overlay.is-visible {
  display: flex;
}
.ds-overlay__spinner {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  border: 3px solid rgba(255,255,255,0.08);
  border-top-color: var(--ds-accent);
  border-right-color: var(--ds-pink);
  animation: ds-spin 0.9s linear infinite;
  margin-bottom: 24px;
}
@keyframes ds-spin {
  to { transform: rotate(360deg); }
}
.ds-overlay__progress {
  width: 220px;
  height: 3px;
  background: rgba(255,255,255,0.08);
  border-radius: 3px;
  overflow: hidden;
  margin-bottom: 20px;
}
.ds-overlay__bar {
  height: 100%;
  background: var(--ds-gradient);
  animation: ds-progress-pulse 2.6s ease-in-out infinite;
}
@keyframes ds-progress-pulse {
  0%   { width: 0%;   opacity: 1; }
  60%  { width: 80%;  opacity: 1; }
  100% { width: 100%; opacity: 0.6; }
}
.ds-overlay__text {
  text-align: center;
  color: #e2e8f0;
}
.ds-overlay__title {
  font-size: 16px;
  font-weight: 600;
  margin: 0 0 6px;
}
.ds-overlay__sub {
  font-size: 13px;
  color: #94a3b8;
  margin: 0;
}

/* ── Divider ─────────────────────────────────────────────── */
.ds-divider {
  border: none;
  border-top: 1px solid var(--ds-border);
  margin: 20px 0;
}

/* ── Footer ──────────────────────────────────────────────── */
.ds-footer {
  padding-top: 16px;
  border-top: 1px solid var(--ds-border);
  font-size: 12px;
  color: var(--ds-text-muted);
  line-height: 1.6;
  margin-top: 20px;
}
.ds-footer a {
  color: var(--ds-accent);
  text-decoration: none;
}
.ds-footer a:hover {
  text-decoration: underline;
}

/* ── Logo ────────────────────────────────────────────────── */
.ds-logo {
  display: block;
  margin: 24px auto 0;
  max-width: 180px;
  opacity: 0.75;
}

/* ── Notification Toast ──────────────────────────────────── */
.diyseo-notification {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) scale(0.92);
  background: #0c1038;
  color: #fff;
  padding: 18px 28px;
  border-radius: 12px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.5);
  z-index: 999999;
  opacity: 0;
  transition: all 0.25s ease;
  border-left: 3px solid #ea188a;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  font-size: 14px;
  max-width: 380px;
}
.diyseo-notification.show {
  opacity: 1;
  transform: translate(-50%, -50%) scale(1);
}
