/* ===== Reset & Base ===== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; }
body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: #0f0f13;
  color: #c9c2d6;
  font-size: 14px;
  line-height: 1.5;
  min-height: 100vh;
}
a { color: inherit; text-decoration: none; }
ul, ol { list-style: none; }
img { max-width: 100%; display: block; }
input, button, textarea { font-family: inherit; }

/* ===== Header ===== */
header {
  background: #16131f;
  border-bottom: 1px solid #2a2440;
  padding: 14px 24px;
  display: flex;
  align-items: center;
  gap: 12px;
}
header .logo {
  font-size: 18px;
  font-weight: 700;
  color: #e8e0f0;
}
header .logo span {
  color: #8b5cf6;
}
header .subtitle {
  font-size: 11px;
  color: #5a5270;
  margin-left: 4px;
}
header .header-actions {
  display: flex;
  gap: 8px;
  align-items: center;
  margin-left: auto;
}

/* ===== Main Container ===== */
main {
  max-width: 800px;
  margin: 0 auto;
  padding: 32px 24px;
}
main.wide {
  max-width: 1100px;
}

/* ===== Card (Glassmorphic) ===== */
.card {
  background: #16131f;
  border: 1px solid #221e2e;
  border-radius: 10px;
  padding: 20px;
  margin-bottom: 16px;
}
.card h2 {
  font-size: 13px;
  font-weight: 600;
  color: #8b5cf6;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 14px;
}
.card h3 {
  font-size: 15px;
  font-weight: 600;
  color: #e8e0f0;
  margin-bottom: 10px;
}

/* ===== Buttons ===== */
.btn {
  display: inline-block;
  padding: 9px 20px;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  font-family: inherit;
  font-size: 13px;
  font-weight: 600;
  transition: background 0.15s, border-color 0.15s, opacity 0.15s;
}
.btn-primary { background: #8b5cf6; color: white; }
.btn-primary:hover { background: #7c3aed; }
.btn-primary:disabled { opacity: 0.5; cursor: not-allowed; }
.btn-primary:disabled:hover { background: #8b5cf6; }
.btn-ghost { background: #1a1625; color: #8b5cf6; border: 1px solid #2a2440; }
.btn-ghost:hover { border-color: #8b5cf6; }
.btn-danger { background: #1f0d0d; color: #f87171; border: 1px solid #3a1515; }
.btn-danger:hover { border-color: #f87171; }
.btn-sm { padding: 5px 12px; font-size: 12px; }
.btn-lg { padding: 12px 28px; font-size: 15px; }

/* ===== Form Inputs ===== */
.form-group {
  margin-bottom: 16px;
}
.form-group label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: #a78bfa;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 6px;
}
.form-input {
  width: 100%;
  padding: 10px 14px;
  background: #0f0f13;
  border: 1px solid #2a2440;
  border-radius: 6px;
  color: #e8e0f0;
  font-size: 14px;
  outline: none;
  transition: border-color 0.15s;
}
.form-input:focus {
  border-color: #8b5cf6;
}
.form-input::placeholder {
  color: #5a5270;
}
.form-row {
  display: flex;
  gap: 12px;
  align-items: flex-end;
}
.form-row .form-group {
  flex: 1;
}
.form-row .btn {
  margin-bottom: 16px;
  white-space: nowrap;
}

/* ===== Status Badges ===== */
.status-badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 12px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
}
.status-queued { background: #1a1625; color: #5a5270; }
.status-processing { background: #1a1a00; color: #facc15; }
.status-complete { background: #0d1f0d; color: #4ade80; }
.status-failed { background: #1f0d0d; color: #f87171; }
.status-active { background: #0d1f0d; color: #4ade80; }
.status-inactive { background: #1f0d0d; color: #f87171; }

/* ===== Search Results ===== */
.results-list {
  margin-top: 16px;
}
.result-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  background: #0f0f13;
  border: 1px solid #221e2e;
  border-radius: 8px;
  margin-bottom: 8px;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
}
.result-item:hover {
  border-color: #8b5cf6;
  background: #1a1625;
}
.result-item .result-address {
  font-size: 14px;
  font-weight: 600;
  color: #e8e0f0;
}
.result-item .result-meta {
  font-size: 12px;
  color: #5a5270;
  margin-top: 2px;
}
.result-item .result-arrow {
  color: #5a5270;
  font-size: 16px;
  flex-shrink: 0;
  margin-left: 12px;
}

/* ===== Preview / Blurred Sections ===== */
.section-blurred {
  position: relative;
  overflow: hidden;
}
.section-blurred .blur-content {
  filter: blur(6px);
  -webkit-filter: blur(6px);
  pointer-events: none;
  user-select: none;
}
.section-blurred .blur-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: rgba(15, 15, 19, 0.6);
  border-radius: 10px;
  z-index: 2;
}
.blur-overlay .lock-icon {
  font-size: 28px;
  margin-bottom: 8px;
}
.blur-overlay .unlock-cta {
  font-size: 14px;
  font-weight: 600;
  color: #8b5cf6;
}

/* ===== Section Availability Indicator ===== */
.availability-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 8px;
}
.avail-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  background: #0f0f13;
  border-radius: 6px;
  font-size: 12px;
}
.avail-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}
.avail-dot.available { background: #4ade80; }
.avail-dot.unavailable { background: #5a5270; }
.avail-label { color: #c9c2d6; }

/* ===== Property Identity Header ===== */
.property-header {
  margin-bottom: 24px;
}
.property-header h1 {
  font-size: 22px;
  font-weight: 700;
  color: #e8e0f0;
  margin-bottom: 4px;
}
.property-header .property-sub {
  font-size: 13px;
  color: #5a5270;
}
.property-header .property-class {
  display: inline-block;
  margin-top: 8px;
  padding: 3px 10px;
  background: #1a1625;
  border: 1px solid #2a2440;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 600;
  color: #a78bfa;
  text-transform: uppercase;
}

/* ===== Report Status ===== */
.report-status {
  display: none;
}
.report-status.visible {
  display: block;
}
.status-step {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 0;
  font-size: 13px;
}
.status-step .step-icon {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  flex-shrink: 0;
}
.step-pending .step-icon { background: #1a1625; color: #5a5270; }
.step-active .step-icon { background: #1a1a00; color: #facc15; }
.step-done .step-icon { background: #0d1f0d; color: #4ade80; }
.step-failed .step-icon { background: #1f0d0d; color: #f87171; }
.step-label { color: #c9c2d6; }
.step-active .step-label { color: #e8e0f0; font-weight: 600; }
.step-done .step-label { color: #4ade80; }
.step-failed .step-label { color: #f87171; }

.download-link {
  display: none;
  margin-top: 12px;
}
.download-link.visible {
  display: block;
}

/* ===== Tooltip (Coming Soon) ===== */
.tooltip-wrap {
  position: relative;
  display: inline-block;
}
.tooltip-wrap .tooltip-text {
  visibility: hidden;
  background: #221e2e;
  color: #c9c2d6;
  text-align: center;
  padding: 4px 10px;
  border-radius: 4px;
  font-size: 11px;
  position: absolute;
  bottom: calc(100% + 6px);
  left: 50%;
  transform: translateX(-50%);
  white-space: nowrap;
  z-index: 10;
  opacity: 0;
  transition: opacity 0.15s;
}
.tooltip-wrap:hover .tooltip-text {
  visibility: visible;
  opacity: 1;
}

/* ===== Loading Spinner ===== */
.spinner {
  display: inline-block;
  width: 20px;
  height: 20px;
  border: 2px solid #2a2440;
  border-top-color: #8b5cf6;
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
}
.spinner-lg {
  width: 36px;
  height: 36px;
  border-width: 3px;
}
@keyframes spin {
  to { transform: rotate(360deg); }
}

.loading-state {
  display: none;
  text-align: center;
  padding: 32px;
}
.loading-state.visible {
  display: block;
}
.loading-state p {
  margin-top: 12px;
  color: #5a5270;
  font-size: 13px;
}

/* ===== Toast Notifications ===== */
.toast-container {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 1000;
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
}
.toast {
  pointer-events: auto;
  padding: 12px 20px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 500;
  color: #e8e0f0;
  background: #16131f;
  border: 1px solid #221e2e;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
  animation: toastIn 0.25s ease-out;
  max-width: 360px;
}
.toast.toast-success { border-color: #4ade80; color: #4ade80; }
.toast.toast-error { border-color: #f87171; color: #f87171; }
.toast.toast-warning { border-color: #facc15; color: #facc15; }
.toast.toast-out { animation: toastOut 0.2s ease-in forwards; }
@keyframes toastIn {
  from { opacity: 0; transform: translateX(40px); }
  to { opacity: 1; transform: translateX(0); }
}
@keyframes toastOut {
  from { opacity: 1; transform: translateX(0); }
  to { opacity: 0; transform: translateX(40px); }
}

/* ===== Admin Table ===== */
.admin-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
.admin-table th {
  text-align: left;
  padding: 8px 12px;
  font-size: 11px;
  font-weight: 600;
  color: #5a5270;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  border-bottom: 1px solid #221e2e;
}
.admin-table td {
  padding: 10px 12px;
  border-bottom: 1px solid #1a1625;
  color: #c9c2d6;
}
.admin-table tr:hover td {
  background: #1a1625;
}
.admin-table .mono {
  font-family: monospace;
  color: #a78bfa;
}

/* ===== Download / Expired / Centered Pages ===== */
.centered-page {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: calc(100vh - 80px);
  text-align: center;
  padding: 24px;
}
.centered-page h1 {
  font-size: 24px;
  font-weight: 700;
  color: #e8e0f0;
  margin-bottom: 12px;
}
.centered-page p {
  color: #5a5270;
  font-size: 14px;
  margin-bottom: 20px;
  max-width: 460px;
}
.centered-page .card {
  width: 100%;
  max-width: 480px;
}

/* ===== Message States ===== */
.msg-empty {
  text-align: center;
  padding: 24px;
  color: #5a5270;
  font-size: 13px;
}
.msg-error {
  text-align: center;
  padding: 16px;
  color: #f87171;
  font-size: 13px;
}
.msg-success {
  text-align: center;
  padding: 16px;
  color: #4ade80;
  font-size: 13px;
}

/* ===== Grid Layout ===== */
.grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

/* ===== Property Detail Rows ===== */
.detail-row {
  display: flex;
  justify-content: space-between;
  padding: 6px 0;
  border-bottom: 1px solid #1a1625;
  font-size: 13px;
}
.detail-row:last-child { border-bottom: none; }
.detail-label { color: #5a5270; }
.detail-value { color: #e8e0f0; font-weight: 500; text-align: right; }

/* ===== Hidden Utility ===== */
.hidden { display: none !important; }

/* ===== Responsive ===== */
@media (max-width: 768px) {
  header { padding: 12px 16px; }
  main { padding: 20px 16px; }
  .grid-2 { grid-template-columns: 1fr; }
  .form-row { flex-direction: column; }
  .form-row .btn { margin-bottom: 0; }
  .availability-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 480px) {
  .availability-grid { grid-template-columns: 1fr; }
  .property-header h1 { font-size: 18px; }
}
