/* ============ CRYPTOCURRENCIES PAGE STYLES ============ */
:root {
  --primary: #7C5CFC;
  --primary-dark: #6344E0;
  --secondary: #00D4FF;
  --accent: #FFD700;
  --dark-bg: #0A0A1A;
  --dark-surface: #12122A;
  --dark-card: #1A1A3E;
  --text-primary: #FFFFFF;
  --text-secondary: #B4B4D0;
  --text-muted: #6B6B8A;
  --success: #00D68F;
  --danger: #FF3D71;
  --warning: #FFD700;
  --info: #00D4FF;
  --gradient-1: linear-gradient(135deg, #7C5CFC, #00D4FF);
  --gradient-2: linear-gradient(135deg, #00D68F, #00B884);
  --gradient-3: linear-gradient(135deg, #FFD700, #FF8C00);
  --gradient-4: linear-gradient(135deg, #FF3D71, #FF6B6B);
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

.crypto-body {
  font-family: 'Poppins', sans-serif;
  background: var(--dark-bg);
  color: var(--text-primary);
  min-height: 100vh;
  overflow-x: hidden;
  position: relative;
}

/* ============ BACKGROUND EFFECTS ============ */
.crypto-bg {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 0;
}

.bg-orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(100px);
  opacity: 0.06;
  animation: orbFloat 15s ease-in-out infinite;
}

.orb-1 {
  width: 600px;
  height: 600px;
  background: #7C5CFC;
  top: -200px;
  right: -100px;
  animation-delay: 0s;
}

.orb-2 {
  width: 500px;
  height: 500px;
  background: #00D4FF;
  bottom: -150px;
  left: -100px;
  animation-delay: -5s;
}

.orb-3 {
  width: 400px;
  height: 400px;
  background: #FFD700;
  top: 40%;
  left: 50%;
  transform: translate(-50%, -50%);
  animation-delay: -10s;
  opacity: 0.04;
}

.orb-4 {
  width: 350px;
  height: 350px;
  background: #FF3D71;
  top: 20%;
  left: 10%;
  animation-delay: -7s;
  opacity: 0.04;
}

.orb-5 {
  width: 450px;
  height: 450px;
  background: #00D68F;
  bottom: 20%;
  right: 10%;
  animation-delay: -12s;
  opacity: 0.04;
}

.bg-grid {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-image:
    linear-gradient(rgba(124, 92, 252, 0.02) 1px, transparent 1px),
    linear-gradient(90deg, rgba(124, 92, 252, 0.02) 1px, transparent 1px);
  background-size: 30px 30px;
}

/* Floating Particles */
.floating-particles {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
}

.floating-particle {
  position: absolute;
  width: 2px;
  height: 2px;
  background: var(--primary);
  border-radius: 50%;
  animation: particleDrift 10s linear infinite;
  opacity: 0;
}

.floating-particle:nth-child(even) {
  background: var(--secondary);
  width: 3px;
  height: 3px;
}

.floating-particle:nth-child(3n) {
  background: var(--accent);
}

/* ============ CONTAINER ============ */
.crypto-container {
  position: relative;
  z-index: 1;
  max-width: 1400px;
  margin: 0 auto;
  padding: 20px 30px 40px;
}

/* ============ TOP BAR ============ */
.crypto-topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 40px;
  padding: 15px 0;
  border-bottom: 1px solid rgba(124, 92, 252, 0.08);
}

/* Back to Home Button */
.back-home-btn {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 24px;
  background: var(--dark-card);
  border: 2px solid rgba(124, 92, 252, 0.3);
  border-radius: 50px;
  color: var(--text-primary);
  text-decoration: none;
  font-size: 14px;
  font-weight: 600;
  position: relative;
  overflow: hidden;
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  z-index: 1;
}

.back-home-btn:hover {
  border-color: var(--primary);
  transform: translateY(-3px);
  box-shadow: 0 15px 35px rgba(124, 92, 252, 0.3);
}

.back-home-btn:hover .btn-glow {
  opacity: 1;
}

.btn-icon {
  width: 35px;
  height: 35px;
  background: var(--gradient-1);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  color: white;
  transition: transform 0.4s ease;
  position: relative;
  z-index: 2;
}

.back-home-btn:hover .btn-icon {
  transform: translateX(-5px) rotate(-360deg);
}

.btn-text {
  position: relative;
  z-index: 2;
}

.btn-glow {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 150%;
  height: 150%;
  background: radial-gradient(circle, rgba(124, 92, 252, 0.3), transparent);
  opacity: 0;
  transition: opacity 0.4s ease;
}

/* Topbar Info */
.topbar-info {
  display: flex;
  align-items: center;
  gap: 25px;
}

.live-indicator {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 600;
  color: var(--success);
}

.live-dot {
  width: 8px;
  height: 8px;
  background: var(--success);
  border-radius: 50%;
  animation: livePulse 1.5s ease-in-out infinite;
}

.total-coins {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--text-secondary);
}

.total-coins i {
  color: var(--accent);
  font-size: 16px;
}

.total-coins span:first-of-type {
  font-weight: 700;
  color: var(--text-primary);
}

/* ============ PAGE TITLE ============ */
.page-title-section {
  text-align: center;
  margin-bottom: 40px;
}

.page-title {
  font-size: 42px;
  font-weight: 800;
  margin-bottom: 10px;
  animation: titleGlow 3s ease-in-out infinite;
}

.gradient-text {
  background: linear-gradient(135deg, #7C5CFC, #00D4FF, #FFD700);
  background-size: 200% 200%;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  animation: gradientShift 4s ease-in-out infinite;
}

.page-subtitle {
  font-size: 15px;
  color: var(--text-muted);
  margin-bottom: 20px;
}

.title-decoration {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 15px;
}

.deco-line {
  width: 60px;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--primary), transparent);
}

.deco-diamond {
  width: 12px;
  height: 12px;
  background: var(--primary);
  transform: rotate(45deg);
  animation: diamondPulse 2s ease-in-out infinite;
  box-shadow: 0 0 15px rgba(124, 92, 252, 0.5);
}

/* ============ FILTER SECTION ============ */
.filter-section {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 35px;
  flex-wrap: wrap;
  gap: 20px;
}

.search-wrapper {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--dark-card);
  border: 1px solid rgba(124, 92, 252, 0.2);
  border-radius: 50px;
  padding: 12px 20px;
  min-width: 300px;
  transition: all 0.3s ease;
}

.search-wrapper:focus-within {
  border-color: var(--primary);
  box-shadow: 0 0 25px rgba(124, 92, 252, 0.15);
}

.search-wrapper i {
  color: var(--text-muted);
  font-size: 16px;
}

.search-input {
  flex: 1;
  background: none;
  border: none;
  color: var(--text-primary);
  font-size: 14px;
  font-family: 'Poppins', sans-serif;
  outline: none;
}

.search-input::placeholder {
  color: var(--text-muted);
}

.search-clear {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 14px;
  padding: 4px;
  transition: color 0.3s ease;
}

.search-clear:hover {
  color: var(--danger);
}

.filter-chips {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.filter-chip {
  padding: 8px 18px;
  background: var(--dark-card);
  border: 1px solid rgba(124, 92, 252, 0.15);
  border-radius: 50px;
  color: var(--text-secondary);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.3s ease;
  font-family: 'Poppins', sans-serif;
}

.filter-chip:hover {
  border-color: var(--primary);
  color: var(--text-primary);
  background: rgba(124, 92, 252, 0.05);
}

.filter-chip.active {
  background: var(--gradient-1);
  border-color: transparent;
  color: white;
  font-weight: 600;
}

/* ============ CRYPTO GRID ============ */
.crypto-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 16px;
  margin-bottom: 50px;
}

/* Coin Box */
.coin-box {
  background: var(--dark-card);
  border: 1px solid rgba(124, 92, 252, 0.12);
  border-radius: 16px;
  padding: 20px 16px;
  cursor: pointer;
  position: relative;
  overflow: hidden;
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  animation: coinEntry 0.6s ease-out backwards;
}

.coin-box::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(124, 92, 252, 0.05), transparent);
  transition: left 0.6s ease;
}

.coin-box:hover::before {
  left: 100%;
}

.coin-box::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 3px;
  background: var(--gradient-1);
  transform: scaleX(0);
  transition: transform 0.4s ease;
  transform-origin: left;
}

.coin-box:hover {
  transform: translateY(-6px);
  border-color: var(--primary);
  box-shadow: 0 20px 40px rgba(124, 92, 252, 0.2);
}

.coin-box:hover::after {
  transform: scaleX(1);
}

/* Coin Rank */
.coin-rank {
  position: absolute;
  top: 12px;
  right: 12px;
  font-size: 10px;
  font-weight: 700;
  color: var(--text-muted);
  background: rgba(124, 92, 252, 0.08);
  padding: 3px 8px;
  border-radius: 6px;
}

/* Coin Header */
.coin-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
}

.coin-icon {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  font-weight: 700;
  flex-shrink: 0;
  position: relative;
}

.coin-icon::after {
  content: '';
  position: absolute;
  inset: -3px;
  border-radius: 50%;
  background: inherit;
  filter: blur(8px);
  opacity: 0;
  transition: opacity 0.3s ease;
}

.coin-box:hover .coin-icon::after {
  opacity: 0.5;
}

.coin-symbol {
  font-size: 12px;
  color: var(--text-muted);
  font-weight: 600;
}

.coin-name {
  font-size: 11px;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Coin Price */
.coin-price {
  font-size: 18px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 8px;
  transition: color 0.3s ease;
}

/* Coin Change */
.coin-change {
  font-size: 12px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 3px;
  margin-bottom: 10px;
}

.coin-change.positive {
  color: var(--success);
}

.coin-change.negative {
  color: var(--danger);
}

/* Mini Chart Placeholder */
.coin-chart-mini {
  height: 35px;
  background: linear-gradient(180deg,
      rgba(124, 92, 252, 0.1) 0%,
      rgba(124, 92, 252, 0.02) 100%);
  border-radius: 8px;
  position: relative;
  overflow: hidden;
}

.chart-sparkline {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 100%;
  opacity: 0.6;
}

/* Coin Colors */
.coin-btc .coin-icon {
  background: linear-gradient(135deg, #F7931A, #FF6B35);
}

.coin-eth .coin-icon {
  background: linear-gradient(135deg, #627EEA, #8C7CF0);
}

.coin-usdt .coin-icon {
  background: linear-gradient(135deg, #26A17B, #00D68F);
}

.coin-bnb .coin-icon {
  background: linear-gradient(135deg, #F3BA2F, #F0B90B);
}

.coin-xrp .coin-icon {
  background: linear-gradient(135deg, #23292F, #4A5568);
}

.coin-sol .coin-icon {
  background: linear-gradient(135deg, #9945FF, #14F195);
}

.coin-ada .coin-icon {
  background: linear-gradient(135deg, #0033AD, #2468E5);
}

.coin-doge .coin-icon {
  background: linear-gradient(135deg, #C2A633, #BA9F33);
}

.coin-dot .coin-icon {
  background: linear-gradient(135deg, #E6007A, #FF2670);
}

.coin-avax .coin-icon {
  background: linear-gradient(135deg, #E84142, #FF5C5C);
}

/* Default coin color */
.coin-default .coin-icon {
  background: linear-gradient(135deg, var(--primary), var(--secondary));
}

/* ============ LOAD MORE ============ */
.load-more-section {
  text-align: center;
  margin-bottom: 40px;
}

.load-more-btn {
  padding: 14px 35px;
  background: var(--dark-card);
  border: 2px solid rgba(124, 92, 252, 0.25);
  border-radius: 50px;
  color: var(--text-primary);
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  position: relative;
  overflow: hidden;
  transition: all 0.3s ease;
  font-family: 'Poppins', sans-serif;
}

.load-more-btn:hover {
  background: rgba(124, 92, 252, 0.1);
  border-color: var(--primary);
  transform: translateY(-2px);
  box-shadow: 0 10px 25px rgba(124, 92, 252, 0.2);
}

.btn-shimmer {
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.05), transparent);
  animation: shimmer 2s infinite;
}

.load-more-btn:hover i {
  animation: bounceDown 0.6s ease-in-out infinite;
}

/* ============ BACK TO TOP ============ */
.back-to-top {
  position: fixed;
  bottom: 30px;
  right: 30px;
  width: 45px;
  height: 45px;
  background: var(--gradient-1);
  border: none;
  border-radius: 50%;
  color: white;
  font-size: 18px;
  cursor: pointer;
  z-index: 100;
  opacity: 0;
  visibility: hidden;
  transform: translateY(20px);
  transition: all 0.4s ease;
  box-shadow: 0 10px 25px rgba(124, 92, 252, 0.3);
}

.back-to-top.visible {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.back-to-top:hover {
  transform: translateY(-5px) scale(1.1);
  box-shadow: 0 15px 35px rgba(124, 92, 252, 0.5);
}

/* ============ BOTTOM TICKER ============ */
.bottom-ticker {
  position: fixed;
  bottom: 0;
  left: 0;
  width: 100%;
  background: rgba(10, 10, 26, 0.95);
  backdrop-filter: blur(20px);
  border-top: 1px solid rgba(124, 92, 252, 0.15);
  padding: 10px 0;
  z-index: 99;
  overflow: hidden;
}

.ticker-track {
  display: flex;
  gap: 40px;
  animation: tickerScroll 60s linear infinite;
  white-space: nowrap;
}

.ticker-item {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
  font-size: 12px;
}

.ticker-icon {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  font-size: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-weight: 700;
}

.ticker-name {
  color: var(--text-secondary);
  font-weight: 500;
}

.ticker-price {
  color: var(--text-primary);
  font-weight: 600;
}

.ticker-change.positive {
  color: var(--success);
}

.ticker-change.negative {
  color: var(--danger);
}

.bottom-ticker:hover .ticker-track {
  animation-play-state: paused;
}

/* ============ ANIMATIONS ============ */
@keyframes orbFloat {

  0%,
  100% {
    transform: translate(0, 0) scale(1);
  }

  25% {
    transform: translate(40px, -30px) scale(1.05);
  }

  50% {
    transform: translate(-20px, -50px) scale(0.95);
  }

  75% {
    transform: translate(-40px, 20px) scale(1.02);
  }
}

@keyframes particleDrift {
  0% {
    transform: translateY(100vh) translateX(0);
    opacity: 0;
  }

  10% {
    opacity: 0.8;
  }

  90% {
    opacity: 0.8;
  }

  100% {
    transform: translateY(-10vh) translateX(100px);
    opacity: 0;
  }
}

@keyframes coinEntry {
  from {
    opacity: 0;
    transform: translateY(30px) scale(0.9);
  }

  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes titleGlow {

  0%,
  100% {
    text-shadow: 0 0 20px rgba(124, 92, 252, 0.3);
  }

  50% {
    text-shadow: 0 0 40px rgba(124, 92, 252, 0.6), 0 0 60px rgba(0, 212, 255, 0.3);
  }
}

@keyframes gradientShift {
  0% {
    background-position: 0% 50%;
  }

  50% {
    background-position: 100% 50%;
  }

  100% {
    background-position: 0% 50%;
  }
}

@keyframes diamondPulse {

  0%,
  100% {
    transform: rotate(45deg) scale(1);
    opacity: 1;
  }

  50% {
    transform: rotate(45deg) scale(1.3);
    opacity: 0.6;
  }
}

@keyframes shimmer {
  0% {
    left: -100%;
  }

  100% {
    left: 100%;
  }
}

@keyframes bounceDown {

  0%,
  100% {
    transform: translateY(0);
  }

  50% {
    transform: translateY(5px);
  }
}

@keyframes tickerScroll {
  0% {
    transform: translateX(0);
  }

  100% {
    transform: translateX(-50%);
  }
}

@keyframes livePulse {

  0%,
  100% {
    opacity: 1;
    box-shadow: 0 0 0 0 rgba(0, 214, 143, 0.6);
  }

  50% {
    opacity: 0.5;
    box-shadow: 0 0 0 8px rgba(0, 214, 143, 0);
  }
}

@keyframes priceFlash {

  0%,
  100% {
    color: var(--text-primary);
  }

  50% {
    color: var(--success);
  }
}

.coin-box.price-up .coin-price {
  animation: priceFlash 0.6s ease;
}

.coin-box.price-down .coin-price {
  animation: priceFlash 0.6s ease;
  --flash-color: var(--danger);
}

/* ============ RESPONSIVE ============ */
@media (max-width: 1400px) {
  .crypto-grid {
    grid-template-columns: repeat(5, 1fr);
  }
}

@media (max-width: 1200px) {
  .crypto-grid {
    grid-template-columns: repeat(4, 1fr);
  }
}

@media (max-width: 992px) {
  .crypto-grid {
    grid-template-columns: repeat(3, 1fr);
  }

  .page-title {
    font-size: 34px;
  }

  .filter-section {
    flex-direction: column;
    align-items: stretch;
  }

  .search-wrapper {
    min-width: auto;
  }
}

@media (max-width: 768px) {
  .crypto-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
  }

  .crypto-container {
    padding: 15px 20px 30px;
  }

  .page-title {
    font-size: 28px;
  }

  .crypto-topbar {
    flex-direction: column;
    gap: 15px;
    align-items: flex-start;
  }

  .coin-box {
    padding: 15px 12px;
  }

  .coin-price {
    font-size: 16px;
  }
}

@media (max-width: 480px) {
  .crypto-grid {
    grid-template-columns: 1fr 1fr;
    gap: 10px;
  }

  .page-title {
    font-size: 24px;
  }

  .coin-box {
    padding: 12px 10px;
  }

  .coin-name {
    font-size: 10px;
  }

  .coin-price {
    font-size: 14px;
  }

  .bottom-ticker {
    display: none;
  }
}