:root {
  --bg-color: #0d0f12;
  --surface-color: #232931;
  --primary-color: #43B77E;
  --primary-hover: #37a06d;
  --text-main: #f0f0f0;
  --text-muted: #9aa0a6;
  --border-color: rgba(255, 255, 255, 0.12);
  --glass-bg: rgba(26, 30, 36, 0.6);
  --glass-border: rgba(255, 255, 255, 0.05);
}

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

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background-color: var(--bg-color);
  color: var(--text-main);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

a {
  color: var(--primary-color);
  text-decoration: none;
  transition: color 0.2s ease;
}

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

/* Navbar */
.navbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.5rem 4rem;
  background: var(--glass-bg);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--glass-border);
  position: sticky;
  top: 0;
  z-index: 100;
}

.nav-brand {
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: -0.5px;
  color: var(--text-main);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.nav-brand:hover {
  color: var(--text-main);
}

.nav-brand .accent {
  color: var(--primary-color);
}

.nav-logo {
  height: 32px;
  width: 32px;
  object-fit: contain;
  border-radius: 4px;
}

.nav-links {
  display: flex;
  gap: 1.5rem;
  align-items: center;
}

/* Buttons */
.btn {
  display: inline-block;
  padding: 0.6rem 1.2rem;
  border-radius: 8px;
  font-weight: 500;
  font-size: 0.95rem;
  cursor: pointer;
  transition: all 0.2s ease;
  border: none;
  text-align: center;
}

.btn-primary {
  background: var(--primary-color);
  color: #000;
  box-shadow: 0 4px 14px rgba(67, 183, 126, 0.3);
}

.btn-primary:hover {
  background: var(--primary-hover);
  color: #000;
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(67, 183, 126, 0.4);
}

.btn-outline {
  background: transparent;
  color: var(--text-main);
  border: 1px solid var(--border-color);
}

.btn-outline:hover {
  background: rgba(255, 255, 255, 0.05);
  border-color: var(--text-main);
}

.btn-lg {
  font-size: 1.1rem;
  padding: 0.8rem 2rem;
}

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

/* Forms */
.form-container {
  max-width: 400px;
  margin: 4rem auto;
  padding: 2.5rem;
  background: var(--surface-color);
  border-radius: 16px;
  border: 1px solid var(--border-color);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
}

.form-container h2 {
  margin-bottom: 1.5rem;
  font-size: 1.8rem;
  text-align: center;
}

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

.form-group label {
  display: block;
  margin-bottom: 0.4rem;
  font-size: 0.9rem;
  color: var(--text-muted);
}

.form-group input {
  width: 100%;
  padding: 0.75rem 1rem;
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.2);
  border: 1px solid var(--border-color);
  color: var(--text-main);
  font-family: inherit;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.form-group input:focus {
  outline: none;
  border-color: var(--primary-color);
  box-shadow: 0 0 0 2px rgba(67, 183, 126, 0.2);
}

.helptext {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: 0.3rem;
  display: block;
}

/* Landing Page */
.hero {
  padding: 6rem 0 3rem;
  text-align: center;
}

.hero-brand {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.hero-logo {
  height: 72px;
  width: 72px;
  object-fit: contain;
  border-radius: 12px;
}

.hero h1 {
  font-size: 4.5rem;
  font-weight: 800;
  line-height: 1.1;
  letter-spacing: -2px;
}

.hero-subtitle {
  font-size: 1.4rem;
  color: var(--text-muted);
  max-width: 600px;
  margin: 0 auto 2.5rem;
}

.section-title {
  font-size: 2.5rem;
  font-weight: 700;
  margin-bottom: 3rem;
  text-align: center;
}

.section {
  padding: 5rem 0;
}

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 2rem;
}

.card {
  background: var(--surface-color);
  padding: 2.5rem;
  border-radius: 16px;
  border: 1px solid var(--border-color);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.card:hover {
  transform: translateY(-5px);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4);
  border-color: rgba(67, 183, 126, 0.3);
}

.card-icon {
  font-size: 2.5rem;
  color: var(--primary-color);
  margin-bottom: 1.5rem;
}

.card h3 {
  font-size: 1.4rem;
  margin-bottom: 1rem;
}

.card p {
  color: var(--text-muted);
}

/* Dashboard */
.dashboard {
  padding: 3rem 0;
}

.dashboard h2 {
  font-size: 2rem;
  font-weight: 700;
  margin-bottom: 2rem;
}

.dash-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.5rem;
}

.dash-card {
  background: var(--surface-color);
  padding: 2rem;
  border-radius: 16px;
  border: 1px solid var(--border-color);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

.dash-card h3 {
  font-size: 1.1rem;
  font-weight: 600;
  margin-bottom: 1rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  font-size: 0.85rem;
}

.dash-card .value {
  font-size: 1.8rem;
  font-weight: 700;
  color: var(--primary-color);
}

.copy-row {
  display: flex;
  gap: 0.5rem;
  align-items: stretch;
}

.copy-row input {
  flex: 1;
  padding: 0.7rem 1rem;
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid var(--border-color);
  color: var(--text-main);
  font-family: 'SF Mono', 'Fira Code', monospace;
  font-size: 0.85rem;
}

.copy-row input:focus {
  outline: none;
}

.btn-copy {
  padding: 0.7rem 1rem;
  border-radius: 8px;
  background: var(--primary-color);
  color: #000;
  border: none;
  cursor: pointer;
  font-weight: 600;
  font-size: 0.85rem;
  transition: all 0.2s ease;
  white-space: nowrap;
}

.btn-copy:hover {
  background: var(--primary-hover);
}

.btn-copy.copied {
  background: #2d8a5e;
  color: #fff;
}

/* Credit History Table */
.credit-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 1rem;
}

.credit-table th,
.credit-table td {
  padding: 0.7rem 1rem;
  text-align: left;
  border-bottom: 1px solid var(--border-color);
  font-size: 0.9rem;
}

.credit-table th {
  color: var(--text-muted);
  font-weight: 500;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.credit-table .credit {
  color: var(--primary-color);
}

.credit-table .debit {
  color: #e74c3c;
}

/* Full-width dash card */
.dash-card.full-width {
  grid-column: 1 / -1;
}

/* Pricing Page */
.pricing-hero {
  padding: 4rem 0 2rem;
  text-align: center;
}

.pricing-hero h1 {
  font-size: 3rem;
  font-weight: 800;
  margin-bottom: 1rem;
}

.pricing-hero p {
  color: var(--text-muted);
  font-size: 1.2rem;
}

.pricing-card {
  max-width: 500px;
  margin: 3rem auto;
  background: var(--surface-color);
  padding: 3rem;
  border-radius: 20px;
  border: 2px solid var(--primary-color);
  text-align: center;
  box-shadow: 0 10px 40px rgba(67, 183, 126, 0.15);
}

.pricing-amount {
  font-size: 4rem;
  font-weight: 800;
  color: var(--text-main);
  margin: 1rem 0;
}

.pricing-amount span {
  font-size: 1.2rem;
  color: var(--text-muted);
  font-weight: 400;
}

.pricing-desc {
  color: var(--text-muted);
  font-size: 1.1rem;
  margin-bottom: 2rem;
}

.promo-banner {
  max-width: 700px;
  margin: 2rem auto;
  padding: 1.5rem 2rem;
  background: rgba(67, 183, 126, 0.1);
  border: 1px solid rgba(67, 183, 126, 0.3);
  border-radius: 12px;
  text-align: center;
  font-size: 1.1rem;
}

.promo-banner strong {
  color: var(--primary-color);
}

@media (max-width: 768px) {
  .navbar {
    padding: 1rem 1.5rem;
  }

  .hero h1 {
    font-size: 2.5rem;
  }

  .hero-logo {
    height: 48px;
    width: 48px;
  }

  .dash-grid {
    grid-template-columns: 1fr;
  }

  .grid {
    grid-template-columns: 1fr;
  }

  .pricing-amount {
    font-size: 3rem;
  }
}

/* Tabs */
.tabs-container {
  margin-top: 2rem;
  display: flex;
  gap: 3rem;
  align-items: flex-start;
}

.tab-nav {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  border-bottom: none;
  border-right: 1px solid var(--border-color);
  margin-bottom: 0;
  padding-bottom: 0;
  padding-right: 1.5rem;
  width: 180px;
  flex-shrink: 0;
}

.tab-btn {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 0.95rem;
  font-weight: 600;
  padding: 0.8rem 1.2rem;
  cursor: pointer;
  transition: all 0.2s ease;
  border-radius: 8px;
  white-space: nowrap;
  text-align: left;
  width: 100%;
}

.tab-btn:hover {
  color: var(--text-main);
  background: rgba(255, 255, 255, 0.05);
}

.tab-btn.active {
  color: var(--primary-color);
  background: rgba(67, 183, 126, 0.1);
  border-bottom: none;
}

.tab-content-area {
  flex: 1;
  min-width: 0; /* Prevents overflow in flex items */
}

@media (max-width: 768px) {
  .tabs-container {
    flex-direction: column;
    gap: 1.5rem;
  }

  .tab-nav {
    flex-direction: row;
    width: 100%;
    border-right: none;
    border-bottom: 1px solid var(--border-color);
    padding-right: 0;
    padding-bottom: 1rem;
    overflow-x: auto;
  }

  .tab-btn {
    text-align: center;
    width: auto;
  }
}

.tab-panel {
  display: none;
}

.tab-panel.active {
  display: block;
}

/* Note Cards */
.note-cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 1.5rem;
}

.note-card {
  background: var(--surface-color);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  transition: transform 0.2s ease;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.note-card:hover {
  transform: translateY(-3px);
  border-color: rgba(67, 183, 126, 0.3);
}

.note-card .time {
  font-size: 0.8rem;
  color: var(--text-muted);
  display: block;
}

.note-card .content-preview {
  font-size: 1rem;
  font-weight: 500;
  color: var(--text-main);
  word-break: break-all;
}

.note-card .txid-link {
  font-size: 0.85rem;
  font-family: 'SF Mono', 'Fira Code', monospace;
  color: var(--primary-color);
  text-decoration: underline;
  word-break: break-all;
}

.note-card .status-badge {
  display: inline-block;
  padding: 0.25rem 0.6rem;
  border-radius: 4px;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
}

.status-badge.published {
  background: rgba(67, 183, 126, 0.1);
  color: var(--primary-color);
}

.status-badge.queued {
  background: rgba(255, 152, 0, 0.1);
  color: #ff9800;
}

.status-badge.error {
  background: rgba(231, 76, 60, 0.1);
  color: #e74c3c;
}
