* { box-sizing: border-box; }

body {
  margin: 0;
  padding: 0;
  background: #020617; /* Slate 950 */
  color: #e6eef8;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  font-size: 14px;
}

.app-container {
  width: 100%;
  max-width: 460px; /* Giới hạn chiều rộng giống extension popup */
  margin: 0 auto;
  padding: 16px;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* ================= HEADER ================= */
.header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
}
.logo { width: 28px; height: 28px; flex-shrink: 0; }
.title-block { display: flex; flex-direction: column; line-height: 1.1; }
.title { font-size: 13.5px; font-weight: 700; color: #e6eef8; margin: 0; }
.version { font-size: 11px; color: #94a3b8; }

.header-divider {
  width: 100%;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(148, 163, 184, 0.35), transparent);
  margin: 8px 0 12px;
}

/* ================= FARM CARD ================= */
.farm-card {
  background: rgba(31, 51, 88, 0.55);
  border: 1px solid #3a4a5e;
  border-radius: 10px;
  padding: 10px 12px;
  margin-bottom: 14px;
  color: #e8f1fa;
}
.farm-card-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }
.farm-card-title { font-weight: 700; font-size: 14px; color: #fff; margin: 0; }

.badge-pro-base {
  padding: 2px 6px;
  font-size: 11px;
  font-weight: 700;
  border-radius: 6px;
  display: inline-flex;
  align-items: center;
}
.badge-pro-disabled { background: #6b728080; color: #d1d5db; opacity: 0.7; }

.farm-info-row { display: flex; gap: 6px; font-size: 13px; margin-bottom: 6px; }
.label { color: #9fb3c9; font-weight: 700; width: 80px; }
.value { font-family: monospace; color: #e6eef8; }
.wallet-value { display: flex; align-items: center; gap: 4px; opacity: 0.9; }
.wallet-icon { width: 14px; height: 14px; opacity: 0.7; }

/* ================= PRICING ================= */
.pricing-section {
  background: rgba(31,51,88,0.55);
  border: 1px solid #263645;
  border-radius: 10px;
  padding: 14px;
}
.pricing-top { text-align: center; margin-bottom: 12px; }
.pricing-main-title { font-size: 15px; font-weight: 700; margin: 0 0 4px 0; }
.pricing-subtitle { font-size: 12px; color: #bcd0e6; margin: 0; }

.treasure-img { width: 100%; max-width: 280px; margin: 10px auto 6px; display: block; border-radius: 10px; }

.pricing-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; }

.pricing-item {
  background: linear-gradient(180deg,rgba(17,24,39,0.48),rgba(12,18,29,0.45));
  border: 1px solid #3b4b5c;
  border-radius: 8px;
  padding: 10px;
  position: relative;
  transition: 0.18s;
  cursor: pointer;
}
.pricing-hover:hover { border-color: #4f83ff; transform: translateY(-3px) scale(1.01); }
.disabled { opacity: 0.45; filter: grayscale(70%); cursor: default; }

.pricing-item-header { background: rgba(255,255,255,0.03); border-radius: 6px; padding: 4px 6px; text-align: center; margin-bottom: 6px; }
.plan-name { font-size: 13px; font-weight: 700; }

/* Yearly Highlight */
.yearly-highlight { border-color: #22c55e !important; background: rgba(34,197,94,0.15); }
.yearly-header { background: rgba(34,197,94,0.2) !important; }
.yearly-price { color: #4ade80 !important; }

.discount-badge {
  position: absolute; top: -10px; right: 12px;
  background: #facc15; color: #07122a;
  font-size: 12px; font-weight: 800;
  padding: 4px 10px; border-radius: 8px;
  border: 1px solid rgba(234,179,8,0.9);
  box-shadow: 0 6px 18px rgba(250,204,21,0.14);
  z-index: 20;
}

.price-row { display: flex; justify-content: center; align-items: center; gap: 4px; }
.price-icon { width: 18px; height: 18px; }
.price { font-size: 15px; font-weight: 800; color: #bcd0e6; margin: 0; }
.strike-row { margin-top: -1px; margin-bottom: 3px; display: flex; justify-content: center; align-items: center; gap: 3px; }
.strike-icon { width: 14px; height: 14px; }
.strike-text { color: #ef4444; text-decoration: line-through; font-weight: 700; font-size: 11.5px; }
.desc { font-size: 11.5px; color: #bcd0e6; text-align: center; margin: 4px 0 0; }
.desc.note { font-size: 10.5px; color: #94a3b8; }
.desc.coming { color: #facc15; font-weight: 700; }

/* ================= MODAL OVERLAY ================= */
.modal-overlay {
  position: fixed; inset: 0;
  background: rgba(2, 6, 23, 0.7);
  display: flex; align-items: flex-end; justify-content: center;
  padding: 12px; z-index: 9999;
  backdrop-filter: blur(2px);
  opacity: 0; visibility: hidden;
  transition: opacity 0.2s ease, visibility 0.2s;
}
.modal-overlay.open { opacity: 1; visibility: visible; }

.modal-container {
  width: 100%; max-width: 440px;
  background: #071425;
  border-radius: 12px;
  border: 1px solid rgba(255,255,255,0.1);
  overflow: hidden;
  display: flex; flex-direction: column;
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.5);
  transform: translateY(20px); transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}
.modal-overlay.open .modal-container { transform: translateY(0); }

.modal-header { padding: 14px 16px; border-bottom: 1px solid rgba(255,255,255,0.06); text-align: center; }
.header-title { font-size: 17px; font-weight: 800; color: #e6eef8; margin: 0; }

.modal-body { padding: 16px; color: #e9eef6; overflow-y: auto; max-height: 80vh; }
.wallet-subtitle { font-size: 14px; font-weight: 700; margin: 0 0 10px 0; text-align: center; }

.simple-amount { display: flex; justify-content: center; align-items: center; gap: 8px; font-size: 18px; font-weight: 900; color: #2775ca; margin: 16px 0 14px; }
.flower-icon { width: 20px; height: 20px; }
.amount-text { font-size: 22px; }
.unit { font-size: 12px; color: #bcd0e6; }

/* Network */
.network-block { margin-bottom: 14px; }
.network-label { font-size: 13px; font-weight: 800; color: #e6eef8; margin-bottom: 6px; }
.network-row { display: flex; gap: 12px; }
.network-item { display: flex; align-items: center; gap: 6px; background: rgba(255,255,255,0.04); border: 1px solid rgba(255,255,255,0.08); padding: 6px 10px; border-radius: 8px; font-weight: 700; font-size: 12px; }
.network-icon { width: 16px; height: 16px; }
.network-note { font-size: 12px; color: #bcd0e6; margin: 6px 0 0; }

/* Receiver */
.receiver-block { margin: 12px 0; }
.receiver-label { font-size: 12px; color: #9fb3c9; margin-bottom: 4px; }
.receiver-row { background: rgba(34, 197, 94, 0.1); border: 1px solid rgba(34, 197, 94, 0.25); padding: 10px; border-radius: 8px; display: flex; gap: 8px; align-items: center; }
.receiver-address { font-weight: 700; color: #e6fbe6; flex: 1; word-break: break-all; font-family: monospace; font-size: 12px; }
.copy-btn { background: transparent; border: none; cursor: pointer; padding: 4px; border-radius: 6px; color: #fff; display: flex; align-items: center; justify-content: center; }
.copy-btn:hover { background: rgba(255,255,255,0.1); }
.receiver-note { font-size: 11px; color: #bcd0e6; margin-top: 6px; }

/* Account Info in Modal */
.account-info { margin-top: 18px; border: 1px solid rgba(255,255,255,0.05); background: rgba(255,255,255,0.02); border-radius: 8px; padding: 10px; }
.info-title { font-weight: 700; margin-bottom: 8px; color: #cfe3ff; font-size: 12px; }
.info-grid { display: flex; flex-direction: column; gap: 8px; }
.info-row { display: flex; gap: 10px; font-size: 12px; }
.info-label { width: 80px; color: #9fb3c9; font-weight: 700; }
.info-value { flex: 1; background: rgba(255,255,255,0.03); padding: 4px 8px; border-radius: 6px; color: #e6eef8; word-break: break-all; font-family: monospace; }

/* Guides */
.wallet-guides { margin: 16px 0; padding-left: 18px; font-size: 12px; font-weight: 700; color: #fde68a; }
.wallet-guides li { margin-bottom: 8px; }

/* Action */
.action-row { margin-top: 10px; display: flex; justify-content: center; }
.btn-close {
  background: rgba(255,255,255,0.1); border: 1px solid rgba(255,255,255,0.1);
  color: #e6eef8; padding: 10px 0; width: 100%; border-radius: 8px;
  font-weight: 700; cursor: pointer; transition: 0.2s;
}
.btn-close:hover { background: rgba(255,255,255,0.15); }

/* Utilities */
.hidden { display: none !important; }
.break-all { word-break: break-all; }
footer { text-align: center; font-size: 11px; color: #50657e; margin-top: auto; padding-top: 20px; }

@media (max-width: 420px) {
  .pricing-grid { grid-template-columns: 1fr; }
}