/**
 * PrimeLink Glass UI
 * Version: 1.0.0
 * Package: PrimeLink
 */

.mt-primelink-wizard .glass {
  background: rgba(255,255,255,0.72);
  border: 1px solid rgba(255,255,255,0.75);
  box-shadow: 0 8px 32px rgba(0,0,0,0.06), 0 2px 8px rgba(0,0,0,0.04);
  backdrop-filter: blur(16px) saturate(180%);
  -webkit-backdrop-filter: blur(16px) saturate(180%);
  border-radius: 16px;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.mt-primelink-wizard .glass:hover {
  box-shadow: 0 12px 40px rgba(0,0,0,0.08), 0 4px 12px rgba(0,0,0,0.06);
  transform: translateY(-1px);
}

.mt-primelink-wizard__header {
  display: flex;
  gap: 18px;
  padding: 18px;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
  position: relative;
}
.mt-primelink-wizard__brand{
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.mt_primelink-dashboard__header{
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}
.mt_primelink-dashboard__header-main{
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.mt_primelink-brand-head{
  display: flex;
  align-items: center;
  gap: 12px;
}
.mt_primelink-brand-logo{
  height: 56px;
  max-width: 240px;
  width: auto;
  display: block;
  object-fit: contain;
  align-self: center;
}
.mt_primelink-dashboard__brandline{
  display: inline-flex;
  align-items: center;
  gap: 8px;
  vertical-align: middle;
}
.mt_primelink-brandline-global{
  display: inline-flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
}
.mt_primelink-brand-version{
  font-weight: 700;
  font-size: 14px;
  color: #0b2035;
  margin: 0;
}
.mt_primelink-dashboard__meta{
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.mt_primelink-release-link{
  color: #1d2327;
  font-weight: 600;
  text-decoration: none;
}
.mt_primelink-release-link:hover{
  text-decoration: underline;
}
.mt_primelink-wizard-version-inline{
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  background: rgba(220, 38, 38, 0.08);
  border: 1px solid rgba(220, 38, 38, 0.2);
  border-radius: 10px;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.mt_primelink-wizard-version-inline .mt_primelink-summary-eyebrow {
  font-size: 11px;
  font-weight: 600;
  color: rgba(220, 38, 38, 0.8);
  letter-spacing: 0.05em;
  margin: 0;
}

.mt_primelink-wizard-version-inline strong {
  font-size: 13px;
  font-weight: 700;
  color: #dc2626;
  letter-spacing: -0.01em;
}

.mt-primelink-wizard__steps {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.mt-primelink-step {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  text-decoration: none;
  color: #1d2327;
  border-radius: 12px;
  background: rgba(255,255,255,0.75);
  border: 1px solid rgba(0,0,0,0.08);
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 2px 4px rgba(0,0,0,0.04);
}

.mt-primelink-step:hover {
  background: rgba(255,255,255,0.85);
  box-shadow: 0 4px 8px rgba(0,0,0,0.06);
  transform: translateY(-1px);
}

.spin {
  animation: spin 1s linear infinite;
}

@keyframes spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

.mt-primelink-step.is-active {
  font-weight: 700;
  border-color: rgba(34, 113, 177, 0.3);
  background: rgba(255,255,255,0.9);
  box-shadow: 0 4px 12px rgba(34, 113, 177, 0.15), inset 0 1px 0 rgba(255,255,255,0.9);
}

.mt-primelink-step.is-done .mt-primelink-step__num {
  background: #1d2327;
  color: #fff;
}

.mt-primelink-step__num {
  width: 22px;
  height: 22px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(0,0,0,0.06);
  font-size: 12px;
}

.mt-primelink-wizard__body {
  padding: 18px;
  min-height: 320px;
}

.mt-primelink-wizard__footer {
  display: flex;
  justify-content: space-between;
  margin-top: 12px;
}

.mt-primelink-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
}

@media (max-width: 1200px) {
  .mt-primelink-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (max-width: 768px) {
  .mt-primelink-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .mt-primelink-wizard__header {
    flex-direction: column;
    align-items: flex-start;
    gap: 16px;
  }

  .mt-primelink-wizard__brand {
    width: 100%;
  }

  .mt-primelink-wizard__steps {
    width: 100%;
    justify-content: flex-start;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    padding-bottom: 8px;
  }

  .mt-primelink-wizard__steps::-webkit-scrollbar {
    height: 4px;
  }

  .mt-primelink-wizard__steps::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.05);
  }

  .mt-primelink-wizard__steps::-webkit-scrollbar-thumb {
    background: rgba(0, 0, 0, 0.2);
    border-radius: 2px;
  }

  .mt-primelink-step {
    flex-shrink: 0;
    font-size: 12px;
    padding: 5px 8px;
  }

  .mt-primelink-step__label {
    display: none;
  }

  .mt-primelink-step__num {
    width: 20px;
    height: 20px;
    font-size: 11px;
  }

  .mt-primelink-wizard__body {
    padding: 16px;
  }

  .mt-primelink-wizard__footer {
    flex-direction: column-reverse;
    gap: 12px;
    align-items: stretch;
  }

  .mt-primelink-wizard__footer .left,
  .mt-primelink-wizard__footer .right {
    width: 100%;
  }

  .mt-primelink-wizard__footer .button {
    width: 100%;
    justify-content: center;
  }
}

@media (max-width: 480px) {
  .mt-primelink-grid {
    grid-template-columns: 1fr;
  }

  .mt-primelink-wizard__body {
    padding: 12px;
  }

  .mt-primelink-wizard__steps {
    gap: 6px;
  }

  /* Map Editor Responsive */
  .mt_primelink-map-editor__panel {
    width: 95vw;
    max-height: 90vh;
    padding: 12px;
  }

  .mt_primelink-map-editor__header {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
  }

  .mt_primelink-map-editor__header h3 {
    font-size: 14px;
  }

  .mt_primelink-map-editor__body {
    max-height: calc(90vh - 160px);
    padding: 4px 6px 0 6px;
  }

  .mt_primelink-editor-row {
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .mt_primelink-condition-row {
    grid-template-columns: 1fr;
  }

  .mt_primelink-map-editor__footer {
    flex-direction: column-reverse;
    gap: 8px;
  }

  .mt_primelink-map-editor__footer .button {
    width: 100%;
  }
}

@media (max-width: 768px) {
  .mt-primelink-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 480px) {
  .mt-primelink-grid {
    grid-template-columns: 1fr;
  }
}

.mt-primelink-choice,
.mt-primelink-choice-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px;
  cursor: pointer;
  margin-bottom: 12px;
}

.mt-primelink-choice-row:last-child {
  margin-bottom: 0;
}

.mt-primelink-choice input,
.mt-primelink-choice-row input {
  margin-top: 0;
}

.mt-primelink-two-col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

@media (max-width: 1024px) {
  .mt-primelink-two-col {
    grid-template-columns: 1fr;
    gap: 16px;
  }
}

@media (max-width: 768px) {
  .mt-primelink-two-col {
    gap: 12px;
  }
}

@media (max-width: 480px) {
  .mt-primelink-two-col {
    gap: 10px;
  }
}

.mt-primelink-preview {
  padding: 12px;
  min-height: 180px;
  border-radius: 10px;
  background: rgba(0,0,0,0.03);
}

.mt-primelink-preview-nav {
  display: flex;
  justify-content: space-between;
  margin-top: 10px;
}

.mt-primelink-stack { display: grid; gap: 10px; }
.p-16 { padding: 16px; }
.muted { opacity: 0.8; }


.mt-preview-vertical-wrap{
  max-height: 420px;
  overflow-y: auto;
  overflow-x: hidden;
  border-radius: 14px;
  padding: 8px;
  border: 1px solid rgba(255,255,255,0.18);
  background: rgba(255,255,255,0.08);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  box-shadow: 0 8px 30px rgba(0,0,0,0.10);
}

/* Export preview - horizontal table with scroll */
.mt-preview-vertical-wrap.mt-preview-export{
  overflow-x: auto;
  overflow-y: auto;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  -webkit-overflow-scrolling: touch;
  display: block;
}

.mt-preview-vertical.mt-preview-export{
  width: auto;
  min-width: 100%;
  table-layout: auto;
  margin: 0;
}

.mt-preview-vertical.mt-preview-export th{
  white-space: nowrap;
  min-width: 120px;
  padding: 8px 12px;
  position: sticky;
  top: 0;
  z-index: 2;
  background: rgba(20,20,20,0.55);
  border-right: 1px solid rgba(255,255,255,0.1);
}

.mt-preview-vertical.mt-preview-export td{
  white-space: normal;
  word-break: break-word;
  min-width: 120px;
  max-width: 300px;
  padding: 7px 12px;
  border-right: 1px solid rgba(255,255,255,0.05);
}

.mt-preview-vertical{
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.mt-preview-vertical thead th{
  position: sticky;
  top: 0;
  z-index: 2;
  background: rgba(20,20,20,0.55);
  color: #fff;
  text-align: left;
  padding: 8px 10px;
  border-bottom: 1px solid rgba(255,255,255,0.12);
}

.mt-preview-vertical td{
  padding: 7px 10px;
  border-bottom: 1px solid rgba(255,255,255,0.06);
  vertical-align: middle;
}

/* For status rows, align to middle and keep on same line */
.mt-preview-vertical tr:has(.mt-preview-status) td {
  vertical-align: middle;
}

.mt-preview-field{
  width: 35%;
  font-weight: 600;
  white-space: nowrap;
}

.mt-preview-value{
  width: 65%;
  word-break: break-word;
}

/* Ensure status fields are always on the same line */
.mt-preview-vertical td.mt-preview-field {
  white-space: nowrap;
}

/* For status rows, ensure field and value are on same line */
.mt-preview-vertical tr:has(.mt-preview-status) td.mt-preview-field,
.mt-preview-vertical tr:has(.mt-preview-status) td.mt-preview-value {
  vertical-align: middle;
  line-height: 1.4;
}

.mt-preview-vertical td.mt-preview-value.mt-preview-status,
.mt-preview-vertical td.mt-preview-value.mt-preview-status span {
  white-space: nowrap !important;
  overflow: hidden;
  text-overflow: ellipsis;
  margin: 0;
  display: inline;
  max-width: 100%;
  line-height: 1.4;
  vertical-align: middle;
}

.mt-preview-vertical tbody tr:nth-child(even){
  background: rgba(255,255,255,0.04);
}
.mt-preview-vertical tbody tr:hover{
  background: rgba(255,255,255,0.08);
}

/* Advanced Mapping Editor (light glass) */
.mt_primelink-map-editor{
  position: fixed;
  inset: 0;
  background: rgba(10,12,16,0.55);
  z-index: 9999;
  display: none;
  align-items: center;
  justify-content: center;
}
.mt_primelink-map-editor.is-open{
  display: flex;
}

.mt_primelink-map-editor__panel{
  position: relative;
  width: min(880px, 96vw);
  max-height: 92vh;
  border-radius: 18px;
  background: rgb(255, 255, 255);
  border: 1px solid rgba(255,255,255,0.20);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  box-shadow: 0 14px 50px rgba(0,0,0,0.30);
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  color: #0f172a;
}

.mt_primelink-map-editor__header{
  display:flex;
  align-items:center;
  justify-content:space-between;
  padding: 8px 10px;
  border-radius: 12px;
  background: rgba(255,255,255,0.08);
  position: sticky;
  top: 0;
  z-index: 2;
}

.mt_primelink-map-editor__header h3{
  margin:0;
  font-size:16px;
  font-weight:700;
  color:#0f172a;
}

.mt_primelink-map-editor__body{
  overflow-y:auto;
  padding: 6px 8px 0 8px;
  display:grid;
  gap:12px;
  max-height: calc(92vh - 140px);
}

.mt_primelink-form-row{
  display:grid;
  gap:6px;
}

.mt_primelink-form-row label{
  font-size:12.5px;
  font-weight:600;
  color:#0f172a;
  opacity:.9;
}

.mt_primelink-form-row input[type="text"],
.mt_primelink-form-row input[type="password"],
.mt_primelink-form-row input[type="number"],
.mt_primelink-form-row select{
  width:100%;
  padding:0px 10px;
  border-radius:10px;
  border:1px solid rgba(15,23,42,0.15);
  background: rgba(255,255,255,0.85);
  color:#0f172a;
  outline:none;
  height: 38px;
  box-sizing: border-box;
}

.mt_primelink-form-row input[disabled]{
  opacity:.7;
  background: rgba(255,255,255,0.6);
}

.mt_primelink-form-row label input[type="checkbox"]{
  margin-right:6px;
}

.mt_primelink-editor-row{
  display:grid;
  grid-template-columns: 1fr 1fr auto;
  gap:6px;
  align-items:center;
  margin-bottom:6px;
}

.mt_primelink-condition-row{
  grid-template-columns: 1fr auto 1fr auto;
}

.mt_primelink-map-editor__footer{
  padding: 8px 10px;
  display:flex;
  gap: 8px;
  justify-content:flex-end;
  gap:8px;
  border-top:1px solid rgba(15,23,42,0.10);
}
.mt_primelink-map-editor__footer .button-primary,
.mt_primelink-map-editor__footer button.button-primary{
  color: #0b2035;
  border-color: rgba(0, 0, 0, 0.12);
  background: #FFFFFF;
  box-shadow: 0 12px 26px rgba(44, 158, 197, 0.24);
}

.mt_primelink-map-editor__close-icon{
  cursor: pointer;
  font-size: 18px;
  line-height: 1;
  padding: 6px 8px;
  border-radius: 8px;
}
.mt_primelink-map-editor__close-icon:hover{
  background: rgba(15,23,42,0.06);
}

body.mt_primelink-editor-open{
  overflow: hidden;
}

.mt_primelink-map-editor-close{
  background: rgba(255,255,255,0.9) !important;
  border-color: rgba(15,23,42,0.15) !important;
  color:#0f172a !important;
}

.mt_primelink-condition-row{
  grid-template-columns: 1fr auto 1fr auto;
}

.mt_primelink-map-label{
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.mt_primelink-map-label__text{
  font-weight: 600;
  font-size: 12.5px;
  opacity: .9;
}

/* inline edit button */
.mt_primelink-map-edit--inline{
  padding: 2px 8px !important;
  min-height: 22px !important;
  line-height: 1.2 !important;
  border-radius: 999px !important;
  font-size: 11.5px !important;
  opacity: 0;
  transform: translateY(-1px);
  pointer-events: none;
  transition: opacity .12s ease, transform .12s ease;
}

/* show only after drop */
.mt_primelink-map-edit--inline.is-visible{
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

/* Statistics Tabs */
.mt_primelink-tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 20px;
  border-bottom: 2px solid rgba(255, 255, 255, 0.1);
  padding-bottom: 0;
}

.mt_primelink-tab-button {
  padding: 12px 24px;
  background: rgba(255, 255, 255, 0.05);
  border: none;
  border-bottom: 3px solid transparent;
  color: rgba(255, 255, 255, 0.7);
  cursor: pointer;
  font-weight: 600;
  font-size: 14px;
  transition: all 0.2s ease;
  margin-bottom: -2px;
  border-radius: 8px 8px 0 0;
}

.mt_primelink-tab-button:hover {
  background: rgba(255, 255, 255, 0.1);
  color: rgba(255, 255, 255, 0.9);
}

.mt_primelink-tab-button.active {
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
  border-bottom-color: rgba(59, 130, 246, 0.8);
}

.mt_primelink-tab-content {
  display: none;
}

.mt_primelink-tab-content[style*="display:block"] {
  display: block !important;
}
