/* ===== RESET & BASE ===== */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  background: #0a0a0f;
  color: #ffffff;
  line-height: 1.6;
  overflow-x: hidden;
}
a { color: #E8891D; text-decoration: none; transition: color 0.2s; }
a:hover { color: #f5a040; text-decoration: underline; }
img { max-width: 100%; display: block; }

/* ===== NAV ===== */
nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 100;
  background: rgba(10,10,15,0.85); backdrop-filter: blur(20px);
  border-bottom: 1px solid rgba(255,255,255,0.06);
}
.nav-inner {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 24px; max-width: 1100px; margin: 0 auto;
}
.nav-brand {
  display: flex; align-items: center; gap: 12px;
  font-size: 20px; font-weight: 800; color: #fff; text-decoration: none;
}
.nav-brand:hover { color: #fff; text-decoration: none; }
.nav-brand img { width: 36px; height: 36px; border-radius: 8px; }
.nav-links { display: flex; gap: 32px; list-style: none; align-items: center; }
.nav-links > li > a {
  font-size: 14px; font-weight: 500; color: #8a8a9a;
  transition: color 0.2s; text-decoration: none;
}
.nav-links > li > a:hover { color: #fff; text-decoration: none; }
.subnav { display: none; border-top: 1px solid rgba(255,255,255,0.08); background: rgba(10,10,15,0.97); }
.subnav.open { display: block; }
.subnav-inner {
  max-width: 1100px; margin: 0 auto; padding: 10px 24px;
  display: flex; gap: 4px; align-items: center; flex-wrap: wrap;
}
.subnav-inner a {
  font-size: 13px; font-weight: 500; color: #8a8a9a;
  padding: 8px 14px; border-radius: 8px; text-decoration: none;
  transition: background 0.15s, color 0.15s;
}
.subnav-inner a:hover { background: rgba(255,255,255,0.06); color: #fff; text-decoration: none; }
.nav-app-toggle {
  background: none; border: none; cursor: pointer;
  display: flex; align-items: center; gap: 5px;
  font-size: 14px; font-weight: 500; color: #8a8a9a;
  transition: color 0.2s; padding: 0; font-family: inherit;
}
.nav-app-toggle:hover { color: #fff; }
.nav-cta {
  padding: 10px 24px; background: #E8891D; color: #fff;
  font-size: 14px; font-weight: 600; border-radius: 10px;
  transition: transform 0.2s, box-shadow 0.2s; text-decoration: none;
}
.nav-cta:hover { transform: translateY(-2px); box-shadow: 0 8px 24px rgba(232,137,29,0.4); color: #fff; text-decoration: none; }
.btn-primary {
  display: inline-flex; align-items: center; gap: 10px;
  padding: 16px 36px; background: #E8891D; color: #fff;
  font-size: 16px; font-weight: 700; border-radius: 14px;
  transition: transform 0.2s, box-shadow 0.2s;
  box-shadow: 0 12px 36px rgba(232,137,29,0.3);
  text-decoration: none;
}
.btn-primary:hover { transform: translateY(-3px); box-shadow: 0 18px 48px rgba(232,137,29,0.4); color: #fff; text-decoration: none; }
.nav-inner .btn-primary { padding: 10px 20px; font-size: 14px; border-radius: 10px; box-shadow: none; }
.nav-inner .btn-primary:hover { box-shadow: 0 8px 24px rgba(232,137,29,0.4); }
.nav-mobile { display: none; background: none; border: none; cursor: pointer; padding: 4px; }
.nav-mobile span { display: block; width: 24px; height: 2px; background: #fff; margin: 5px 0; transition: 0.3s; }

@media (max-width: 1024px) {
  .nav-links { display: none; }
  .nav-cta { display: none; }
  .nav-cta-btn { display: none; }
  .nav-inner .btn-primary { display: none; }
  .nav-mobile { display: block; }
  .nav-links.open {
    display: flex; flex-direction: column; position: absolute;
    top: 100%; left: 0; right: 0; background: rgba(10,10,15,0.98);
    padding: 24px; gap: 20px; border-bottom: 1px solid rgba(255,255,255,0.06);
    z-index: 99;
  }
  .nav-links.open li a, .nav-links.open li button { font-size: 16px; }
}

/* ===== PAGE HEADER ===== */
.page-header {
  padding: 140px 24px 60px;
  text-align: center;
  position: relative;
}
.page-header::before {
  content: ''; position: absolute; inset: 0;
  background: radial-gradient(ellipse at 50% 0%, rgba(232,137,29,0.1) 0%, transparent 60%);
  pointer-events: none;
}
.page-label {
  font-size: 13px; font-weight: 700; letter-spacing: 3px; text-transform: uppercase;
  color: #E8891D; margin-bottom: 16px; position: relative;
}
.page-header h1 {
  font-size: clamp(36px, 5vw, 56px); font-weight: 900; line-height: 1.1;
  max-width: 720px; margin: 0 auto 20px; position: relative;
}
.page-subtitle {
  font-size: 18px; color: #8a8a9a; max-width: 560px; margin: 0 auto;
  line-height: 1.7; position: relative;
}

/* ===== BROWSE SECTION ===== */
.browse-section {
  max-width: 1100px; margin: 0 auto; padding: 0 24px 100px;
}

/* ===== FILTERS ===== */
.filters-bar {
  display: flex; flex-wrap: wrap; gap: 12px;
  margin-bottom: 32px; align-items: flex-end;
}
.filter-group {
  display: flex; flex-direction: column; gap: 6px;
}
.filter-group label {
  font-size: 12px; font-weight: 700; letter-spacing: 1.5px; text-transform: uppercase;
  color: #555;
}
.filter-group select,
.search-input {
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.1);
  color: #fff;
  padding: 10px 14px;
  border-radius: 10px;
  font-size: 14px; font-family: inherit;
  appearance: none; -webkit-appearance: none;
  cursor: pointer;
  transition: border-color 0.2s;
  min-width: 160px;
}
.filter-group select:focus,
.search-input:focus {
  outline: none;
  border-color: rgba(232,137,29,0.5);
}
.filter-group select option { background: #1a1a24; }

.search-group {
  flex: 1; min-width: 200px;
}
.search-input {
  width: 100%;
}
.search-input::placeholder { color: #555; }

.filter-reset {
  background: none; border: 1px solid rgba(255,255,255,0.1); color: #8a8a9a;
  padding: 10px 16px; border-radius: 10px; font-size: 14px; font-family: inherit;
  cursor: pointer; transition: border-color 0.2s, color 0.2s;
  white-space: nowrap; align-self: flex-end;
}
.filter-reset:hover { border-color: rgba(255,255,255,0.3); color: #fff; }

.result-count {
  font-size: 13px; color: #555; margin-bottom: 20px;
}

/* ===== EXERCISE GRID ===== */
.exercise-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 20px;
}

.exercise-card {
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: 16px;
  padding: 24px;
  cursor: pointer;
  transition: transform 0.25s, border-color 0.25s, box-shadow 0.25s;
  display: flex; flex-direction: column; gap: 10px;
}
.exercise-card:hover {
  transform: translateY(-4px);
  border-color: rgba(232,137,29,0.3);
  box-shadow: 0 16px 40px rgba(232,137,29,0.08);
}

.card-top {
  display: flex; align-items: flex-start; gap: 12px;
}
.card-emoji {
  font-size: 28px; flex-shrink: 0; line-height: 1;
}
.card-meta {
  display: flex; flex-direction: column; gap: 4px;
}
.card-category {
  font-size: 12px; font-weight: 700; letter-spacing: 1.5px; text-transform: uppercase;
  color: #E8891D;
}
.card-name {
  font-size: 16px; font-weight: 700; color: #fff; line-height: 1.3;
}

.card-tags {
  display: flex; flex-wrap: wrap; gap: 6px;
}
.tag {
  font-size: 12px; font-weight: 600; padding: 3px 8px;
  border-radius: 6px; background: rgba(255,255,255,0.06);
  color: #8a8a9a;
}
.tag-band { background: rgba(232,137,29,0.12); color: #E8891D; }
.tag-position { background: rgba(120,120,200,0.12); color: #aab0f0; }

.card-desc {
  font-size: 13px; color: #666; line-height: 1.6;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
  overflow: hidden;
}

.no-results {
  grid-column: 1 / -1;
  text-align: center; padding: 80px 24px; color: #555;
}
.no-results p { font-size: 17px; margin-top: 8px; }

/* ===== MODAL ===== */
.modal-overlay {
  position: fixed; inset: 0; z-index: 200;
  background: rgba(0,0,0,0.75); backdrop-filter: blur(8px);
  display: flex; align-items: center; justify-content: center;
  padding: 24px;
  opacity: 0; pointer-events: none;
  transition: opacity 0.2s;
}
.modal-overlay.open {
  opacity: 1; pointer-events: all;
}
.modal {
  background: #111118;
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 20px;
  padding: 36px;
  max-width: 520px; width: 100%;
  transform: translateY(16px);
  transition: transform 0.25s;
}
.modal-overlay.open .modal {
  transform: translateY(0);
}
.modal-top {
  display: flex; align-items: flex-start; gap: 16px; margin-bottom: 20px;
}
.modal-emoji { font-size: 40px; flex-shrink: 0; }
.modal-heading { display: flex; flex-direction: column; gap: 4px; }
.modal-category {
  font-size: 12px; font-weight: 700; letter-spacing: 2px; text-transform: uppercase;
  color: #E8891D;
}
.modal-title {
  font-size: 24px; font-weight: 800; color: #fff; line-height: 1.2;
}
.modal-tags {
  display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 20px;
}
.modal-desc {
  font-size: 16px; color: #c0c0d0; line-height: 1.8; margin-bottom: 24px;
}
.modal-position {
  font-size: 13px; color: #555;
  border-top: 1px solid rgba(255,255,255,0.06);
  padding-top: 16px;
}
.modal-position span { color: #8a8a9a; }
.modal-close {
  position: absolute; top: 20px; right: 20px;
  background: rgba(255,255,255,0.06); border: none; color: #fff;
  width: 36px; height: 36px; border-radius: 50%;
  font-size: 18px; cursor: pointer; transition: background 0.2s;
  display: flex; align-items: center; justify-content: center;
}
.modal-close:hover { background: rgba(255,255,255,0.12); }
.modal-wrapper { position: relative; }

/* ===== FOOTER ===== */
footer {
  background: #0a0a0f; border-top: 1px solid rgba(255,255,255,0.06);
  padding: 40px 0;
}
.footer-inner {
  max-width: 1100px; margin: 0 auto; padding: 0 24px;
  display: flex; justify-content: space-between; align-items: center;
  flex-wrap: wrap; gap: 16px;
}
.footer-inner p { font-size: 13px; color: #555; }
.footer-inner a { font-size: 13px; color: #8a8a9a; text-decoration: none; display: inline-block; padding: 8px 6px; }
.footer-inner a:hover { color: #fff; text-decoration: none; }
.footer-links { display: flex; gap: 24px; }

@media (max-width: 600px) {
  .footer-inner { flex-direction: column; text-align: center; }
}

/* ===== RESPONSIVE ===== */
@media (max-width: 768px) {
  .filters-bar { flex-direction: column; align-items: stretch; }
  .filter-group select, .search-input { min-width: unset; }
  .filter-reset { align-self: flex-start; }
}

.nav-links a.active { color: #fff; }
.nav-app-toggle.active { color: #fff; }
.subnav-inner a.active { color: #fff; background: rgba(255,255,255,0.06); }

/* ===== Tablet & mobile navigation (cleaner menu) — desktop unchanged ===== */
@media (max-width: 1024px) {
  /* Hide the app-store button in the top bar so it no longer crowds the logo */
  .nav-inner .btn-primary { display: none !important; }
  /* Solid bar + let the menu stack in-flow underneath it */
  nav { background: #0a0a0f; }
  .nav-inner { flex-wrap: wrap; }
  /* keep brand + hamburger on the top row, menu wraps below */
  .nav-brand { order: 0; }
  .nav-mobile { order: 1; }
  .nav-links { order: 2; }
  /* Main menu: full-width, opaque, left-aligned vertical list */
  .nav-links { display: none; }
  .nav-links.open {
    display: flex; flex-direction: column; align-items: stretch;
    position: static; width: 100%; flex-basis: 100%;
    background: #0a0a0f; padding: 8px 0 0; margin: 0; gap: 0; border: none;
  }
  .nav-links.open > li { width: 100%; }
  .nav-links.open > li > a,
  .nav-links.open > li > button {
    display: flex; align-items: center; justify-content: space-between;
    width: 100%; box-sizing: border-box; padding: 16px 24px; margin: 0;
    font-size: 16px; color: #fff; text-align: left;
    border-top: 1px solid rgba(255,255,255,0.07); border-radius: 0;
  }
  /* Move "Application" to the bottom so its submenu sits directly under it */
  .nav-links.open > li:first-child { order: 5; }
  /* Application submenu: indented accordion, only visible while the menu is open */
  .subnav.open { display: none; }
  .nav-inner:has(.nav-links.open) + .subnav.open { display: block; }
  .subnav { flex-basis: 100%; width: 100%; background: #0a0a0f; border: none; }
  .subnav-inner {
    flex-direction: column; align-items: stretch;
    max-width: none; margin: 0; padding: 0; gap: 0;
  }
  .subnav-inner a {
    display: block; width: 100%; box-sizing: border-box;
    padding: 14px 24px 14px 44px; margin: 0; border-radius: 0; font-size: 15px;
    border-top: 1px solid rgba(255,255,255,0.05);
  }
}
