/* buttons */
.launcher-button,
.download-button {
  background: linear-gradient(180deg, #4a4a4a 0%, #2a2a2a 100%);
  border: none;
  border-radius: 4px;
  text-align: center;
  cursor: pointer;
  transition: background 0.2s ease, transform 0.2s ease;
  text-decoration: none;
  color: #ffffff;
  display: block;
  padding: 10px 20px;
  font-size: 0.9rem;
  font-weight: 500;
}

.launcher-button:hover,
.download-button:hover {
  background: linear-gradient(180deg, #5a5a5a 0%, #3a3a3a 100%);
  transform: translateY(-2px);
}

.launcher-button:active,
.download-button:active {
  transform: translateY(0);
}

/* top nav links */
.top-link {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 12px;
  background: linear-gradient(180deg, #4a4a4a 0%, #2a2a2a 100%);
  border-radius: 4px;
  color: #00ff00;
  text-decoration: none;
  font-weight: bold;
  font-size: 0.8em;
  transition: background 0.2s ease, transform 0.2s ease;
  white-space: nowrap;
}

.top-link svg {
  width: 14px;
  height: 14px;
  flex-shrink: 0;
}

.top-link:hover {
  background: linear-gradient(180deg, #5a5a5a 0%, #3a3a3a 100%);
  transform: translateY(-2px);
}

/* modpack section */
.modpack-section {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 12px;
  background: rgba(40, 40, 40, 0.9);
  border-radius: 6px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  margin-bottom: 8px;
}

.modpack-name {
  color: #ffffff;
  font-size: 1rem;
  font-weight: bold;
  flex-shrink: 0;
}

.modpack-buttons {
  display: flex;
  gap: 8px;
}

.modpack-buttons .launcher-button,
.modpack-buttons .download-button {
  padding: 8px 16px;
  font-size: 0.85rem;
}

/* changelog */
.changelog-container {
  text-align: center;
}

.page-title {
  color: #00ff00;
  font-size: 1.4em;
  font-weight: bold;
  margin: 0 0 5px 0;
  text-align: center;
}

.changelog-entry {
  background: rgba(0, 0, 0, 0.4);
  border-left: 4px solid #00ff00;
  border-radius: 0 6px 6px 0;
  padding: 12px 16px;
  margin-bottom: 15px;
  text-align: left;
}

.changelog-version {
  color: #00ff00;
  font-size: 1em;
  margin: 0 0 6px 0;
  font-weight: bold;
}

.changelog-description {
  color: #aaaaaa;
  font-size: 0.9em;
  line-height: 1.5;
  margin: 0;
}

/* 404 error page */
.error-container {
  text-align: center;
  padding: 40px 20px;
}

.error-icon {
  width: 80px;
  height: 80px;
  margin-bottom: 20px;
  animation: fadeIn 0.5s ease-in;
}

.error-icon svg {
  width: 100%;
  height: 100%;
  stroke: currentColor;
}

.error-container .error-icon {
  color: #888;
}

.error-title-green {
  color: #00ff00;
  font-size: 1.8em;
  margin-bottom: 12px;
  font-weight: bold;
}

.error-title-red {
  color: #ff5555;
  font-size: 1.8em;
  margin-bottom: 12px;
  font-weight: bold;
}

.error-title-orange {
  color: #ffaa00;
  font-size: 1.8em;
  margin-bottom: 12px;
  font-weight: bold;
}

.error-description {
  color: #aaaaaa;
  font-size: 1em;
  margin-bottom: 25px;
  max-width: 400px;
  margin-left: auto;
  margin-right: auto;
  line-height: 1.6;
}

.go-home-btn,
.retry-btn {
  display: inline-block !important;
  width: auto !important;
  padding: 12px 30px !important;
  margin: 5px 10px !important;
}

.retry-btn {
  background: linear-gradient(180deg, #3a3a3a 0%, #2a2a2a 100%) !important;
}

.error-message {
  background: rgba(255, 0, 0, 0.2);
  border: 2px solid #ff5555;
  border-radius: 6px;
  padding: 20px;
  text-align: center;
  color: #ff5555;
  margin-top: 20px;
}

/* Download Header */
.download-header {
  text-align: center;
  margin-bottom: 20px;
}

.download-header .info-box {
  text-align: left;
}

/* Loading Overlay */
#loading-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, #1a1a1a 0%, #2d2d2d 100%);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 10000;
  opacity: 1;
  transition: opacity 0.5s ease-out;
}

#loading-overlay.fade-out {
  opacity: 0;
  pointer-events: none;
}

.loading-content {
  text-align: center;
  min-width: 320px;
}

.loading-spinner {
  width: 50px;
  height: 50px;
  border: 4px solid rgba(0, 255, 0, 0.3);
  border-top: 4px solid #00ff00;
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin: 0 auto 20px;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

#loading-text {
  color: #00ff00;
  font-size: 1.2em;
  font-weight: bold;
  margin-bottom: 15px;
}

/* Progress Bar */
.progress-bar-container {
  border: 2px solid #00ff00;
  width: 300px;
  max-width: 90vw;
  height: 20px;
  padding: 2px;
  margin: 15px auto;
  background: #1a1a1a;
  border-radius: 4px;
}

#progress-bar {
  background: linear-gradient(90deg, #00ff00 0%, #4ade80 100%);
  width: 0%;
  height: 100%;
  transition: width 0.2s ease;
  border-radius: 2px;
}

.cache-status {
  color: #888;
  font-size: 0.85em;
  margin-top: 10px;
}

/* Mod Info Button and Popup */
.modpack-title-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.mod-info-btn {
  background: rgba(255, 255, 255, 0.1);
  border: none;
  border-radius: 12px;
  padding: 4px 8px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  transition: all 0.2s ease;
  flex-shrink: 0;
  opacity: 0.7;
}

.mod-info-btn svg {
  width: 14px;
  height: 14px;
  stroke: #888;
  fill: none;
  flex-shrink: 0;
}

.mod-info-btn .mod-count {
  color: #888;
  font-size: 0.75rem;
  font-weight: 500;
}

.mod-info-btn:hover {
  background: rgba(255, 255, 255, 0.2);
  opacity: 1;
}

.mod-info-btn:hover svg {
  stroke: #4ade80;
}

.mod-info-btn:hover .mod-count {
  color: #4ade80;
}

.mods-popup-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.85);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 10001;
  padding: 15px;
  animation: fadeIn 0.2s ease;
}

.mods-popup {
  background: #1a1a1a;
  border: 1px solid #4a4a4a;
  border-radius: 12px;
  max-width: 500px;
  width: 100%;
  max-height: 85vh;
  overflow: hidden;
  animation: popIn 0.2s ease;
}

@keyframes popIn {
  from { transform: scale(0.9); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}

.mods-popup-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 15px 20px;
  border-bottom: 1px solid #4a4a4a;
  background: #222;
}

.mods-popup-header h3 {
  margin: 0;
  color: #00ff00;
  font-size: 1.1em;
  font-weight: 600;
}

.mods-popup-close {
  background: transparent;
  border: none;
  color: #888;
  font-size: 24px;
  cursor: pointer;
  padding: 0;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: all 0.2s ease;
  line-height: 1;
}

.mods-popup-close:hover {
  background: rgba(74, 222, 128, 0.15);
  color: #4ade80;
}

.mods-list {
  padding: 15px;
  max-height: calc(85vh - 70px);
  overflow-y: auto;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 8px;
}

.mods-list::-webkit-scrollbar {
  width: 6px;
}

.mods-list::-webkit-scrollbar-track {
  background: rgba(0, 0, 0, 0.3);
  border-radius: 3px;
}

.mods-list::-webkit-scrollbar-thumb {
  background: #555;
  border-radius: 3px;
}

.mods-list::-webkit-scrollbar-thumb:hover {
  background: #666;
}

.mod-item {
  padding: 8px 10px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 6px;
  color: #ccc;
  font-size: 0.85em;
  text-align: center;
  transition: all 0.15s ease;
  text-decoration: none;
  display: block;
}

a.mod-item:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.2);
  color: #fff;
}

.mod-item-nolink {
  cursor: default;
}

.mods-load-more-container {
  padding: 12px 15px;
  text-align: center;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.mods-load-more-btn {
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 6px;
  color: #ccc;
  padding: 10px 20px;
  font-size: 0.9em;
  cursor: pointer;
  transition: all 0.15s ease;
}

.mods-load-more-btn:hover {
  background: rgba(255, 255, 255, 0.15);
  border-color: rgba(255, 255, 255, 0.3);
  color: #fff;
}

/* Mobile responsive for mods popup */
@media (max-width: 480px) {
  .mods-popup {
    max-height: 90vh;
    border-radius: 8px;
  }
  
  .mods-popup-header {
    padding: 12px 15px;
  }
  
  .mods-popup-header h3 {
    font-size: 1em;
  }
  
  .mods-list {
    padding: 12px;
    grid-template-columns: repeat(2, 1fr);
    gap: 6px;
    max-height: calc(90vh - 120px);
  }
  
  .mod-item {
    padding: 6px 8px;
    font-size: 0.8em;
  }
  
  .mods-load-more-container {
    padding: 10px 12px;
  }
  
  .mods-load-more-btn {
    padding: 8px 16px;
    font-size: 0.85em;
    width: 100%;
  }

  /* Ensure mod-info-btn has consistent styling on mobile */
  .mod-info-btn {
    background: rgba(255, 255, 255, 0.1);
    opacity: 0.7;
  }

  .mod-info-btn svg {
    stroke: #888;
  }

  .mod-info-btn .mod-count {
    color: #888;
  }

  .mod-info-btn:hover,
  .mod-info-btn:active {
    background: rgba(255, 255, 255, 0.2);
    opacity: 1;
  }

  .mod-info-btn:hover svg,
  .mod-info-btn:active svg {
    stroke: #4ade80;
  }

  .mod-info-btn:hover .mod-count,
  .mod-info-btn:active .mod-count {
    color: #4ade80;
  }

  .mods-popup-close:hover,
  .mods-popup-close:active {
    background: rgba(74, 222, 128, 0.15);
    color: #4ade80;
  }
}
