/* =========================================
   XRBitcoinCash (XRBC) — Optimized Core Stylesheet
   ========================================= */

/* === 1) THEME TOKENS === */
:root {
  --bg: #0B1020;
  --card: #0F1724;
  --ink: #ECF3FF;
  --muted: #9EB2D0;
  --accent: #00E5FF;

  --green: #28e07f;
  --blue: #00b6ff;
  --white: #ffffff;
  --red: #ff4c4c;
  --orange: #ffaf40;
  --purple: #a36bff;
}

/* === 2) RESET === */
*, *::before, *::after { box-sizing: border-box; }
html, body {
  height: 100%;
  margin: 0;
  font-family: Inter, Segoe UI, Roboto, system-ui, Arial, sans-serif;
  color: var(--ink);
  background: var(--bg);
  line-height: 1.6;
  overflow-x: hidden;
}

/* === 3) HEADER === */
header {
  position: fixed;
  top: 0; left: 0; width: 100%;
  background: rgba(11, 16, 32, .7);
  backdrop-filter: blur(8px);
  z-index: 999;
  padding: 10px 18px;
  display: flex; align-items: center; justify-content: space-between;
  gap: 8px; flex-wrap: wrap;
}
.brand { display: flex; gap: 12px; align-items: center; }
.brand img { width: 48px; height: 48px; border-radius: 8px; object-fit: contain; }
.brand h1 { margin: 0; font-size: 1.05rem; }

/* === 4) MAIN WRAPPER === */
main {
  position: relative; z-index: 2;
  max-width: 1000px;
  margin: 0 auto;
  padding: 24px;
  padding-top: 110px;
}

/* === 5) HERO LAYOUT === */
.hero {
  display: flex; flex-direction: column; gap: 22px;
  padding: 20px;
  background: linear-gradient(180deg, rgba(255,255,255,0.02), transparent);
  border: 1px solid rgba(255,255,255,0.05);
  border-radius: 14px;
  margin-top: 22px;
}
.hero h2 { margin: 0; font-size: 1.9rem; }
.hero p { margin: 6px 0 0; color: var(--muted); }

/* particles */
.particles { position: absolute; inset: 0; pointer-events: none; }
.particle {
  position: absolute;
  width: 6px; height: 6px;
  background: var(--accent);
  border-radius: 50%;
  box-shadow: 0 0 6px var(--accent);
  animation: float 6s infinite ease-in-out;
}
@keyframes float {
  0%, 100% { transform: translateY(0) scale(1); opacity: 1; }
  50% { transform: translateY(-20px) scale(1.2); opacity: .6; }
}

@media (min-width: 880px) {
  .hero { flex-direction: row; align-items: flex-start; justify-content: space-between; gap: 32px; }
}

/* === 6) BUTTONS === */
.btn {
  display: inline-flex;
  align-items: center; justify-content: center;
  gap: 10px; padding: 12px 20px;
  border-radius: 12px; font-size: 1.05rem; font-weight: 700;
  text-decoration: none; cursor: pointer; text-align: center;
  transition: transform .2s ease, box-shadow .3s ease;
  min-width: 180px; max-width: 280px;
}
.btn:hover { transform: translateY(-2px); }

.btn.primary { background: linear-gradient(180deg, var(--accent), #00b6d0); color: #00121a; }
.btn.ghost { background: transparent; border: 2px solid var(--accent); color: var(--accent); }
.btn.cta { background: linear-gradient(180deg, var(--green), #1bb866); color: #001a0f; font-weight: 800; }

.button-group {
  display: flex; flex-wrap: wrap; justify-content: center; align-items: center;
  gap: 16px; margin-top: 18px;
}
.button-group .btn { flex: 1 1 210px; }

/* === 7) GLOW EFFECT === */
@keyframes glowPulse {
  0%, 100% { box-shadow: 0 0 8px var(--glow, transparent); }
  50% { box-shadow: 0 0 20px var(--glow, transparent); }
}
.glow-green { --glow: rgba(40,224,127,.75); animation: glowPulse 5s infinite ease-in-out; }
.glow-blue { --glow: rgba(0,182,255,.75); animation: glowPulse 5s infinite ease-in-out; }
.glow-white { --glow: rgba(255,255,255,.75); animation: glowPulse 6s infinite ease-in-out; }
.glow-red { --glow: rgba(255,76,76,.75); animation: glowPulse 4.5s infinite ease-in-out; }

/* === 8) CARDS === */
section.grid, section.card { margin-top: 28px; }
.card {
  background: var(--card);
  padding: 18px;
  border-radius: 12px;
  border: 1px solid rgba(255,255,255,.04);
  transition: transform .2s, border-color .2s;
}
.card:hover { transform: translateY(-4px); border-color: rgba(0,229,255,.25); }

.nft img {
  display: block; margin: 0 auto;
  width: 100%; max-width: 320px; border-radius: 12px;
}

/* content grid */
.grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 18px; align-items: start;
}
@media (min-width: 880px) {
  .grid { grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); }
}

/* === 9) FOOTER === */
.ecosystem-footer {
  text-align: center;
  margin-top: 60px;
  padding: 40px 20px;
  border-top: 1px solid rgba(0,229,255,.1);
}
.footer-container h3 { margin-bottom: 10px; }
.ecosystem-links {
  display: flex; justify-content: center; flex-wrap: wrap;
  gap: 16px; margin-top: 10px;
}
.eco-link {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 10px 16px; border-radius: 12px;
  text-decoration: none; color: var(--ink); font-weight: 600;
  transition: .3s;
  background: rgba(0,255,128,.05);
  box-shadow: 0 0 12px rgba(0,255,128,.3);
}
.eco-link img { width: 28px; height: 28px; border-radius: 6px; }
.eco-link:hover {
  background: rgba(0,255,128,.15);
  box-shadow: 0 0 18px rgba(0,255,128,.8);
  transform: translateY(-2px); color: #00ff80;
}

/* === SECURITY CENTER BUTTONS + LAYOUT FIX === */
#auditWidget { transition: all 0.3s ease-in-out; }

#auditInput {
  width: 100%;
  min-height: 80px;
  resize: vertical;
  border: 1px solid rgba(0,229,255,0.25);
  border-radius: 10px;
  padding: 10px 12px;
  background: rgba(15,23,36,0.9);
  color: var(--ink);
  font-family: 'Inter', sans-serif;
  font-size: 0.95rem;
  margin-bottom: 10px;
  box-shadow: 0 0 8px rgba(0,229,255,0.08);
}
#auditInput:focus {
  border-color: var(--accent);
  box-shadow: 0 0 14px rgba(0,229,255,0.3);
}

.audit-buttons {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
  margin-top: 10px;
}

/* Animated gradient buttons (refined readability) */
#auditSend, #auditVoice, .btn-glow-link {
  flex: 1 1 32%;
  padding: 12px 0;
  border-radius: 10px;
  color: #fff;
  font-weight: 700;
  border: none;
  cursor: pointer;
  text-align: center;
  text-shadow: 0 0 3px rgba(0,0,0,0.3);
  background-size: 250% 250%;
  animation: btnGradientShift 8s ease infinite;
  transition: transform 0.25s, box-shadow 0.25s;
}

/* Refined color combinations for readability */
#auditSend {
  background: linear-gradient(90deg, var(--accent), var(--green), var(--blue));
}
#auditVoice {
  background: linear-gradient(90deg, var(--purple), var(--accent), var(--green));
}
.btn-glow-link {
  background: linear-gradient(90deg, var(--orange), var(--red), var(--purple));
  box-shadow: 0 0 12px rgba(255,76,76,0.4);
}

#auditSend:hover, #auditVoice:hover, .btn-glow-link:hover {
  transform: scale(1.05);
  box-shadow: 0 0 18px rgba(0,229,255,0.45);
}

@keyframes btnGradientShift {
  0% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

.helper.small {
  text-align: right;
  font-size: 0.9rem;
  color: var(--muted);
  opacity: 0.9;
  margin-top: 6px;
}

/* Responsive stacking */
@media (max-width: 700px) {
  .audit-buttons { flex-direction: column; align-items: stretch; }
  #auditSend, #auditVoice, .btn-glow-link { width: 100%; }
  .helper.small { text-align: left; }
}
/* === FIX: Prevent long issuer text from overlapping cards === */
.card p strong {
  word-break: break-all;        /* Break long strings mid-word if needed */
  overflow-wrap: anywhere;      /* Allow wrapping even without spaces */
  display: inline-block;        /* Keep spacing consistent */
  line-height: 1.5;
}

.card p {
  word-wrap: break-word;        /* Legacy fallback */
  overflow-wrap: break-word;
  max-width: 100%;              /* Ensure it doesn’t exceed the card boundary */
}
/* === FIX: Theme Toggle Visibility & Position === */
.toggle-theme {
  position: fixed;
  top: 72px; /* move it below the header (adjust 60–80px if needed) */
  right: 16px;
  z-index: 1200; /* ensure above header (header is z-index:999) */
  background: var(--card);
  border: 1px solid rgba(255,255,255,0.15);
  border-radius: 50%;
  width: 46px;
  height: 46px;
  color: var(--accent);
  font-size: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 0.3s, transform 0.2s;
  box-shadow: 0 0 10px rgba(0,229,255,0.3);
}

.toggle-theme:hover {
  transform: scale(1.1);
  box-shadow: 0 0 18px rgba(0,229,255,0.5);
}
/* === Light Mode === */
.light-mode {
  --bg: #fdfdfd;
  --card: #ffffff;
  --ink: #0b0c10;
  --muted: #4a4f5c;
  --accent: #0078ff;

  --green: #00b86b;
  --blue: #007bff;
  --white: #ffffff;
  --red: #ff3b3b;
  --orange: #ff9b3d;
  --purple: #7b4dff;
}

/* Ensure smooth transition between themes */
html, body, header, main, footer {
  transition: background 0.4s, color 0.4s, border-color 0.4s;
}
