/* ============================================================
   ClaimSOL - Dark Theme Styles
   ============================================================ */

:root {
  --bg-primary: #0a0b0f;
  --bg-secondary: #12131a;
  --bg-card: #1a1b25;
  --bg-card-hover: #222330;
  --border: #2a2b3a;
  --text-primary: #e8e8f0;
  --text-secondary: #8888a0;
  --text-muted: #555568;
  --accent: #9945ff;
  --accent-hover: #b06aff;
  --accent-glow: rgba(153, 69, 255, 0.3);
  --green: #14f195;
  --green-dim: rgba(20, 241, 149, 0.15);
  --red: #ff4545;
  --red-dim: rgba(255, 69, 69, 0.15);
  --orange: #ffa726;
  --radius: 12px;
  --radius-sm: 8px;
}

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

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: var(--bg-primary);
  color: var(--text-primary);
  min-height: 100vh;
  line-height: 1.6;
}

/* --- Header --- */
.header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 24px;
  background: var(--bg-secondary);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 100;
  backdrop-filter: blur(12px);
}

.header-left {
  display: flex;
  align-items: center;
  gap: 16px;
}

.logo-img {
  width: 32px;
  height: 32px;
  border-radius: 6px;
  object-fit: cover;
}

.logo {
  font-size: 20px;
  font-weight: 700;
  background: linear-gradient(135deg, var(--accent), var(--green));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.header-right {
  display: flex;
  align-items: center;
  gap: 12px;
}

/* --- Network Toggle --- */
.network-toggle {
  position: relative;
  display: flex;
  align-items: center;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 24px;
  padding: 3px;
  cursor: pointer;
  user-select: none;
  transition: border-color 0.3s;
}

.network-toggle:hover {
  border-color: var(--accent);
}

.network-opt {
  position: relative;
  z-index: 2;
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 600;
  padding: 5px 14px;
  cursor: pointer;
  transition: color 0.25s;
  letter-spacing: 0.3px;
  white-space: nowrap;
  display: flex;
  align-items: center;
  gap: 6px;
}

.network-opt.active {
  color: var(--text-primary);
}

.network-opt.active::before {
  content: '';
  display: inline-block;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  flex-shrink: 0;
}

#net-opt-mainnet.active::before {
  background: var(--green);
  box-shadow: 0 0 6px var(--green);
}

#net-opt-devnet.active::before {
  background: var(--orange);
  box-shadow: 0 0 6px var(--orange);
}

.network-slider {
  position: absolute;
  top: 3px;
  left: 3px;
  height: calc(100% - 6px);
  width: calc(50% - 3px);
  border-radius: 20px;
  background: var(--bg-card-hover);
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1), background 0.3s;
  z-index: 1;
}

.network-toggle.devnet .network-slider {
  transform: translateX(100%);
}


.social-link {
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 14px;
  transition: color 0.2s;
  display: flex;
  align-items: center;
  gap: 4px;
}

.social-link:hover {
  color: var(--text-primary);
}

.lang-btn {
  background: none;
  border: 1px solid var(--border);
  color: var(--text-secondary);
  padding: 4px 8px;
  border-radius: 4px;
  cursor: pointer;
  font-size: 12px;
  font-weight: 600;
  transition: all 0.2s;
}

.lang-btn.active {
  background: var(--accent);
  border-color: var(--accent);
  color: white;
}

.lang-btn:hover:not(.active) {
  border-color: var(--accent);
  color: var(--text-primary);
}

.wallet-btn {
  background: linear-gradient(135deg, var(--accent), #7b2ff2);
  color: white;
  border: none;
  padding: 8px 20px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}

.wallet-btn:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: 0 4px 15px var(--accent-glow);
}

.wallet-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.wallet-btn.connected {
  background: var(--bg-card);
  border: 1px solid var(--accent);
  color: var(--accent);
}

/* --- Main Content --- */
.main {
  max-width: 800px;
  margin: 0 auto;
  padding: 40px 24px;
}

/* --- Hero --- */
.hero {
  text-align: center;
  padding: 60px 0;
}

.hero h1 {
  font-size: 42px;
  font-weight: 800;
  line-height: 1.2;
  margin-bottom: 8px;
  background: linear-gradient(135deg, var(--text-primary), var(--accent));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero .subtitle {
  font-size: 42px;
  font-weight: 800;
  color: var(--green);
  margin-bottom: 20px;
}

.hero p {
  font-size: 17px;
  color: var(--text-secondary);
  max-width: 520px;
  margin: 0 auto 32px;
}

.hero-cta {
  display: inline-block;
  background: linear-gradient(135deg, var(--accent), #7b2ff2);
  color: white;
  padding: 14px 36px;
  border-radius: var(--radius);
  font-size: 16px;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  border: none;
  transition: all 0.2s;
}

.hero-cta:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px var(--accent-glow);
}

/* --- Accounts Section --- */
#accounts-section {
  display: none;
}

.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
}

.section-title {
  font-size: 24px;
  font-weight: 700;
  margin-bottom: 0;
}

.refresh-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  color: var(--text-secondary);
  padding: 6px 14px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}

.refresh-btn:hover {
  border-color: var(--accent);
  color: var(--text-primary);
}

.refresh-btn:active svg {
  animation: spin 0.5s ease;
}

.scanning {
  text-align: center;
  padding: 40px;
  color: var(--text-secondary);
  font-size: 16px;
}

.scanning::before {
  content: '';
  display: block;
  width: 32px;
  height: 32px;
  border: 3px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  margin: 0 auto 16px;
  animation: spin 0.8s linear infinite;
}

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

.empty-msg {
  text-align: center;
  padding: 40px;
  color: var(--text-secondary);
  background: var(--bg-card);
  border-radius: var(--radius);
  border: 1px solid var(--border);
}

.error-msg {
  text-align: center;
  padding: 20px;
  color: var(--red);
  background: var(--red-dim);
  border-radius: var(--radius);
}

.accounts-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
  color: var(--text-secondary);
  font-size: 14px;
}

.select-toggle-btn {
  background: none;
  border: 1px solid var(--border);
  color: var(--text-secondary);
  padding: 4px 12px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  cursor: pointer;
  transition: all 0.2s;
}

.select-toggle-btn:hover {
  border-color: var(--accent);
  color: var(--text-primary);
}

.accounts-grid {
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-height: 400px;
  overflow-y: auto;
  padding-right: 4px;
}

.accounts-grid::-webkit-scrollbar {
  width: 6px;
}

.accounts-grid::-webkit-scrollbar-track {
  background: transparent;
}

.accounts-grid::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 3px;
}

.account-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.15s;
}

.account-row:hover {
  background: var(--bg-card-hover);
}

.account-row.selected {
  border-color: var(--accent);
  background: rgba(153, 69, 255, 0.08);
}

.account-row input[type="checkbox"] {
  accent-color: var(--accent);
  width: 16px;
  height: 16px;
  cursor: pointer;
}

.account-info {
  display: flex;
  justify-content: space-between;
  flex: 1;
  gap: 8px;
}

.account-mint {
  font-family: monospace;
  font-size: 13px;
  color: var(--text-secondary);
}

.account-rent {
  font-size: 13px;
  font-weight: 600;
  color: var(--green);
  white-space: nowrap;
}

/* --- Summary --- */
.summary-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  margin-top: 20px;
}

.summary-row {
  display: flex;
  justify-content: space-between;
  padding: 8px 0;
  font-size: 15px;
}

.summary-row.total {
  border-top: 1px solid var(--border);
  margin-top: 8px;
  padding-top: 16px;
  font-size: 18px;
  font-weight: 700;
}

.summary-row .label {
  color: var(--text-secondary);
}

.summary-row .value {
  font-weight: 600;
}

.summary-row.total .value {
  color: var(--green);
}

.summary-row.fee .value {
  color: var(--orange);
}

.claim-btn {
  display: block;
  width: 100%;
  margin-top: 20px;
  padding: 14px;
  background: linear-gradient(135deg, var(--green), #0cbe7a);
  color: #000;
  border: none;
  border-radius: var(--radius);
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s;
}

.claim-btn:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(20, 241, 149, 0.3);
}

.claim-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* --- Results --- */
#result-section {
  display: none;
  margin-top: 24px;
}

.result-success {
  background: var(--green-dim);
  color: var(--green);
  padding: 16px;
  border-radius: var(--radius);
  font-weight: 600;
  text-align: center;
  margin-bottom: 12px;
}

.result-partial {
  background: rgba(255, 167, 38, 0.15);
  color: var(--orange);
  padding: 16px;
  border-radius: var(--radius);
  font-weight: 600;
  text-align: center;
  margin-bottom: 12px;
}

.result-error {
  background: var(--red-dim);
  color: var(--red);
  padding: 16px;
  border-radius: var(--radius);
  font-weight: 600;
  text-align: center;
  margin-bottom: 12px;
}

.result-tx {
  padding: 8px 0;
}

.result-tx a {
  color: var(--accent);
  text-decoration: none;
  font-family: monospace;
  font-size: 14px;
}

.result-tx a:hover {
  text-decoration: underline;
}

/* --- FAQ --- */
.faq-section {
  margin-top: 60px;
}

.faq-item {
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  margin-bottom: 8px;
  overflow: hidden;
}

.faq-question {
  padding: 16px 20px;
  background: var(--bg-card);
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-weight: 600;
  font-size: 15px;
  transition: background 0.2s;
}

.faq-question:hover {
  background: var(--bg-card-hover);
}

.faq-question::after {
  content: '+';
  font-size: 20px;
  color: var(--text-secondary);
  transition: transform 0.2s;
}

.faq-item.active .faq-question::after {
  content: '−';
}

.faq-answer {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s ease;
}

.faq-item.active .faq-answer {
  max-height: 300px;
}

.faq-answer-inner {
  padding: 16px 20px;
  color: var(--text-secondary);
  font-size: 14px;
  line-height: 1.7;
  border-top: 1px solid var(--border);
}

/* --- Footer --- */
.footer {
  margin-top: 60px;
  padding: 24px;
  border-top: 1px solid var(--border);
  text-align: center;
  color: var(--text-muted);
  font-size: 13px;
}

.footer a {
  color: var(--text-secondary);
  text-decoration: none;
}

.footer a:hover {
  color: var(--text-primary);
}

/* --- Toast --- */
.toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  padding: 12px 24px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 500;
  opacity: 0;
  transition: all 0.3s;
  z-index: 1000;
  max-width: 400px;
}

.toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

.toast-info {
  background: var(--bg-card);
  border: 1px solid var(--border);
  color: var(--text-primary);
}

.toast-error {
  background: var(--red-dim);
  border: 1px solid var(--red);
  color: var(--red);
}

.toast-success {
  background: var(--green-dim);
  border: 1px solid var(--green);
  color: var(--green);
}

/* --- Wallet Modal --- */
.wallet-modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(4px);
  z-index: 1000;
  align-items: center;
  justify-content: center;
}

.wallet-modal-overlay.open {
  display: flex;
}

.wallet-modal {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  width: 380px;
  max-width: 92vw;
  max-height: 80vh;
  overflow: hidden;
  animation: modalIn 0.2s ease;
}

@keyframes modalIn {
  from {
    opacity: 0;
    transform: scale(0.95) translateY(10px);
  }
  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

.wallet-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 20px;
  border-bottom: 1px solid var(--border);
}

.wallet-modal-header h3 {
  font-size: 16px;
  font-weight: 700;
}

.wallet-modal-close {
  background: none;
  border: none;
  color: var(--text-secondary);
  font-size: 22px;
  cursor: pointer;
  padding: 0 4px;
  line-height: 1;
  transition: color 0.2s;
}

.wallet-modal-close:hover {
  color: var(--text-primary);
}

.wallet-modal-body {
  padding: 8px;
  overflow-y: auto;
  max-height: 60vh;
}

.wallet-modal-section {
  padding: 10px 12px 4px;
}

.wallet-modal-label {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.8px;
}

.wallet-option {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 12px 14px;
  background: none;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  cursor: pointer;
  transition: all 0.15s;
  text-decoration: none;
  font-size: 14px;
}

.wallet-option:hover {
  background: var(--bg-card);
  border-color: var(--border);
}

.wallet-option-icon {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  flex-shrink: 0;
}

.wallet-option-name {
  flex: 1;
  text-align: left;
  font-weight: 600;
}

.wallet-option-badge {
  font-size: 11px;
  font-weight: 600;
  color: var(--green);
  background: var(--green-dim);
  padding: 3px 8px;
  border-radius: 12px;
}

.wallet-option.not-installed {
  opacity: 0.55;
}

.wallet-option.not-installed:hover {
  opacity: 0.8;
}

.wallet-option-install {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-secondary);
  background: var(--bg-card);
  padding: 3px 8px;
  border-radius: 12px;
}

.wallet-modal-empty {
  padding: 32px 20px;
  text-align: center;
  color: var(--text-secondary);
  font-size: 14px;
}

/* Wallet button icon when connected */
.wallet-btn-icon {
  width: 18px;
  height: 18px;
  border-radius: 4px;
  vertical-align: middle;
  margin-right: 6px;
}

.wallet-btn.connected {
  display: flex;
  align-items: center;
  gap: 6px;
}

/* --- Responsive --- */
@media (max-width: 768px) {
  .header {
    flex-wrap: wrap;
    gap: 12px;
    padding: 12px 16px;
  }

  .header-right {
    flex-wrap: wrap;
    gap: 8px;
  }

  .hero h1,
  .hero .subtitle {
    font-size: 28px;
  }

  .hero p {
    font-size: 15px;
  }

  .main {
    padding: 24px 16px;
  }

  .account-info {
    flex-direction: column;
    gap: 4px;
  }

  .wallet-btn {
    padding: 6px 14px;
    font-size: 13px;
  }

  .network-opt {
    font-size: 11px;
    padding: 4px 10px;
  }

}

@media (max-width: 480px) {
  .hero h1,
  .hero .subtitle {
    font-size: 24px;
  }

  .lang-btn {
    padding: 3px 6px;
    font-size: 11px;
  }
}
