:root {
  /* FIFA 2026 Brand Inspired Palette */
  --primary: #00ff84; /* FIFA Vibrant Green */
  --secondary: #6e00ff; /* Purple accent */
  --accent: #00d4ff; /* Tech Blue */
  --background: #0a0e14;
  --surface: #161c24;
  --surface-hover: #1e2632;
  --text: #ffffff;
  --text-muted: #a0aec0;
  --card-gradient: linear-gradient(135deg, rgba(110, 0, 255, 0.1), rgba(0, 255, 132, 0.1));
  --glass: rgba(255, 255, 255, 0.03);
  --glass-border: rgba(255, 255, 255, 0.1);
  --font-main: 'Outfit', sans-serif;
}

/* Global Scrollbar Stylings */
::-webkit-scrollbar {
  width: 8px;
}

::-webkit-scrollbar-track {
  background: var(--background);
}

::-webkit-scrollbar-thumb {
  background: var(--glass-border);
  border-radius: 10px;
  border: 2px solid var(--background);
}

::-webkit-scrollbar-thumb:hover {
  background: var(--primary);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

body {
  background-color: var(--background);
  color: var(--text);
  font-family: var(--font-main);
  line-height: 1.6;
  overflow-x: hidden;
}

/* Background Animation */
body::before {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: 
    radial-gradient(circle at 10% 20%, rgba(110, 0, 255, 0.15) 0%, transparent 40%),
    radial-gradient(circle at 90% 80%, rgba(0, 255, 132, 0.15) 0%, transparent 40%);
  pointer-events: none;
  z-index: -1;
}

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

/* Header & Nav Modernizado */
header {
  padding: 1.2rem 0;
  position: sticky;
  top: 0;
  z-index: 1000;
  transition: all 0.4s ease;
}

.nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  position: relative;
  min-height: 4.5rem;
  background: rgba(15, 20, 28, 0.85);
  backdrop-filter: blur(25px) saturate(200%);
  border: 1px solid rgba(0, 255, 132, 0.2);
  padding: 0 2rem;
  border-radius: 100px;
  box-shadow: 0 15px 35px rgba(0, 0, 0, 0.4), 
              0 0 15px rgba(0, 255, 132, 0.05);
  width: 95%;
  margin: 0 auto;
  max-width: 1300px;
  transition: all 0.3s ease;
}

.nav:hover {
  border-color: rgba(0, 255, 132, 0.5);
  box-shadow: 0 15px 45px rgba(0, 0, 0, 0.6), 
              0 0 25px rgba(0, 255, 132, 0.15);
}

.header-actions {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  display: flex;
  gap: 1.2rem;
  align-items: center;
}

.nav-right {
  display: flex;
  align-items: center;
  gap: 1rem;
}

@media (max-width: 768px) {
  .header-actions {
    position: static;
    transform: none;
    order: 3;
    width: 100%;
    justify-content: center;
    margin-top: 1rem;
    gap: 0.5rem;
  }
  .nav {
    flex-wrap: wrap;
    justify-content: space-between;
    padding: 1rem;
    border-radius: 20px;
    height: auto;
  }
  .header-actions {
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
  }
  .header-actions .btn {
    width: 100%;
    justify-content: center;
  }
  .logo {
    font-size: 1.2rem;
  }
  .status-badge {
    margin-left: 0.4rem;
    font-size: 0.55rem;
    padding: 0.1rem 0.4rem;
  }
}

.logo {
  font-size: 1.6rem;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: -1px;
  background: white;
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  display: flex;
  align-items: center;
}

.logo span {
  color: var(--primary);
  -webkit-text-fill-color: var(--primary);
  margin-left: 2px;
}

.status-badge {
  font-size: 0.6rem;
  padding: 0.2rem 0.6rem;
  border-radius: 100px;
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  margin-left: 0.8rem;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
  border: 1px solid rgba(255,255,255,0.1);
  -webkit-text-fill-color: initial;
  background-clip: initial;
  transform: translateY(-2px);
}

.status-badge i {
  font-size: 0.4rem;
}

.status-checking {
  color: #a0aec0;
  background: rgba(160, 174, 192, 0.1);
}

.status-online {
  color: var(--primary);
  background: rgba(0, 255, 132, 0.1);
  border-color: rgba(0, 255, 132, 0.3);
}

.status-offline {
  color: #ff4d4d;
  background: rgba(255, 77, 77, 0.1);
  border-color: rgba(255, 77, 77, 0.3);
}

.status-online i {
  animation: pulse-green 2s infinite;
}

@keyframes pulse-green {
  0% { opacity: 1; }
  50% { opacity: 0.4; }
  100% { opacity: 1; }
}

/* Hero Section */
.hero {
  padding: 10rem 0 8rem;
  text-align: center;
  position: relative;
  background-size: cover;
  background-position: center;
  background-attachment: fixed;
  border-bottom: 2px solid var(--glass-border);
  transition: background-image 1s ease-in-out;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  min-height: 60vh;
}

/* Capa de oscurecimiento dinámica para legibilidad */
.hero::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(to bottom, rgba(10, 14, 20, 0.9), rgba(10, 14, 20, 0.4), rgba(10, 14, 20, 0.9));
  z-index: 0;
}

.hero > * {
  position: relative;
  z-index: 1;
}

.hero h1 {
  font-size: clamp(2.5rem, 8vw, 4.5rem);
  line-height: 1.1;
  margin-bottom: 1.5rem;
  font-weight: 900;
  text-shadow: 0 4px 20px rgba(0,0,0,0.5);
}

.highlight {
  position: relative;
  display: inline-block;
}

.highlight::after {
  content: '';
  position: absolute;
  bottom: 0.2em;
  left: 0;
  width: 100%;
  height: 0.3em;
  background: var(--primary);
  opacity: 0.3;
  z-index: -1;
  border-radius: 4px;
}

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

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.7rem 1.5rem;
  border-radius: 10px;
  font-weight: 700;
  font-size: 0.9rem;
  text-decoration: none;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  cursor: pointer;
  border: none;
  font-family: inherit;
}

.btn-primary {
  background: var(--primary);
  color: #000;
  box-shadow: 0 0 20px rgba(0, 255, 132, 0.3);
}

.btn-primary:hover {
  transform: translateY(-3px) scale(1.02);
  box-shadow: 0 10px 30px rgba(0, 255, 132, 0.5);
}

.btn-primary:active {
  transform: scale(0.96);
}

.btn-outline {
  background: transparent;
  border: 1px solid var(--primary);
  color: var(--text);
  padding: 0.6rem 1.2rem;
  border-radius: 8px;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.8rem;
  transition: 0.3s;
}

.btn-outline:hover {
  background: rgba(0, 255, 132, 0.1);
  box-shadow: 0 0 15px rgba(0, 255, 132, 0.1);
}

.btn-secondary {
  background: var(--glass);
  color: var(--text);
  border: 1px solid var(--glass-border);
}

.btn-icon {
  background: var(--surface);
  border: 1px solid var(--glass-border);
  color: var(--text);
  width: 42px;
  height: 42px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: 0.3s;
  font-size: 1.1rem;
}

.btn-icon:hover {
  background: var(--primary);
  color: #000;
  transform: scale(1.1);
}

.pulse {
  animation: pulse-animation 2s infinite;
}

@keyframes pulse-animation {
  0% { box-shadow: 0 0 0 0px rgba(0, 255, 132, 0.4); }
  70% { box-shadow: 0 0 0 10px rgba(0, 255, 132, 0); }
  100% { box-shadow: 0 0 0 0px rgba(0, 255, 132, 0); }
}

/* Market Section */
.market-header {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  margin-bottom: 2rem;
  background: var(--surface);
  padding: 1.5rem;
  border-radius: 16px;
  border: 1px solid var(--glass-border);
}

.search-box {
  width: 100%;
}

.advanced-filters {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 1rem;
  width: 100%;
}

.filter-select {
  background: var(--background);
  cursor: pointer;
}

.filters {
  display: flex;
  gap: 1rem;
  overflow-x: auto;
  padding-bottom: 0.5rem;
  scrollbar-width: none;
}

.filters::-webkit-scrollbar {
  display: none;
}

.filter-chip {
  padding: 0.6rem 1.2rem;
  border-radius: 100px;
  background: var(--surface);
  border: 1px solid var(--glass-border);
  color: var(--text-muted);
  cursor: pointer;
  white-space: nowrap;
  transition: 0.3s;
}

.filter-chip.active {
  background: var(--primary);
  color: #000;
  border-color: var(--primary);
}

/* Market Grid 7 Columns Desktop */
.card-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 0.8rem;
}

@media (max-width: 1600px) {
  .card-grid { grid-template-columns: repeat(6, 1fr); }
}

@media (max-width: 1400px) {
  .card-grid { grid-template-columns: repeat(5, 1fr); }
}

@media (max-width: 1100px) {
  .card-grid { grid-template-columns: repeat(4, 1fr); }
}

@media (max-width: 850px) {
  .card-grid { grid-template-columns: repeat(3, 1fr); }
}

@media (max-width: 600px) {
  .card-grid { grid-template-columns: repeat(2, 1fr); gap: 0.5rem; }
}

.card-item {
  background: var(--surface);
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid var(--glass-border);
  transition: 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.2);
  position: relative;
  cursor: pointer;
}

/* Venta (Verde) */
.card-item:not(.is-exchange):hover {
  transform: translateY(-8px);
  border-color: var(--primary);
  box-shadow: 0 12px 25px rgba(0, 255, 132, 0.2);
}

/* Canje (Azul/Cyan) */
.card-item.is-exchange {
  border-bottom: 2px solid #00d4ff;
}

.card-item.is-exchange:hover {
  transform: translateY(-8px);
  border-color: #00d4ff;
  box-shadow: 0 12px 25px rgba(0, 212, 255, 0.2);
}

.card-image-container {
  height: 140px;
  width: 100%;
  background: #000;
  position: relative;
  overflow: hidden;
}

.card-image-container img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: 0.5s;
}

.card-item:hover img {
  transform: scale(1.1);
}

.card-badge {
  position: absolute;
  top: 1rem;
  right: 1rem;
  padding: 0.4rem 0.8rem;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(4px);
  border-radius: 8px;
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--primary);
  border: 1px solid var(--primary);
}

.card-type-badge.exchange-badge {
  background: #00d4ff;
  color: #000;
}

.card-info {
  padding: 1rem;
}

.card-name {
  font-size: 0.95rem;
  font-weight: 800;
  margin-bottom: 0.2rem;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.card-team {
  font-size: 0.8rem;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.card-price-action {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 1rem;
  padding-top: 0.8rem;
  border-top: 1px solid var(--glass-border);
}

.card-price {
  font-weight: 800;
  font-size: 1rem;
  color: var(--primary);
}

.card-action {
  font-size: 0.7rem;
  color: var(--secondary);
  font-weight: 700;
  text-transform: uppercase;
}

.card-timer {
  margin-top: 0.8rem;
  padding-top: 0.8rem;
  border-top: 1px dashed var(--glass-border);
  font-size: 0.75rem;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-weight: 700;
}

/* Upload Modal/Section */
.upload-container {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.9);
  backdrop-filter: blur(10px);
  z-index: 2000;
  display: none; /* Toggle with JS */
  justify-content: center;
  align-items: center;
  padding: 1rem;
}

.upload-modal {
  background: var(--surface);
  width: 100%;
  max-width: 420px;
  max-height: 90vh;
  overflow-y: auto;
  border-radius: 16px;
  padding: 1rem 1.5rem;
  border: 1px solid var(--glass-border);
  position: relative;
  scrollbar-width: thin;
}

.upload-modal::-webkit-scrollbar {
  width: 6px;
}

.upload-modal::-webkit-scrollbar-thumb {
  background: var(--glass-border);
  border-radius: 10px;
}

.close-modal {
  position: absolute;
  top: 1.5rem;
  right: 1.5rem;
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 1.5rem;
  cursor: pointer;
}

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

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

.form-input {
  width: 100%;
  padding: 0.6rem 0.8rem;
  border-radius: 8px;
  background: var(--background);
  border: 1px solid var(--glass-border);
  color: var(--text);
  font-family: inherit;
  font-size: 0.9rem;
  transition: 0.3s;
}

.form-input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 4px rgba(0, 255, 132, 0.1);
}

.file-upload {
  border: 1px dashed var(--glass-border);
  padding: 1rem;
  text-align: center;
  border-radius: 10px;
  cursor: pointer;
  transition: 0.3s;
}

.file-upload:hover {
  border-color: var(--primary);
  background: rgba(0, 255, 132, 0.05);
}

.file-upload.error-border {
  border-color: #ff4d4d;
  background: rgba(255, 77, 77, 0.05);
  animation: shake 0.4s ease-in-out;
}

/* Modern Detail Modal Responsive Layout */
#detail-content {
  display: grid;
  grid-template-columns: 1fr 1.5fr;
  gap: 2rem;
}

#detail-content .card-image-container {
  border-radius: 12px;
  height: 100%;
}

#detail-content .detail-info-box {
  display: flex;
  flex-direction: column;
  justify-content: center;
}

@media (max-width: 768px) {
  #detail-content {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }
  
  #detail-content .card-image-container {
    height: 300px;
  }
  
  #detail-content h2 {
    font-size: 1.6rem !important;
  }
  
  .upload-modal {
    padding: 1.5rem;
    width: 95%;
  }
  
  .hero {
    padding: 6rem 1rem 3rem;
  }
  
  .hero h1 {
    font-size: 2.2rem;
  }
  
  .hero p {
    font-size: 1rem;
  }
}

@keyframes shake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-5px); }
  75% { transform: translateX(5px); }
}

/* Footer */
footer {
  padding: 4rem 0;
  margin-top: 6rem;
  text-align: center;
  border-top: 1px solid var(--glass-border);
}

.footer-logo {
  font-size: 1.2rem;
  font-weight: 800;
  margin-bottom: 1rem;
}

/* Responsiveness */
@media (max-width: 768px) {
  .hero {
    padding: 6rem 0 3rem;
  }
  .card-grid {
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  }
}
