/* ============================================
   CRYPTO MONEY MANTRA - Global Styles
   ============================================ */

@import url('https://fonts.googleapis.com/css2?family=Space+Mono:wght@400;700&family=Syne:wght@400;500;600;700;800&family=DM+Sans:wght@300;400;500;600&display=swap');

/* === CSS VARIABLES === */
:root {
  /* Dark Theme (default) */
  --bg-primary: #050a0f;
  --bg-secondary: #0a1420;
  --bg-card: #0d1a27;
  --bg-card-hover: #112236;
  --border: #1a2d42;
  --border-accent: #00d4ff33;

  --text-primary: #e8f4ff;
  --text-secondary: #7a9bb5;
  --text-muted: #3d5a73;

  --accent: #00d4ff;
  --accent-glow: #00d4ff22;
  --accent-2: #f7931a;
  --accent-2-glow: #f7931a22;
  --green: #00e676;
  --red: #ff3d71;
  --purple: #7c4dff;

  --nav-bg: rgba(5, 10, 15, 0.92);
  --shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
  --shadow-accent: 0 0 30px rgba(0, 212, 255, 0.15);

  --radius: 12px;
  --radius-sm: 8px;
  --transition: 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

[data-theme="light"] {
  --bg-primary: #f0f4f8;
  --bg-secondary: #e2eaf3;
  --bg-card: #ffffff;
  --bg-card-hover: #f5f9ff;
  --border: #c8d8e8;
  --border-accent: #0099bb44;

  --text-primary: #0a1a2e;
  --text-secondary: #3a5a7a;
  --text-muted: #8aaabb;

  --accent: #0077aa;
  --accent-glow: #0099bb15;
  --accent-2: #e07800;
  --accent-2-glow: #f7931a15;
  --green: #00aa55;
  --red: #cc2244;
  --purple: #5533cc;

  --nav-bg: rgba(240, 244, 248, 0.94);
  --shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
  --shadow-accent: 0 0 30px rgba(0, 150, 200, 0.1);
}

/* === RESET & BASE === */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; font-size: 16px; }

body {
  font-family: 'DM Sans', sans-serif;
  background: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.6;
  min-height: 100vh;
  transition: background var(--transition), color var(--transition);
  overflow-x: hidden;
}

a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
ul { list-style: none; }

/* === SCROLLBAR === */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: var(--bg-secondary); }
::-webkit-scrollbar-thumb { background: var(--accent); border-radius: 3px; }

/* === TYPOGRAPHY === */
h1, h2, h3, h4, h5 {
  font-family: 'Syne', sans-serif;
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: -0.02em;
}

.mono { font-family: 'Space Mono', monospace; }

/* === LAYOUT === */
.container { max-width: 1280px; margin: 0 auto; padding: 0 24px; }
.section { padding: 80px 0; }
.section-sm { padding: 48px 0; }

/* === NAVBAR === */
.navbar {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 1000;
  background: var(--nav-bg);
  backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border);
  transition: all var(--transition);
}

.navbar-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 24px;
  max-width: 1280px;
  margin: 0 auto;
}

.logo {
  display: flex;
  align-items: center;
  gap: 12px;
  font-family: 'Syne', sans-serif;
  font-weight: 800;
  font-size: 1.25rem;
  color: var(--text-primary);
  letter-spacing: -0.03em;
}

.logo-icon {
  width: 38px;
  height: 38px;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  font-weight: 900;
  color: #050a0f;
  font-family: 'Space Mono', monospace;
  box-shadow: var(--shadow-accent);
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 4px;
}

.nav-links a, .nav-dropdown > span {
  padding: 8px 14px;
  border-radius: var(--radius-sm);
  font-size: 0.88rem;
  font-weight: 500;
  color: var(--text-secondary);
  transition: all var(--transition);
  cursor: pointer;
  white-space: nowrap;
}

.nav-links a:hover, .nav-dropdown:hover > span {
  color: var(--text-primary);
  background: var(--bg-card);
}

.nav-links a.active {
  color: var(--accent);
  background: var(--accent-glow);
}

.nav-dropdown {
  position: relative;
}

.nav-dropdown > span {
  display: flex;
  align-items: center;
  gap: 5px;
}

.nav-dropdown-menu {
  position: absolute;
  top: calc(100% + 8px);
  left: 50%;
  transform: translateX(-50%);
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 8px;
  min-width: 200px;
  opacity: 0;
  visibility: hidden;
  transition: all var(--transition);
  box-shadow: var(--shadow);
  z-index: 100;
}

.nav-dropdown:hover .nav-dropdown-menu {
  opacity: 1;
  visibility: visible;
}

.nav-dropdown-menu a {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  font-size: 0.88rem;
  color: var(--text-secondary);
}

.nav-dropdown-menu a:hover {
  color: var(--text-primary);
  background: var(--bg-card-hover);
}

.nav-dropdown-menu a .icon { font-size: 1rem; }

.nav-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.theme-toggle {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--bg-card);
  color: var(--text-secondary);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  transition: all var(--transition);
}

.theme-toggle:hover {
  color: var(--accent);
  border-color: var(--accent);
  background: var(--accent-glow);
}

.btn-subscribe {
  padding: 8px 18px;
  background: linear-gradient(135deg, var(--accent-2), #ffb347);
  color: #0a0a0a;
  font-weight: 700;
  font-size: 0.85rem;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  gap: 7px;
  transition: all var(--transition);
  white-space: nowrap;
  font-family: 'Syne', sans-serif;
  letter-spacing: 0.01em;
}

.btn-subscribe:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 20px var(--accent-2-glow);
}

.hamburger {
  display: none;
  flex-direction: column;
  gap: 5px;
  cursor: pointer;
  padding: 8px;
}

.hamburger span {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--text-primary);
  border-radius: 2px;
  transition: all var(--transition);
}

/* === HERO TICKER === */
.ticker-bar {
  background: var(--bg-secondary);
  border-bottom: 1px solid var(--border);
  padding: 8px 0;
  overflow: hidden;
  margin-top: 67px;
}

.ticker-track {
  display: flex;
  gap: 48px;
  animation: ticker 30s linear infinite;
  width: max-content;
}

.ticker-item {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: 'Space Mono', monospace;
  font-size: 0.78rem;
  white-space: nowrap;
}

.ticker-item .name { color: var(--text-secondary); font-weight: 700; }
.ticker-item .price { color: var(--text-primary); }
.ticker-item .change.up { color: var(--green); }
.ticker-item .change.down { color: var(--red); }

@keyframes ticker {
  0% { transform: translateX(0); }
  100% { transform: translateX(-50%); }
}

/* === CARDS === */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  transition: all var(--transition);
}

.card:hover {
  background: var(--bg-card-hover);
  border-color: var(--border-accent);
  box-shadow: var(--shadow-accent);
}

/* === SECTION HEADERS === */
.section-header {
  margin-bottom: 40px;
}

.section-tag {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: 'Space Mono', monospace;
  font-size: 0.72rem;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  margin-bottom: 12px;
}

.section-tag::before {
  content: '';
  width: 20px;
  height: 2px;
  background: var(--accent);
  border-radius: 2px;
}

.section-title {
  font-size: clamp(1.8rem, 3vw, 2.6rem);
  color: var(--text-primary);
  margin-bottom: 12px;
}

.section-desc {
  color: var(--text-secondary);
  font-size: 1rem;
  max-width: 560px;
}

/* === BADGES === */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 10px;
  border-radius: 50px;
  font-size: 0.75rem;
  font-weight: 600;
  font-family: 'Space Mono', monospace;
}

.badge-green { background: rgba(0, 230, 118, 0.12); color: var(--green); }
.badge-red { background: rgba(255, 61, 113, 0.12); color: var(--red); }
.badge-blue { background: var(--accent-glow); color: var(--accent); }
.badge-orange { background: var(--accent-2-glow); color: var(--accent-2); }

/* === BUTTONS === */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 24px;
  border-radius: var(--radius-sm);
  font-weight: 600;
  font-size: 0.9rem;
  transition: all var(--transition);
  cursor: pointer;
  border: none;
  font-family: 'DM Sans', sans-serif;
}

.btn-primary {
  background: linear-gradient(135deg, var(--accent), #0088cc);
  color: #050a0f;
}

.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 8px 24px var(--accent-glow); }

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

.btn-outline:hover { border-color: var(--accent); color: var(--accent); background: var(--accent-glow); }

/* === GRID LAYOUTS === */
.grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 24px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; }

/* === FOOTER === */
.footer {
  background: var(--bg-secondary);
  border-top: 1px solid var(--border);
  padding: 60px 0 30px;
}

.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 48px;
  margin-bottom: 48px;
}

.footer-brand p {
  color: var(--text-secondary);
  font-size: 0.9rem;
  margin-top: 16px;
  line-height: 1.7;
  max-width: 280px;
}

.footer-social {
  display: flex;
  gap: 10px;
  margin-top: 20px;
}

.social-icon {
  width: 38px;
  height: 38px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  color: var(--text-secondary);
  transition: all var(--transition);
}

.social-icon:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--accent-glow);
}

.footer-col h4 {
  font-family: 'Syne', sans-serif;
  font-size: 0.85rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-muted);
  margin-bottom: 16px;
}

.footer-col ul { display: flex; flex-direction: column; gap: 10px; }

.footer-col ul li a {
  color: var(--text-secondary);
  font-size: 0.9rem;
  transition: color var(--transition);
}

.footer-col ul li a:hover { color: var(--accent); }

.footer-bottom {
  border-top: 1px solid var(--border);
  padding-top: 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
}

.footer-bottom p {
  color: var(--text-muted);
  font-size: 0.82rem;
  font-family: 'Space Mono', monospace;
}

.footer-disclaimer {
  margin-top: 30px;
  padding: 16px 20px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 0.78rem;
  color: var(--text-muted);
  line-height: 1.6;
}

/* === MOBILE NAV === */
.mobile-nav {
  display: none;
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: var(--bg-primary);
  z-index: 999;
  padding: 100px 24px 40px;
  flex-direction: column;
  gap: 8px;
  overflow-y: auto;
}

.mobile-nav.open { display: flex; }

.mobile-nav a {
  padding: 14px 18px;
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  font-size: 1rem;
  font-weight: 500;
  border: 1px solid var(--border);
}

.mobile-nav a:hover, .mobile-nav a.active {
  color: var(--accent);
  border-color: var(--accent);
  background: var(--accent-glow);
}

/* === UTILITY === */
.text-accent { color: var(--accent); }
.text-orange { color: var(--accent-2); }
.text-green { color: var(--green); }
.text-red { color: var(--red); }
.text-muted { color: var(--text-muted); }
.text-secondary { color: var(--text-secondary); }
.text-center { text-align: center; }
.flex { display: flex; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-8 { gap: 8px; }
.gap-12 { gap: 12px; }
.gap-16 { gap: 16px; }
.mt-8 { margin-top: 8px; }
.mt-16 { margin-top: 16px; }
.mt-24 { margin-top: 24px; }
.mb-8 { margin-bottom: 8px; }
.mb-16 { margin-bottom: 16px; }
.mb-24 { margin-bottom: 24px; }
.w-full { width: 100%; }

/* === PAGE HERO === */
.page-hero {
  padding: 120px 0 60px;
  text-align: center;
  position: relative;
  overflow: hidden;
}

.page-hero::before {
  content: '';
  position: absolute;
  top: 0; left: 50%; transform: translateX(-50%);
  width: 600px; height: 300px;
  background: radial-gradient(ellipse, var(--accent-glow) 0%, transparent 70%);
  pointer-events: none;
}

.page-hero h1 {
  font-size: clamp(2rem, 5vw, 3.5rem);
  margin-bottom: 16px;
}

.page-hero p {
  color: var(--text-secondary);
  font-size: 1.05rem;
  max-width: 560px;
  margin: 0 auto;
}

/* === IFRAME CONTAINERS === */
.iframe-wrapper {
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
}

.iframe-wrapper iframe {
  width: 100%;
  display: block;
}

/* === TABLES === */
.data-table {
  width: 100%;
  border-collapse: collapse;
}

.data-table th {
  padding: 12px 16px;
  text-align: left;
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border);
  background: var(--bg-secondary);
  white-space: nowrap;
}

.data-table td {
  padding: 14px 16px;
  font-size: 0.9rem;
  border-bottom: 1px solid var(--border);
  transition: background var(--transition);
}

.data-table tr:hover td { background: var(--bg-card-hover); }

.data-table .rank { color: var(--text-muted); font-family: 'Space Mono', monospace; font-size: 0.82rem; }
.data-table .coin-info { display: flex; align-items: center; gap: 12px; }
.data-table .coin-logo { width: 32px; height: 32px; border-radius: 50%; object-fit: cover; }
.data-table .coin-name { font-weight: 600; }
.data-table .coin-symbol { color: var(--text-muted); font-size: 0.8rem; font-family: 'Space Mono', monospace; }
.data-table .price { font-family: 'Space Mono', monospace; font-weight: 600; }
.data-table .up { color: var(--green); }
.data-table .down { color: var(--red); }
.data-table .mcap { color: var(--text-secondary); font-size: 0.85rem; font-family: 'Space Mono', monospace; }

/* === SEARCH === */
.search-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 10px 16px;
  margin-bottom: 24px;
  transition: border-color var(--transition);
}

.search-bar:focus-within { border-color: var(--accent); }

.search-bar input {
  flex: 1;
  background: none;
  border: none;
  outline: none;
  color: var(--text-primary);
  font-family: 'DM Sans', sans-serif;
  font-size: 0.95rem;
}

.search-bar input::placeholder { color: var(--text-muted); }

/* === FEAR & GREED === */
.fng-gauge {
  text-align: center;
  padding: 32px;
}

.gauge-wrap {
  position: relative;
  width: 220px;
  height: 130px;
  margin: 0 auto 20px;
}

/* === ANIMATIONS === */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(24px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

@keyframes shimmer {
  from { background-position: -200% 0; }
  to { background-position: 200% 0; }
}

.animate-fade-up { animation: fadeUp 0.6s ease both; }
.animate-fade-up-1 { animation: fadeUp 0.6s 0.1s ease both; }
.animate-fade-up-2 { animation: fadeUp 0.6s 0.2s ease both; }
.animate-fade-up-3 { animation: fadeUp 0.6s 0.3s ease both; }
.animate-fade-up-4 { animation: fadeUp 0.6s 0.4s ease both; }

/* === LOADING SKELETON === */
.skeleton {
  background: linear-gradient(90deg, var(--bg-card) 25%, var(--bg-card-hover) 50%, var(--bg-card) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  border-radius: 6px;
}

/* === RESPONSIVE === */
@media (max-width: 1024px) {
  .grid-4 { grid-template-columns: repeat(2, 1fr); }
  .footer-grid { grid-template-columns: 1fr 1fr; gap: 32px; }
}

@media (max-width: 768px) {
  .nav-links, .btn-subscribe { display: none; }
  .hamburger { display: flex; }
  .grid-2, .grid-3 { grid-template-columns: 1fr; }
  .grid-4 { grid-template-columns: repeat(2, 1fr); }
  .footer-grid { grid-template-columns: 1fr; gap: 24px; }
  .section { padding: 60px 0; }
  .footer-bottom { flex-direction: column; text-align: center; }
}

@media (max-width: 480px) {
  .grid-4 { grid-template-columns: 1fr; }
  .container { padding: 0 16px; }
}

/* === LOGO IMAGE === */
.logo-img {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  object-fit: cover;
  flex-shrink: 0;
}

/* === SOCIAL ICON SVG FIX === */
.social-icon svg {
  display: block;
}

/* === LOGO TEXT STYLING === */
.logo-text {
  display: flex;
  flex-direction: column;
  align-items: center;
  line-height: 1.2;
  gap: 1px;
}

.logo-line1 {
  font-family: 'Syne', sans-serif;
  font-weight: 800;
  font-size: 1.1rem;
  color: #00d4ff;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.logo-line2 {
  font-family: 'Syne', sans-serif;
  font-weight: 700;
  font-size: 0.72rem;
  color: #ffffff;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  text-align: center;
}

/* Light theme overrides */
[data-theme="light"] .logo-line1 { color: #0077aa; }
[data-theme="light"] .logo-line2 { color: #0a1a2e; }

/* === HAMBURGER OPEN STATE === */
.hamburger.is-open span:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}
.hamburger.is-open span:nth-child(2) {
  opacity: 0;
  transform: scaleX(0);
}
.hamburger.is-open span:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}
.hamburger span {
  transition: all 0.25s ease;
}

/* Mobile nav overlay backdrop */
.mobile-nav::before {
  display: none;
}
