@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap');

:root {
  --primary: #3b82f6;
  --primary-hover: #2563eb;
  --bg-dark: #0f172a;
  --bg-card: #1e293b;
  --text-main: #f8fafc;
  --text-muted: #94a3b8;
  --glass-bg: rgba(30, 41, 59, 0.7);
  --glass-border: rgba(255, 255, 255, 0.1);
  --success: #10b981;
  --error: #ef4444;
  --warning: #f59e0b;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: 'Inter', sans-serif;
  background-color: var(--bg-dark);
  color: var(--text-main);
  line-height: 1.6;
  overflow-x: hidden;
  background-image:
    radial-gradient(at 0% 0%, hsla(253, 16%, 7%, 1) 0, transparent 50%),
    radial-gradient(at 50% 0%, hsla(225, 39%, 30%, 1) 0, transparent 50%),
    radial-gradient(at 100% 0%, hsla(339, 49%, 30%, 1) 0, transparent 50%);
  min-height: 100vh;
}

/* Scrollbar */
::-webkit-scrollbar {
  width: 8px;
}

::-webkit-scrollbar-track {
  background: var(--bg-dark);
}

::-webkit-scrollbar-thumb {
  background: #475569;
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: #64748b;
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 2rem;
}

.view-section {
  display: none;
  animation: fadeIn 0.4s ease-out;
}

.view-section.active {
  display: block;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }

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

/* Typography */
h1,
h2,
h3 {
  font-weight: 700;
  letter-spacing: -0.025em;
}

h1 {
  font-size: 2.5rem;
  margin-bottom: 1rem;
  background: linear-gradient(to right, #60a5fa, #a78bfa);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

h2 {
  font-size: 1.5rem;
  margin-bottom: 1.5rem;
}

h3 {
  font-size: 1.25rem;
  color: var(--text-main);
}

/* Header */
.app-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 3rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--glass-border);
}

/* Cards */
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 2rem;
}

.land-card {
  background: var(--glass-bg);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--glass-border);
  border-radius: 1rem;
  padding: 1.5rem;
  transition: transform 0.2s, box-shadow 0.2s;
  display: flex;
  flex-direction: column;
  position: relative;
  overflow: hidden;
}

.land-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
  border-color: rgba(255, 255, 255, 0.2);
}

.land-map-canvas {
  width: 100%;
  height: 200px;
  background: #0f172a;
  border-radius: 0.75rem;
  margin-bottom: 1rem;
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.3);
  image-rendering: pixelated;
  /* Crucial for retro look */
}

.land-details {
  flex-grow: 1;
}

.land-details h3 {
  font-size: 1.1rem;
  margin-bottom: 0.5rem;
}

.land-details p {
  font-size: 0.875rem;
  color: var(--text-muted);
  display: flex;
  justify-content: space-between;
  margin-bottom: 0.25rem;
}

.detail-value {
  color: var(--text-main);
  font-weight: 600;
  font-family: 'Consolas', 'Monaco', monospace;
}

/* Status Indicators */
.status-paid {
  color: var(--success);
  text-shadow: 0 0 10px rgba(16, 185, 129, 0.3);
}

.status-pending {
  color: var(--warning);
  text-shadow: 0 0 10px rgba(245, 158, 11, 0.3);
}

.status-expired {
  color: var(--error);
}

/* Buttons */
.button {
  background: linear-gradient(180deg, var(--primary) 0%, var(--primary-hover) 100%);
  color: white;
  border: none;
  border-bottom: 4px solid #1d4ed8;
  /* Darker shade */
  padding: 0.75rem 1.5rem;
  border-radius: 4px;
  /* Blockier */
  font-weight: 700;
  cursor: pointer;
  transition: all 0.1s;
  font-size: 0.9rem;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  text-shadow: 1px 1px 0 rgba(0, 0, 0, 0.5);
  box-shadow: 0 4px 0 rgba(0, 0, 0, 0.2);
}

.button:hover:not(:disabled) {
  transform: translateY(-2px);
  filter: brightness(1.1);
  box-shadow: 0 6px 0 rgba(0, 0, 0, 0.2);
  border-bottom-width: 4px;
}

.button:active:not(:disabled) {
  transform: translateY(2px);
  border-bottom-width: 0px;
  box-shadow: 0 0 0 rgba(0, 0, 0, 0.2);
  margin-top: 4px;
  /* Counteract border removal */
  margin-bottom: -4px;
}

.button:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  filter: grayscale(0.8);
  border-bottom-color: #334155;
}

.logout-button,
.cancel-button {
  background: #334155;
  border-bottom-color: #1e293b;
  color: var(--text-main);
}

.logout-button:hover,
.cancel-button:hover {
  background: #475569;
}

.copy-button {
  padding: 0.25rem 0.5rem;
  font-size: 0.7rem;
  background: var(--bg-card);
  border: 1px solid var(--glass-border);
  border-bottom: 3px solid #0f172a;
  border-radius: 4px;
  margin-left: 0.5rem;
  text-shadow: none;
}

.copy-button:active {
  transform: translateY(2px);
  border-bottom: 1px solid #0f172a;
}

/* Forms */
.form-container {
  background: var(--glass-bg);
  padding: 2.5rem;
  border-radius: 1.5rem;
  border: 1px solid var(--glass-border);
  max-width: 500px;
  margin: 0 auto;
}

.form-group {
  margin-bottom: 1.5rem;
}

label {
  display: block;
  margin-bottom: 0.5rem;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-muted);
}

input,
select {
  width: 100%;
  padding: 0.75rem 1rem;
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid var(--glass-border);
  border-radius: 0.75rem;
  color: var(--text-main);
  font-family: inherit;
  font-size: 1rem;
  transition: border-color 0.2s;
}

input:focus,
select:focus {
  outline: none;
  border-color: var(--primary);
  background: rgba(0, 0, 0, 0.4);
}

/* Payment Section in Card */
.pending-payment-section {
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid var(--glass-border);
  background: rgba(245, 158, 11, 0.1);
  /* Subtle warning bg */
  border-radius: 0 0 0.5rem 0.5rem;
  /* Rounded bottom */
  margin: 1rem -1.5rem -1.5rem -1.5rem;
  /* Stretch full width */
  padding: 1rem 1.5rem;
}

.pending-payment-section h4 {
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--warning);
  margin-bottom: 0.5rem;
}

.pending-payment-section code {
  background: rgba(0, 0, 0, 0.4);
  padding: 0.2rem 0.4rem;
  border-radius: 4px;
  font-family: monospace;
  color: #fbbf24;
  display: block;
  margin-bottom: 0.5rem;
  word-break: break-all;
}

.timer-display {
  font-variant-numeric: tabular-nums;
  font-weight: 700;
  color: var(--warning);
}

/* Overlays */
#loading-overlay,
#payment-status-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.9);
  backdrop-filter: blur(8px);
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  z-index: 1000;
}

.spinner {
  width: 50px;
  height: 50px;
  border: 4px solid rgba(255, 255, 255, 0.1);
  border-left-color: var(--primary);
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin-bottom: 1.5rem;
}

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

#payment-status-icon svg {
  width: 80px;
  height: 80px;
  margin-bottom: 1rem;
}

.success-icon {
  color: var(--success);
}

.error-icon {
  color: var(--error);
}

#payment-status-message {
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: 2rem;
}

/* Utility */
.messages {
  margin-top: 1rem;
  padding: 1rem;
  border-radius: 0.75rem;
  font-size: 0.9rem;
  display: none;
}

.message-error {
  background: rgba(239, 68, 68, 0.15);
  color: #fca5a5;
  display: block;
}

.message-success {
  background: rgba(16, 185, 129, 0.15);
  color: #6ee7b7;
  display: block;
}