@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');

/* Global Font & Box Resets */
* {
  box-sizing: border-box;
}

/* Forces form elements, buttons, and links to inherit the Inter font family */
button, input, select, textarea, a {
  font-family: inherit;
}

html, body {
  height: 100%;
}

body {
  margin: 0;
  padding: 0;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background-color: #0d0e12;
  color: #ffffff;
  
  /* Flexbox layout to lock footer at bottom */
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  
  overflow-x: hidden;
  position: relative;
  
  /* Grid pattern background */
  background-image: 
    linear-gradient(to right, rgba(255, 255, 255, 0.03) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(255, 255, 255, 0.03) 1px, transparent 1px);
  background-size: 40px 40px;
}

/* Glowing background accents */
body::before,
body::after {
  content: '';
  position: fixed;
  width: 500px;
  height: 500px;
  border-radius: 50%;
  filter: blur(120px);
  z-index: -1;
  pointer-events: none;
  opacity: 0.45;
}

/* Top-left emerald glow */
body::before {
  top: -100px;
  left: -100px;
  background: radial-gradient(circle, #04AA6D 0%, rgba(4, 170, 109, 0) 70%);
}

/* Bottom-right subtle blue/cyan glow */
body::after {
  bottom: -100px;
  right: -100px;
  background: radial-gradient(circle, #0077ff 0%, rgba(0, 119, 255, 0) 70%);
}

/* Page Content Container */
.container {
  max-width: 1200px;
  width: 90%;
  margin: 32px auto;
  flex: 1; /* Pushes footer to the bottom */
}

/* ---------- Topbar ---------- */
/* ---------- Topbar ---------- */
.topnav {
  background-color: #1e1e1e;
  display: flex;
  align-items: center;
  max-width: 900px;
  width: 100%;
  margin: 16px auto;
  padding: 0 16px;
  border-radius: 12px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
  overflow: hidden;
  box-sizing: border-box;
  position: relative;
}

/* Logo Styling */
.topnav a.logo-link,
.topnav .logo-container {
  padding: 8px 0;
  margin-right: 28px;
  display: flex;
  align-items: center;
}

.topnav .nav-logo {
  height: 28px;
  width: auto;
  display: block;
}

.topnav a.logo-link:hover {
  background-color: transparent;
  opacity: 0.85;
}

/* Nav Item Buttons (Airplane Wing Slant) */
.topnav a.nav-item {
  display: flex;
  align-items: center;
  color: #f2f2f2;
  text-align: center;
  padding: 12px 22px;
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
  transform: skewX(-20deg);
  margin: 0 2px;
  will-change: background-color, color;
  transition-property: background-color, color;
  transition-duration: 0.3s;
  transition-timing-function: ease-in-out;
}

/* Un-skew inner text */
.topnav a.nav-item span {
  transform: skewX(20deg);
  display: inline-block;
  pointer-events: none;
}

/* Hover state */
.topnav a.nav-item:hover {
  background-color: #2c2c2c;
  color: #ffffff;
}

/* Active tab state */
.topnav a.nav-item.active {
  background-color: #04AA6D;
  color: #ffffff;
}

/* Discord Button */
.topnav a.discord-btn {
  margin-left: auto;
  background-color: #5865F2;
  color: white;
  border-radius: 6px;
  padding: 8px 14px;
  font-weight: 500;
  text-decoration: none;
  font-size: 14px;
  display: flex;
  align-items: center;
  transition: background-color 0.2s ease, transform 0.1s ease;
}

.topnav a.discord-btn:hover {
  background-color: #4752C4;
  color: white;
}

/* Mobile Icon (Hamburger Button) */
.topnav .icon {
  display: none;
  background: none;
  border: none;
  color: #f2f2f2;
  font-size: 20px;
  cursor: pointer;
  padding: 10px;
  margin-left: auto;
  text-decoration: none;
}

@media screen and (max-width: 768px) {
  .topnav {
    height: auto !important;
    max-height: none !important;
    overflow: visible !important;
    padding: 16px !important;
  }

  /* Force a clean, spaced-out vertical stack using CSS Grid */
  .topnav.responsive {
    display: grid !important;
    grid-template-columns: 1fr !important;
    row-gap: 12px !important; /* Perfect uniform gap between every row */
    padding: 20px 16px 16px 16px !important;
  }

  /* Position the hamburger button in the top-right */
  .topnav.responsive .icon {
    display: block !important;
    position: absolute !important;
    right: 16px !important;
    top: 16px !important;
    margin: 0 !important;
  }

  /* Logo row gets a little breathing room below it */
  .topnav.responsive .logo-container {
    margin-bottom: 4px !important;
    padding: 0 !important;
  }

  /* Full-width block styling for every menu item */
  .topnav.responsive a.nav-item,
  .topnav.responsive a.discord-btn {
    display: flex !important;
    width: 100% !important;
    transform: none !important;
    margin: 0 !important;
    padding: 12px 16px !important;
    justify-content: center !important;
    box-sizing: border-box !important;
    border-radius: 8px !important;
  }

  .topnav.responsive a.nav-item span {
    transform: none !important;
  }

  /* Closed state mobile rules */
  .topnav:not(.responsive) a.nav-item,
  .topnav:not(.responsive) a.discord-btn {
    display: none !important;
  }

  .topnav:not(.responsive) .icon {
    display: block !important;
    margin-left: auto;
  }
}

/* Modern Frosted-Glass Hero Section */
.hero {
  position: relative;
  padding: 90px 32px;
  border-radius: 20px;
  overflow: hidden;
  text-align: center;
  margin-bottom: 32px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  
  background: 
    linear-gradient(180deg, rgba(13, 14, 18, 0.6) 0%, rgba(13, 14, 18, 0.95) 100%),
    url('../resources/img/bg-ryr.png') center/cover no-repeat;
    
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.5);
}

.hero .badge {
  display: inline-block;
  background-color: rgba(4, 170, 109, 0.15);
  color: #04AA6D;
  font-size: 13px;
  font-weight: 600;
  padding: 6px 14px;
  border-radius: 20px;
  margin-bottom: 16px;
  border: 1px solid rgba(4, 170, 109, 0.3);
}

.hero h1 {
  font-size: 2.2rem;
  font-weight: 700;
  color: #ffffff;
  margin: 0 0 16px;
  line-height: 1.25;
}

.hero p {
  font-size: 1.05rem;
  color: #a0a0a0;
  max-width: 600px;
  margin: 0 auto 28px;
  line-height: 1.6;
}

.hero-actions {
  display: flex;
  gap: 12px;
  justify-content: center;
  flex-wrap: wrap;
}

/* Action Buttons */
.btn {
  text-decoration: none;
  font-weight: 600;
  font-size: 14px;
  padding: 10px 22px;
  border-radius: 8px;
  transition: all 0.2s ease;
}

.btn-primary {
  background-color: #04AA6D;
  color: white;
}

.btn-primary:hover {
  background-color: #038d5a;
}

.btn-secondary {
  background-color: #2a2a2a;
  color: #e0e0e0;
  border: 1px solid #3d3d3d;
}

.btn-secondary:hover {
  background-color: #333333;
  color: white;
}

/* Frosted Stat Cards */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 20px;
  margin-top: 24px;
}

.stat-card {
  background: rgba(30, 30, 35, 0.6);
  backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 14px;
  padding: 24px;
  text-align: center;
  transition: transform 0.2s ease, border-color 0.2s ease;
}

.stat-card:hover {
  transform: translateY(-4px);
  border-color: rgba(4, 170, 109, 0.4);
}

.stat-card h3 {
  font-size: 2.2rem;
  margin: 0 0 4px;
  color: #04AA6D;
  font-weight: 700;
}

.stat-card p {
  margin: 0;
  color: #a0a0a0;
  font-size: 0.9rem;
}

/* ---------- Footer ---------- */
.footer {
  background-color: #1a1a1a;
  border-top: 1px solid #2a2a2a;
  padding: 24px 16px;
  margin-top: auto;
}

.footer-container {
  max-width: 900px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
}

.footer p {
  margin: 0;
  font-size: 13px;
  color: #777;
}

.footer-links {
  display: flex;
  gap: 16px;
}

.footer-links a {
  color: #aaa;
  text-decoration: none;
  font-size: 13px;
  transition: color 0.2s ease;
}

.footer-links a:hover {
  color: #04AA6D;
}

/* Card Grid Layout */
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 24px;
  margin-top: 24px;
}

/* Addon Card Container */
.card {
  background: #1e1e1e;
  border: 1px solid #2a2a2a;
  border-radius: 12px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

.card:hover {
  transform: translateY(-4px);
  border-color: #3d3d3d;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
}

/* Image Container */
.card-image-wrapper {
  position: relative;
  width: 100%;
  height: 180px;
  background-color: #181818;
  overflow: hidden;
}

.card-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.version-tag {
  position: absolute;
  top: 10px;
  right: 10px;
  background: rgba(0, 0, 0, 0.75);
  color: #04AA6D;
  font-size: 11px;
  font-weight: 600;
  padding: 4px 8px;
  border-radius: 6px;
  border: 1px solid rgba(4, 170, 109, 0.3);
  backdrop-filter: blur(4px);
}

/* Card Content Area */
.card-body {
  padding: 16px;
  display: flex;
  flex-direction: column;
  flex-grow: 1;
}

.card-meta {
  margin-bottom: 6px;
}

.card-tag {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: #04AA6D;
  font-weight: 600;
}

.card-body h3 {
  margin: 0 0 12px;
  font-size: 1.1rem;
  color: #ffffff;
  font-weight: 600;
}

/* Simulator Tags */
.sim-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 16px;
}

.sim-badge {
  background: #282828;
  color: #a0a0a0;
  font-size: 11px;
  padding: 3px 8px;
  border-radius: 4px;
  border: 1px solid #333;
}

/* Footer & Buttons inside Card */
.card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-top: auto;
  padding-top: 12px;
  border-top: 1px solid #2a2a2a;
}

.btn-secondary-link {
  color: #ccc;
  text-decoration: none;
  font-size: 13px;
  padding: 8px 14px;
  border-radius: 6px;
  background: #2a2a2a;
  border: 1px solid #3d3d3d;
  transition: all 0.2s ease;
}

.btn-secondary-link:hover {
  background: #333;
  color: #fff;
}

.card-link {
  color: white;
  background-color: #04AA6D;
  text-align: center;
  padding: 8px 16px;
  border-radius: 6px;
  text-decoration: none;
  font-size: 13px;
  font-weight: 600;
  margin-left: auto;
  transition: background-color 0.2s ease;
}

.card-link:hover {
  background-color: #038d5a;
}

/* ---------- Search & Filter Controls ---------- */
.filter-bar {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 24px;
  background: #1e1e1e;
  border: 1px solid #2a2a2a;
  padding: 16px;
  border-radius: 12px;
}

.search-box input {
  width: 100%;
  padding: 10px 14px;
  background-color: #121212;
  border: 1px solid #333;
  border-radius: 8px;
  color: #fff;
  font-size: 14px;
  box-sizing: border-box;
  outline: none;
  transition: border-color 0.2s;
}

.search-box input:focus {
  border-color: #04AA6D;
}

/* Filter Controls Wrapper */
.filter-controls {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 10px;
  flex-wrap: wrap;
}

.category-buttons {
  display: flex;
  gap: 8px;
  align-items: center;
}

.filter-btn {
  background: #2a2a2a;
  color: #ccc;
  border: 1px solid #333;
  padding: 6px 14px;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  height: 35px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
}

.filter-btn:hover, .filter-btn.active {
  background: #04AA6D;
  color: #fff;
  border-color: #04AA6D;
}

/* Simulator Dropdown Container */
.sim-dropdown-wrapper {
  position: relative;
  display: inline-block;
}

/* Dropdown Trigger Button */
.sim-dropdown-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  background: #2a2a2a;
  color: #e0e0e0;
  border: 1px solid #3d3d3d;
  padding: 6px 14px;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  height: 35px;
  box-sizing: border-box;
  transition: all 0.2s ease;
}

.sim-dropdown-btn:hover {
  background: #333333;
  color: #ffffff;
  border-color: #04AA6D;
}

.btn-icon {
  display: inline-flex;
  align-items: center;
  font-size: 14px;
  line-height: 1;
}

#selected-sim-label {
  color: #e0e0e0;
}

.arrow-icon {
  font-size: 8px;
  margin-left: 4px;
  color: #888888;
  transition: transform 0.2s ease;
}

/* Dropdown Menu Overlay */
.sim-dropdown-menu {
  display: none;
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  min-width: 180px;
  background-color: #1a1b20;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5);
  padding: 6px;
  z-index: 100;
  max-height: 240px;
  overflow-y: auto;
}

/* Show Menu Class */
.sim-dropdown-menu.show {
  display: block;
}

/* Dropdown Menu Items */
.sim-dropdown-item {
  padding: 8px 12px;
  color: #bbb;
  font-size: 13px;
  border-radius: 4px;
  cursor: pointer;
  transition: background-color 0.2s, color 0.2s;
}

.sim-dropdown-item:hover {
  background-color: #2a2a2a;
  color: #fff;
}

.sim-dropdown-item.active {
  background-color: rgba(4, 170, 109, 0.2);
  color: #04AA6D;
  font-weight: 600;
}

/* Position relative on button to anchor the badge */
.multi-download-btn {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

/* Badge styling on top-right of Download button */
.parts-badge {
    position: absolute;
    top: -6px;
    right: -6px;
    background-color: #ef4444;
    color: #ffffff;
    font-size: 10px;
    font-weight: bold;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 4px rgba(0,0,0,0.3);
}

/* Modal Popup Overlay */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

/* Modal Container */
.modal-content {
    background: #1e293b;
    color: #ffffff;
    padding: 20px;
    border-radius: 8px;
    width: 90%;
    max-width: 400px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.5);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid #334155;
    padding-bottom: 10px;
    margin-bottom: 15px;
}

.modal-close-btn {
    background: none;
    border: none;
    color: #94a3b8;
    font-size: 24px;
    cursor: pointer;
}

.modal-body {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

/* Individual Part Link in Modal */
.modal-part-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
    background: #334155;
    color: #ffffff;
    text-decoration: none;
    border-radius: 6px;
    font-weight: 500;
    transition: background 0.2s ease;
}

.modal-part-item:hover {
    background: #3b82f6;
}

.card-credits {
    font-size: 0.85rem;
    color: #9ca3af; /* muted gray color */
    margin-bottom: 8px;
}

.card-credits a {
    color: #38bdf8;
    text-decoration: none;
}

.card-credits a:hover {
    text-decoration: underline;
}

/* Skybound Hangar Badge on Card Image */
.skybound-badge {
  position: absolute;
  top: 10px;
  left: 10px;
  background: rgba(4, 170, 109, 0.85);
  color: #ffffff;
  font-size: 10px;
  font-weight: 600;
  padding: 4px 8px;
  border-radius: 6px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  backdrop-filter: blur(4px);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  z-index: 2;
}