/* =============================================
   UPFY — LIBRARY PAGE STYLES
   ============================================= */

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg: #09090f;
  --bg2: #0f0f1a;
  --surface: rgba(255,255,255,0.04);
  --border: rgba(255,255,255,0.08);
  --purple: #7c3aed;
  --pink: #ec4899;
  --grad: linear-gradient(135deg, #7c3aed, #ec4899);
  --grad-text: linear-gradient(90deg, #a78bfa, #f472b6);
  --text: #f1f1f1;
  --text-muted: #9ca3af;
  --radius: 16px;
  --radius-sm: 10px;
  --shadow: 0 20px 60px rgba(0,0,0,0.5);
}

html { scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: 'Inter', sans-serif;
  font-size: 16px;
  line-height: 1.6;
  overflow-x: hidden;
}

/* ---- CONTAINER ---- */
.container {
  width: 100%;
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 20px;
}

/* ---- GLASS ---- */
.glass {
  background: var(--surface);
  border: 1px solid var(--border);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

/* ---- BUTTONS ---- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 12px 24px;
  border-radius: 50px;
  font-weight: 700;
  font-size: 15px;
  cursor: pointer;
  border: none;
  transition: all 0.2s ease;
  text-decoration: none;
  white-space: nowrap;
}
.btn-primary {
  background: var(--grad);
  color: #fff;
  box-shadow: 0 4px 20px rgba(124,58,237,0.4);
}
.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 30px rgba(124,58,237,0.6);
}
.btn-primary:active { transform: translateY(0); }
.btn-sm { padding: 8px 18px; font-size: 14px; }

/* ---- HIGHLIGHT ---- */
.highlight {
  background: var(--grad-text);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* ============================================
   NAVBAR
   ============================================ */
.navbar {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 100;
  padding: 14px 0;
  background: rgba(9,9,15,0.95);
  border-bottom: 1px solid var(--border);
  backdrop-filter: blur(20px);
}
.nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.logo {
  display: inline-flex;
  align-items: center;
  text-decoration: none;
  flex-shrink: 0;
}
.logo-img {
  height: 56px !important;
  max-height: 56px !important;
  width: auto !important;
  max-width: 220px !important;
  object-fit: contain;
  display: block;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 28px;
}
.nav-links a {
  color: var(--text-muted);
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
  transition: color 0.2s;
}
.nav-links a:hover { color: var(--text); }

/* ============================================
   HERO
   ============================================ */
.library-hero {
  padding: 140px 0 60px;
  text-align: center;
}
.hero-content { margin-bottom: 32px; }
.hero-title {
  font-size: clamp(30px, 6vw, 48px);
  font-weight: 900;
  letter-spacing: -2px;
  line-height: 1.15;
  margin-bottom: 16px;
}
.hero-sub {
  font-size: clamp(15px, 2vw, 18px);
  color: var(--text-muted);
  max-width: 560px;
  margin: 0 auto 24px;
}
.hero-stats {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 12px;
}
.stats-count {
  font-size: 14px;
  color: var(--text-muted);
}
.stats-count strong {
  color: var(--text);
  font-size: 18px;
}

/* ============================================
   FILTERS
   ============================================ */
.filters-section {
  padding: 20px 0 40px;
  background: var(--bg2);
  position: sticky;
  top: 84px;
  z-index: 90;
}
.filters-wrapper {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
  flex-wrap: wrap;
}
.filters-list {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.filter-btn {
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text-muted);
  padding: 8px 16px;
  border-radius: 50px;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
  font-family: 'Inter', sans-serif;
}
.filter-btn:hover {
  border-color: rgba(124,58,237,0.4);
  color: var(--text);
}
.filter-btn.active {
  background: var(--grad);
  border-color: var(--purple);
  color: #fff;
}
.sort-wrapper {
  position: relative;
}
.sort-select {
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 8px 32px 8px 16px;
  border-radius: 50px;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  font-family: 'Inter', sans-serif;
  appearance: none;
  min-width: 140px;
}
.sort-select:hover {
  border-color: rgba(124,58,237,0.4);
}
.sort-select:focus {
  outline: none;
  border-color: var(--purple);
}

/* ============================================
   PROFILES GRID
   ============================================ */
.profiles-section {
  padding: 40px 0 80px;
}
.profiles-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 20px;
}
.profile-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  transition: transform 0.3s, box-shadow 0.3s;
  display: flex;
  flex-direction: column;
}
.profile-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow);
  border-color: rgba(124,58,237,0.3);
}
.profile-header {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 20px;
}
.profile-avatar {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--purple);
  flex-shrink: 0;
}
.profile-info {
  flex: 1;
  min-width: 0;
}
.profile-handle {
  font-size: 15px;
  font-weight: 700;
  margin-bottom: 4px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.profile-desc {
  font-size: 13px;
  color: var(--text-muted);
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.profile-score {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 0;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  margin-bottom: 16px;
}
.score-label {
  font-size: 13px;
  color: var(--text-muted);
  font-weight: 500;
}
.score-value {
  font-size: 16px;
  font-weight: 700;
  background: var(--grad-text);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.profile-link {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  color: #a78bfa;
  text-decoration: none;
  font-size: 14px;
  font-weight: 600;
  padding: 10px;
  border-radius: var(--radius-sm);
  transition: all 0.2s;
  margin-top: auto;
}
.profile-link:hover {
  background: rgba(124,58,237,0.1);
  color: #c4b5fd;
}
.link-icon {
  width: 16px;
  height: 16px;
  stroke: currentColor;
  stroke-width: 2;
}

/* ============================================
   FOOTER
   ============================================ */
.footer {
  border-top: 1px solid var(--border);
  padding: 48px 0;
  background: var(--bg2);
}
.footer-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  text-align: center;
}
.footer-desc {
  font-size: 13px;
  color: var(--text-muted);
  max-width: 320px;
}
.footer-copy {
  font-size: 12px;
  color: rgba(255,255,255,0.3);
}

/* ============================================
   RESPONSIVE
   ============================================ */
@media (max-width: 900px) {
  .filters-wrapper {
    flex-direction: column;
    align-items: flex-start;
  }
  .filters-list {
    width: 100%;
    overflow-x: auto;
    padding-bottom: 8px;
    flex-wrap: nowrap;
  }
  .filter-btn {
    flex-shrink: 0;
  }
  .sort-wrapper {
    width: 100%;
  }
  .sort-select {
    width: 100%;
  }
}

@media (max-width: 600px) {
  .library-hero {
    padding: 110px 0 40px;
  }
  .hero-title {
    font-size: 28px;
    letter-spacing: -1.5px;
  }
  .profiles-grid {
    grid-template-columns: 1fr;
  }
  .nav-links a:not(.btn) {
    display: none;
  }
}
