/* ============================================================
   Pet Care Token — Global Styles
   ============================================================ */

:root {
  --primary: #6C63FF;
  --primary-dark: #5248d4;
  --secondary: #00D9A6;
  --secondary-dark: #00b88d;
  --dark: #1a1a2e;
  --dark-mid: #16213e;
  --light: #f8f9fa;
  --text: #2d2d2d;
  --text-muted: #6c757d;
  --border: #dee2e6;
  --success: #28a745;
  --warning: #ffc107;
  --danger: #dc3545;
  --card-bg: #ffffff;
  --shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
  --shadow-hover: 0 8px 30px rgba(108, 99, 255, 0.2);
  --radius: 12px;
  --transition: 0.25s ease;
}

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

html {
  scroll-behavior: smooth;
}

body {
  font-family: system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  line-height: 1.6;
  color: var(--text);
  background: var(--light);
}

.container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 1.25rem;
}

/* ============================================================
   Navigation
   ============================================================ */

.navbar {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(26, 26, 46, 0.97);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  padding: 0.75rem 0;
}

.navbar .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.navbar-brand {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: #fff;
  text-decoration: none;
  font-weight: 700;
  font-size: 1.1rem;
}

.navbar-brand .logo-icon {
  font-size: 1.5rem;
}

.navbar-links {
  display: flex;
  gap: 1.5rem;
  list-style: none;
}

.navbar-links a {
  color: rgba(255, 255, 255, 0.8);
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 500;
  transition: color var(--transition);
}

.navbar-links a:hover {
  color: var(--secondary);
}

/* Hamburger (CSS-only, no JS) */
.nav-toggle {
  display: none;
}

.nav-toggle-label {
  display: none;
  flex-direction: column;
  gap: 5px;
  cursor: pointer;
  padding: 4px;
}

.nav-toggle-label span {
  display: block;
  width: 24px;
  height: 2px;
  background: #fff;
  border-radius: 2px;
  transition: var(--transition);
}

@media (max-width: 640px) {
  .nav-toggle-label {
    display: flex;
  }

  .navbar-links {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    flex-direction: column;
    gap: 0;
    background: var(--dark);
    padding: 1rem 1.25rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  }

  .navbar-links a {
    display: block;
    padding: 0.6rem 0;
    font-size: 1rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  }

  .nav-toggle:checked ~ .navbar-links {
    display: flex;
  }
}

/* ============================================================
   Buttons
   ============================================================ */

.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.7rem 1.5rem;
  border: none;
  border-radius: 8px;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  transition: all var(--transition);
  white-space: nowrap;
}

.btn-primary {
  background: var(--primary);
  color: #fff;
  box-shadow: 0 4px 15px rgba(108, 99, 255, 0.35);
}

.btn-primary:hover {
  background: var(--primary-dark);
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(108, 99, 255, 0.45);
}

.btn-secondary {
  background: transparent;
  color: #fff;
  border: 2px solid rgba(255, 255, 255, 0.4);
}

.btn-secondary:hover {
  border-color: var(--secondary);
  color: var(--secondary);
  transform: translateY(-2px);
}

.btn-success {
  background: var(--secondary);
  color: #fff;
  box-shadow: 0 4px 15px rgba(0, 217, 166, 0.3);
}

.btn-success:hover {
  background: var(--secondary-dark);
  transform: translateY(-2px);
}

.btn-connect {
  animation: pulse-btn 2.5s infinite;
}

@keyframes pulse-btn {
  0%, 100% { box-shadow: 0 4px 15px rgba(108, 99, 255, 0.35); }
  50% { box-shadow: 0 4px 25px rgba(108, 99, 255, 0.65); }
}

.btn-connect.connected {
  animation: none;
  background: var(--secondary);
  box-shadow: 0 4px 15px rgba(0, 217, 166, 0.3);
}

/* ============================================================
   Hero Section
   ============================================================ */

.hero {
  background: linear-gradient(135deg, var(--dark) 0%, var(--dark-mid) 50%, #0f3460 100%);
  color: #fff;
  padding: 5rem 0 4rem;
  text-align: center;
  position: relative;
  overflow: hidden;
}

.hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at 30% 50%, rgba(108, 99, 255, 0.15) 0%, transparent 60%),
              radial-gradient(ellipse at 70% 50%, rgba(0, 217, 166, 0.1) 0%, transparent 60%);
}

.hero .container {
  position: relative;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  background: rgba(0, 217, 166, 0.15);
  border: 1px solid rgba(0, 217, 166, 0.3);
  color: var(--secondary);
  padding: 0.35rem 0.9rem;
  border-radius: 50px;
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  margin-bottom: 1.5rem;
}

.hero-title {
  font-size: clamp(2.2rem, 5vw, 3.5rem);
  font-weight: 800;
  line-height: 1.15;
  margin-bottom: 1rem;
  letter-spacing: -0.02em;
}

.hero-title .accent {
  background: linear-gradient(135deg, var(--secondary) 0%, #00a8ff 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero-subtitle {
  font-size: clamp(1rem, 2vw, 1.2rem);
  color: rgba(255, 255, 255, 0.75);
  max-width: 560px;
  margin: 0 auto 2.5rem;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  justify-content: center;
  margin-bottom: 3rem;
}

.wallet-address {
  display: none;
  font-family: monospace;
  font-size: 0.85rem;
  color: var(--secondary);
  background: rgba(0, 217, 166, 0.1);
  border: 1px solid rgba(0, 217, 166, 0.25);
  padding: 0.3rem 0.8rem;
  border-radius: 50px;
  margin-top: 0.75rem;
}

.hero-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 2rem;
  justify-content: center;
  padding-top: 2rem;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.stat-item {
  text-align: center;
}

.stat-value {
  font-size: 1.6rem;
  font-weight: 700;
  color: var(--secondary);
}

.stat-label {
  font-size: 0.8rem;
  color: rgba(255, 255, 255, 0.55);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* ============================================================
   Sections
   ============================================================ */

.section {
  padding: 5rem 0;
}

.section-alt {
  background: #fff;
}

.section-header {
  text-align: center;
  margin-bottom: 3rem;
}

.section-tag {
  display: inline-block;
  color: var(--primary);
  font-weight: 600;
  font-size: 0.8rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-bottom: 0.6rem;
}

.section-title {
  font-size: clamp(1.6rem, 3vw, 2.2rem);
  font-weight: 800;
  color: var(--dark);
  line-height: 1.2;
  margin-bottom: 0.75rem;
}

.section-desc {
  color: var(--text-muted);
  max-width: 520px;
  margin: 0 auto;
}

/* ============================================================
   Token Info Cards
   ============================================================ */

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

.card {
  background: var(--card-bg);
  border-radius: var(--radius);
  padding: 2rem;
  box-shadow: var(--shadow);
  border: 1px solid rgba(0, 0, 0, 0.06);
  transition: transform var(--transition), box-shadow var(--transition);
  animation: fade-in-up 0.5s ease both;
}

.card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-hover);
}

.card:nth-child(2) { animation-delay: 0.1s; }
.card:nth-child(3) { animation-delay: 0.2s; }

@keyframes fade-in-up {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

.card-icon {
  font-size: 2.5rem;
  margin-bottom: 1rem;
}

.card-title {
  font-size: 1rem;
  font-weight: 700;
  color: var(--dark);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 0.4rem;
}

.card-value {
  font-size: 1.8rem;
  font-weight: 800;
  color: var(--primary);
  margin-bottom: 0.5rem;
}

.card-desc {
  font-size: 0.9rem;
  color: var(--text-muted);
  line-height: 1.5;
}

/* ============================================================
   How to Buy Steps
   ============================================================ */

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

.step {
  position: relative;
  padding: 2rem;
  background: var(--light);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  counter-increment: steps;
  animation: fade-in-up 0.5s ease both;
}

.step:nth-child(2) { animation-delay: 0.1s; }
.step:nth-child(3) { animation-delay: 0.2s; }

.step-number {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2.5rem;
  height: 2.5rem;
  background: var(--primary);
  color: #fff;
  font-weight: 800;
  font-size: 1.1rem;
  border-radius: 50%;
  margin-bottom: 1rem;
}

.step-title {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--dark);
  margin-bottom: 0.5rem;
}

.step-desc {
  font-size: 0.9rem;
  color: var(--text-muted);
  line-height: 1.6;
}

.step-desc a {
  color: var(--primary);
  text-decoration: none;
  font-weight: 600;
}

.step-desc a:hover {
  text-decoration: underline;
}

/* ============================================================
   Buy Section
   ============================================================ */

.buy-section {
  background: linear-gradient(135deg, var(--dark) 0%, var(--dark-mid) 100%);
  color: #fff;
}

.buy-section .section-title {
  color: #fff;
}

.buy-section .section-desc {
  color: rgba(255, 255, 255, 0.65);
}

.buy-form-wrapper {
  max-width: 480px;
  margin: 0 auto;
}

.wallet-required-msg {
  text-align: center;
  padding: 2.5rem;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--radius);
}

.wallet-required-msg p {
  color: rgba(255, 255, 255, 0.65);
  margin-bottom: 1.25rem;
}

.purchase-form {
  display: none;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: var(--radius);
  padding: 2rem;
}

.purchase-form.visible {
  display: block;
}

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

.form-label {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.75);
  margin-bottom: 0.4rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.form-input {
  width: 100%;
  padding: 0.75rem 1rem;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 8px;
  color: #fff;
  font-size: 1rem;
  transition: border-color var(--transition);
  outline: none;
}

.form-input:focus {
  border-color: var(--primary);
  background: rgba(255, 255, 255, 0.1);
}

.form-input::placeholder {
  color: rgba(255, 255, 255, 0.3);
}

.pct-preview {
  text-align: center;
  padding: 1rem;
  background: rgba(0, 217, 166, 0.1);
  border: 1px solid rgba(0, 217, 166, 0.2);
  border-radius: 8px;
  margin-bottom: 1.25rem;
  font-size: 1.1rem;
  color: var(--secondary);
  font-weight: 700;
}

.btn-buy {
  width: 100%;
  justify-content: center;
  font-size: 1rem;
  padding: 0.85rem;
}

.tx-status {
  display: none;
  margin-top: 1rem;
  padding: 0.75rem 1rem;
  border-radius: 8px;
  font-size: 0.9rem;
  font-weight: 600;
  text-align: center;
}

.tx-status.pending {
  display: block;
  background: rgba(255, 193, 7, 0.15);
  border: 1px solid rgba(255, 193, 7, 0.3);
  color: var(--warning);
}

.tx-status.confirmed {
  display: block;
  background: rgba(0, 217, 166, 0.15);
  border: 1px solid rgba(0, 217, 166, 0.3);
  color: var(--secondary);
}

.tx-status.failed {
  display: block;
  background: rgba(220, 53, 69, 0.15);
  border: 1px solid rgba(220, 53, 69, 0.3);
  color: var(--danger);
}

.no-metamask-msg {
  display: none;
  text-align: center;
  padding: 1.5rem;
  background: rgba(255, 193, 7, 0.1);
  border: 1px solid rgba(255, 193, 7, 0.25);
  border-radius: var(--radius);
  color: var(--warning);
}

.no-metamask-msg a {
  color: var(--secondary);
  font-weight: 600;
}

/* Hidden config carrier — embeds server data for client JS */
#pct-config {
  display: none;
}

/* ============================================================
   Purchase History
   ============================================================ */

.history-section {
  padding: 4rem 0;
}

.table-wrapper {
  overflow-x: auto;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  border: 1px solid var(--border);
}

table {
  width: 100%;
  border-collapse: collapse;
  background: #fff;
  font-size: 0.88rem;
}

thead {
  background: var(--dark);
  color: rgba(255, 255, 255, 0.85);
}

th {
  padding: 0.9rem 1rem;
  text-align: left;
  font-weight: 600;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  white-space: nowrap;
}

td {
  padding: 0.85rem 1rem;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}

tr:last-child td {
  border-bottom: none;
}

tr:hover td {
  background: rgba(108, 99, 255, 0.03);
}

.badge {
  display: inline-block;
  padding: 0.2rem 0.6rem;
  border-radius: 50px;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.badge-pending  { background: rgba(255, 193, 7, 0.15); color: #b38600; }
.badge-confirmed { background: rgba(40, 167, 69, 0.12); color: #1a7a35; }
.badge-failed   { background: rgba(220, 53, 69, 0.12); color: #9b1e2a; }

.tx-link {
  color: var(--primary);
  text-decoration: none;
  font-family: monospace;
  font-size: 0.82rem;
}

.tx-link:hover {
  text-decoration: underline;
}

.wallet-addr {
  font-family: monospace;
  font-size: 0.82rem;
  color: var(--text-muted);
}

/* ============================================================
   Footer
   ============================================================ */

.footer {
  background: var(--dark);
  color: rgba(255, 255, 255, 0.6);
  padding: 2.5rem 0;
  font-size: 0.875rem;
}

.footer .container {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  align-items: center;
  justify-content: space-between;
}

.footer-brand {
  font-weight: 700;
  color: #fff;
}

.footer-disclaimer {
  font-size: 0.78rem;
  color: rgba(255, 255, 255, 0.35);
  text-align: center;
  flex-basis: 100%;
  padding-top: 0.75rem;
  border-top: 1px solid rgba(255, 255, 255, 0.07);
  margin-top: 0.5rem;
}

/* ============================================================
   Utilities
   ============================================================ */

.hidden { display: none !important; }

@media (max-width: 480px) {
  .hero { padding: 3rem 0 2.5rem; }
  .section { padding: 3rem 0; }
  .hero-actions { flex-direction: column; align-items: center; }
}
