/* Modern Downloads Page Styling */

:root {
  --bg: #11121b; --surface: rgba(255, 255, 255, .045); --surface-hover: rgba(255, 255, 255, .08);
  --line: rgba(255, 255, 255, .12); --text: #f0f4f8; --muted: #a0aec0;
  --accent: #ff8290; --accent-2: #f27b50; --accent-3: #ffb078; --green: #48bb78; --red: #f56565;
  --radius: 20px;
}

.downloads-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 60px 28px;
}

.downloads-container .back {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--accent);
  text-decoration: none;
  margin-bottom: 32px;
  font-weight: 600;
  transition: all .3s cubic-bezier(.2, .8, .2, 1);
  font-size: .95rem;
}

.downloads-container .back:hover {
  color: var(--accent-3);
  transform: translateX(-6px);
}

.downloads-container h1 {
  font-size: clamp(2rem, 6vw, 3.5rem);
  margin-bottom: 12px;
  color: var(--text);
  font-weight: 900;
  letter-spacing: -.02em;
  background: linear-gradient(135deg, #ff8190, #ffb078, #ffdae0);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.subtitle {
  font-size: 1.15rem;
  color: var(--muted);
  margin-bottom: 48px;
  font-weight: 500;
  max-width: 600px;
}

/* Downloads Grid */
.downloads-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(360px, 1fr));
  gap: 28px;
  margin-bottom: 60px;
}

.download-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 32px;
  transition: all .35s cubic-bezier(.2, .8, .2, 1);
  display: flex;
  flex-direction: column;
  backdrop-filter: blur(10px);
  position: relative;
  overflow: hidden;
}

.download-card::before {
  content: "";
  position: absolute;
  inset: -100%;
  background: radial-gradient(circle at var(--mx, 50%) var(--my, 50%), rgba(102, 126, 234, .2) 0%, transparent 60%);
  opacity: 0;
  transition: opacity .3s;
}

.download-card:hover {
  transform: translateY(-10px);
  background: rgba(255, 255, 255, .08);
  border-color: rgba(102, 126, 234, .6);
  box-shadow: 0 20px 50px rgba(102, 126, 234, .2), inset 0 1px 0 rgba(255, 255, 255, .1);
}

.download-card:hover::before {
  opacity: 1;
}

.download-card.featured {
  grid-column: 1 / -1;
  background: linear-gradient(135deg, rgba(102, 126, 234, .12), rgba(118, 75, 162, .08));
  border: 2px solid var(--accent);
  position: relative;
}

.card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 20px;
  gap: 16px;
  flex-wrap: wrap;
}

.card-header h2 {
  font-size: 1.6rem;
  margin: 0;
  color: var(--text);
  font-weight: 800;
  letter-spacing: -.01em;
}

.badge {
  display: inline-block;
  padding: 8px 16px;
  border-radius: 999px;
  font-size: .8rem;
  font-weight: 700;
  text-transform: uppercase;
  white-space: nowrap;
  letter-spacing: .05em;
  border: 1px solid;
}

.badge-featured {
  background: rgba(102, 126, 234, .2);
  color: var(--accent);
  border-color: var(--accent);
}

.badge-info {
  background: rgba(72, 187, 120, .2);
  color: var(--green);
  border-color: var(--green);
}

.badge-success {
  background: rgba(72, 187, 120, .2);
  color: var(--green);
  border-color: var(--green);
}

/* Card Info */
.card-info {
  background: rgba(102, 126, 234, .08);
  padding: 20px;
  border-radius: 14px;
  margin-bottom: 20px;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 16px;
  border: 1px solid var(--line);
}

.info-item {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.info-item .label {
  font-size: .78rem;
  color: var(--muted);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .08em;
}

.info-item .value {
  font-size: 1.1rem;
  color: var(--text);
  font-weight: 700;
  letter-spacing: -.01em;
}

/* Mods List Preview */
.modlist-preview {
  background: rgba(102, 126, 234, .08);
  padding: 20px;
  border-radius: 14px;
  margin-bottom: 20px;
  border: 1px solid var(--line);
}

.modlist-preview h3 {
  margin: 0 0 14px 0;
  font-size: 1rem;
  color: var(--text);
  font-weight: 700;
}

.mods-list {
  display: grid;
  gap: 8px;
  max-height: 280px;
  overflow-y: auto;
}

.mod-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  background: rgba(0, 0, 0, .2);
  border-radius: 8px;
  font-size: .9rem;
  transition: all .2s;
  border: 1px solid rgba(255, 255, 255, .05);
}

.mod-item:hover {
  background: rgba(102, 126, 234, .15);
  border-color: var(--line);
}

.mod-name {
  font-weight: 600;
  color: var(--text);
  flex: 1;
}

.mod-category {
  font-size: .75rem;
  color: var(--muted);
  background: rgba(102, 126, 234, .2);
  padding: 4px 8px;
  border-radius: 4px;
  text-transform: uppercase;
  font-weight: 600;
  letter-spacing: .05em;
}

/* Card Description */
.card-description {
  flex: 1;
  margin-bottom: 20px;
  color: var(--muted);
  line-height: 1.65;
  font-size: .95rem;
}

/* Card Actions */
.card-actions {
  display: flex;
  gap: 12px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}

.btn {
  padding: 12px 28px;
  border: none;
  border-radius: 12px;
  font-weight: 700;
  cursor: pointer;
  transition: all .3s cubic-bezier(.2, .8, .2, 1);
  text-decoration: none;
  display: inline-block;
  font-size: .95rem;
  text-align: center;
  position: relative;
  overflow: hidden;
}

.btn-primary {
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: white;
  flex: 1;
  min-width: 150px;
  box-shadow: 0 10px 30px rgba(102, 126, 234, .3);
}

.btn-primary:hover {
  transform: translateY(-3px);
  box-shadow: 0 15px 50px rgba(118, 75, 162, .4);
}

.btn-secondary {
  background: rgba(102, 126, 234, .15);
  color: var(--accent);
  border: 2px solid var(--accent);
  flex: 1;
  min-width: 150px;
  transition: all .3s;
}

.btn-secondary:hover {
  background: var(--accent);
  color: white;
  transform: translateY(-2px);
}

/* Card Installation */
.card-installation {
  background: rgba(102, 126, 234, .08);
  padding: 20px;
  border-radius: 14px;
  border-left: 4px solid var(--accent);
  border: 1px solid var(--line);
  border-left: 4px solid var(--accent);
}

.card-installation h4 {
  margin: 0 0 14px 0;
  color: var(--text);
  font-weight: 700;
  font-size: 1rem;
}

.card-installation ol {
  margin: 0;
  padding-left: 20px;
  color: var(--muted);
}

.card-installation li {
  margin-bottom: 10px;
  line-height: 1.6;
  font-size: .95rem;
}

.card-installation code {
  background: rgba(0, 0, 0, .3);
  padding: 4px 8px;
  border-radius: 4px;
  font-family: 'Cascadia Code', Consolas, monospace;
  font-size: .85rem;
  color: var(--accent-3);
  border: 1px solid rgba(102, 126, 234, .2);
}

.server-ip {
  font-weight: 700;
  color: var(--accent);
}

/* Full Modlist */
.full-modlist {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 40px;
  margin-bottom: 60px;
  backdrop-filter: blur(10px);
}

.full-modlist h2 {
  margin-top: 0;
  margin-bottom: 32px;
  color: var(--text);
  font-size: 2rem;
  font-weight: 900;
  letter-spacing: -.02em;
  background: linear-gradient(135deg, #ff8190, #ffb078, #ffdae0);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.mod-categories {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 28px;
  margin-bottom: 28px;
}

.mod-category-section {
  padding-bottom: 24px;
  background: rgba(102, 126, 234, .05);
  padding: 20px;
  border-radius: 14px;
  border: 1px solid var(--line);
  transition: all .3s;
}

.mod-category-section:hover {
  background: rgba(102, 126, 234, .1);
  border-color: var(--line);
}

.mod-category-section h3 {
  margin: 0 0 16px 0;
  color: var(--accent);
  font-size: 1.15rem;
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 700;
}

.mod-category-section ul {
  list-style: none;
  margin: 0;
  padding: 0;
}

.mod-category-section li {
  margin-bottom: 10px;
  color: var(--muted);
  line-height: 1.6;
  padding-left: 0;
  font-size: .95rem;
}

.mod-category-section strong {
  color: var(--text);
  font-weight: 700;
}

/* Modlist Stats */
.modlist-stats {
  background: linear-gradient(135deg, rgba(102, 126, 234, .12), rgba(118, 75, 162, .08));
  border-radius: var(--radius);
  padding: 32px;
  margin-top: 32px;
  border: 1px solid var(--line);
}

.modlist-stats h3 {
  margin: 0 0 24px 0;
  color: var(--text);
  font-weight: 800;
  font-size: 1.3rem;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 20px;
}

.stat {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 16px;
  background: rgba(0, 0, 0, .2);
  border-radius: 12px;
  border: 1px solid var(--line);
}

.stat-number {
  font-size: 2.4rem;
  font-weight: 900;
  color: var(--accent);
  background: linear-gradient(135deg, #ff8190, #ffb078, #ffdae0);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.stat-label {
  font-size: .85rem;
  color: var(--muted);
  text-transform: uppercase;
  font-weight: 700;
  letter-spacing: .08em;
}

/* Setup Guide Modal */
.setup-guide {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, .8);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 20px;
  overflow-y: auto;
  backdrop-filter: blur(5px);
}

.guide-content {
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  max-width: 700px;
  width: 100%;
  padding: 40px;
  position: relative;
  box-shadow: 0 20px 70px rgba(0, 0, 0, .5);
  max-height: 90vh;
  overflow-y: auto;
}

.guide-close {
  position: absolute;
  top: 20px;
  right: 20px;
  background: rgba(255, 255, 255, .08);
  border: 1px solid var(--line);
  border-radius: 10px;
  font-size: 1.8rem;
  cursor: pointer;
  color: var(--muted);
  transition: all .3s;
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 300;
}

.guide-close:hover {
  color: var(--text);
  background: rgba(255, 255, 255, .12);
}

.guide-content h2 {
  margin: 0 0 28px 0;
  color: var(--text);
  font-size: 2rem;
  font-weight: 900;
  letter-spacing: -.02em;
}

.guide-step {
  margin-bottom: 28px;
  padding-bottom: 28px;
  border-bottom: 1px solid var(--line);
}

.guide-step:last-child {
  border-bottom: none;
  margin-bottom: 0;
  padding-bottom: 0;
}

.guide-step h3 {
  margin: 0 0 12px 0;
  color: var(--accent);
  font-size: 1.1rem;
  font-weight: 700;
}

.guide-step ol {
  margin: 0;
  padding-left: 20px;
  color: var(--muted);
}

.guide-step li {
  margin-bottom: 10px;
  line-height: 1.65;
  font-size: .95rem;
}

.guide-step a {
  color: var(--accent);
  text-decoration: none;
  font-weight: 600;
  transition: color .2s;
}

.guide-step a:hover {
  color: var(--accent-3);
}

.guide-step code {
  background: rgba(102, 126, 234, .15);
  padding: 4px 8px;
  border-radius: 4px;
  font-family: 'Cascadia Code', Consolas, monospace;
  font-size: .9rem;
  color: var(--accent-3);
  border: 1px solid rgba(102, 126, 234, .2);
}

.guide-troubleshooting {
  background: linear-gradient(135deg, rgba(245, 101, 101, .1), rgba(240, 101, 101, .05));
  border: 1px solid rgba(245, 101, 101, .2);
  border-radius: 12px;
  padding: 20px;
  margin-top: 28px;
}

.guide-troubleshooting h3 {
  margin: 0 0 16px 0;
  color: var(--red);
  font-weight: 700;
  font-size: 1rem;
}

.troubleshoot-item {
  margin-bottom: 14px;
  padding-bottom: 14px;
  border-bottom: 1px solid rgba(245, 101, 101, .15);
}

.troubleshoot-item:last-child {
  margin-bottom: 0;
  padding-bottom: 0;
  border-bottom: none;
}

.troubleshoot-item h4 {
  margin: 0 0 6px 0;
  color: var(--red);
  font-size: .95rem;
  font-weight: 700;
}

.troubleshoot-item p {
  margin: 0;
  color: var(--muted);
  line-height: 1.6;
  font-size: .9rem;
}

/* Responsive */
@media (max-width: 768px) {
  .downloads-container {
    padding: 40px 16px;
  }

  .downloads-container h1 {
    font-size: clamp(1.8rem, 5vw, 2.4rem);
  }

  .downloads-grid {
    grid-template-columns: 1fr;
    gap: 20px;
  }

  .download-card {
    padding: 24px;
  }

  .download-card.featured {
    grid-column: auto;
  }

  .card-header {
    flex-direction: column;
    align-items: flex-start;
  }

  .card-info {
    grid-template-columns: 1fr;
  }

  .card-actions {
    flex-direction: column;
  }

  .btn {
    width: 100%;
    min-width: auto;
  }

  .mod-categories {
    grid-template-columns: 1fr;
    gap: 16px;
  }

  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .full-modlist {
    padding: 24px;
  }

  .guide-content {
    max-height: 95vh;
    padding: 24px;
  }

  .guide-content h2 {
    font-size: 1.5rem;
  }
}

@media (max-width: 480px) {
  .downloads-container {
    padding: 32px 12px;
  }

  .card-header h2 {
    font-size: 1.3rem;
  }

  .stats-grid {
    grid-template-columns: 1fr;
  }

  .setup-guide {
    padding: 10px;
  }

  .guide-content {
    padding: 20px;
  }
}
