/* =========================================
   THEME MODAL
========================================= */

.theme-modal {
  position: fixed;
  inset: 0;

  z-index: 200;

  display: none;
}

.theme-modal.open {
  display: block;
}

/* =========================================
   BACKDROP
========================================= */

.theme-modal-backdrop {
  position: absolute;
  inset: 0;

  background: rgba(0, 0, 0, 0.55);

  backdrop-filter: blur(6px);
}

/* =========================================
   CONTENT
========================================= */

.theme-modal-content {
  position: relative;
  z-index: 10;

  width: 100%;
  max-width: 640px;

  margin: 80px auto;
  padding: 24px;

  border-radius: 24px;

  background: var(--color-surface);
  color: var(--color-text);

  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.2);
}

/* =========================================
   HEADER
========================================= */

.theme-modal-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;

  margin-bottom: 20px;
}

.theme-modal-header h3 {
  margin: 0;

  color: var(--color-text);
}

.theme-modal-header p {
  margin: 4px 0 0;

  color: var(--color-muted);
}

.theme-modal-header button {
  border: 0;

  background: transparent;

  color: var(--color-text);

  font-size: 1.6rem;

  cursor: pointer;
}

/* =========================================
   THEME GRID COMPACT
========================================= */

.theme-grid-compact {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(90px, 1fr));

  gap: 10px;
}

.theme-grid-compact .theme-card {
  padding: 8px;
  border-radius: 12px;
}

.theme-grid-compact .theme-preview {
  height: 40px;
  border-radius: 10px;
}

.theme-grid-compact strong {
  font-size: .7rem;

  color: var(--color-text);
}

/* =========================================
   THEME TOGGLE
========================================= */

.theme-toggle {
  display: flex;
  align-items: center;
  justify-content: center;

  padding: 13px;
}

.theme-toggle img {
  width: 18px;
  height: 18px;
}

/* =========================================
   AUTH THEME TOGGLE
========================================= */

.auth-theme-toggle {
  position: absolute;
  top: 22px;
  right: 22px;

  z-index: 5;
}

.auth-theme-toggle .theme-toggle {
  width: 44px;
  height: 44px;

  padding: 0;

  border: 1px solid var(--color-border);
  border-radius: 999px;

  background:
    color-mix(
      in srgb,
      var(--color-surface) 12%,
      transparent
    );

  backdrop-filter: blur(14px);

  display: grid;
  place-items: center;

  cursor: pointer;

  transition: .2s ease;
}

.auth-theme-toggle .theme-toggle:hover {
  transform: translateY(-2px);

  background:
    color-mix(
      in srgb,
      var(--color-surface) 18%,
      transparent
    );
}

.auth-theme-toggle .theme-icon {
  width: 19px;
  height: 19px;
}

/* =========================================
   RESPONSIVE
========================================= */

@media (max-width: 520px) {
  .auth-theme-toggle {
    top: 14px;
    right: 14px;
  }

  .theme-modal-content {
    width: calc(100% - 24px);

    margin: 40px auto;
    padding: 20px;
  }
}

/* =========================================
   CONFIRM MODAL GLOBAL
========================================= */

.confirm-modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 9999;

  display: flex;
  align-items: center;
  justify-content: center;

  padding: 20px;

  background: rgba(2, 6, 23, 0.72);
  backdrop-filter: blur(8px);
}

.confirm-modal-overlay[hidden] {
  display: none !important;
}

.confirm-modal {
  width: min(100%, 440px);

  padding: 24px;

  border-radius: 24px;
  border: 1px solid var(--color-border);

  background: var(--color-surface);
  color: var(--color-text);

  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.35);

  animation: confirmModalIn 0.18s ease-out;
}

.confirm-modal-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;

  margin-bottom: 14px;
}

.confirm-modal-header h3 {
  margin: 0;

  font-size: 1.15rem;
  font-weight: 800;
  color: var(--color-text);
}

.confirm-modal-close {
  width: 34px;
  height: 34px;

  display: inline-flex;
  align-items: center;
  justify-content: center;

  border: 0;
  border-radius: 999px;

  background: var(--color-surface-muted);
  color: var(--color-muted);

  font-size: 1.25rem;
  line-height: 1;

  cursor: pointer;
}

.confirm-modal-close:hover {
  color: var(--color-text);
  background: var(--color-border);
}

.confirm-modal-body {
  margin-bottom: 22px;
}

.confirm-modal-body p {
  margin: 0;

  color: var(--color-muted);
  font-size: 0.95rem;
  line-height: 1.55;
}

.confirm-modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
}

.confirm-modal-footer .btn {
  min-width: 110px;
}

body.modal-open {
  overflow: hidden;
}

@keyframes confirmModalIn {
  from {
    opacity: 0;
    transform: translateY(10px) scale(0.96);
  }

  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@media (max-width: 520px) {
  .confirm-modal {
    padding: 22px;
    border-radius: 22px;
  }

  .confirm-modal-footer {
    flex-direction: column-reverse;
  }

  .confirm-modal-footer .btn {
    width: 100%;
  }
}

/* =========================================
   BROADCAST MODAL
========================================= */

.broadcast-modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 9998;

  display: flex;
  align-items: center;
  justify-content: center;

  padding: 20px;

  background: rgba(2, 6, 23, 0.72);
  backdrop-filter: blur(8px);
}

.broadcast-modal {
  width: min(100%, 520px);

  padding: 26px;

  border-radius: 26px;
  border: 1px solid var(--color-border);

  background: var(--color-surface);
  color: var(--color-text);

  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.35);

  animation: confirmModalIn 0.18s ease-out;
}

.broadcast-modal-label {
  display: inline-flex;

  margin-bottom: 10px;

  color: var(--color-primary);

  font-size: 0.76rem;
  font-weight: 900;

  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.broadcast-modal-header h3 {
  margin: 0;

  color: var(--color-text);

  font-size: 1.4rem;
  letter-spacing: -0.04em;
}

.broadcast-modal-body p {
  margin: 16px 0 0;

  color: var(--color-muted);

  line-height: 1.6;
}

.broadcast-modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 12px;

  margin-top: 24px;
}

@media (max-width: 520px) {
  .broadcast-modal {
    padding: 22px;
    border-radius: 22px;
  }

  .broadcast-modal-footer {
    flex-direction: column-reverse;
  }

  .broadcast-modal-footer .btn {
    width: 100%;
  }
}