/* ===== LAYOUT: SIDEBAR + CONTENT ===== */
.main-layout {
  display: flex; min-height: calc(100vh - 64px);
}
.sidebar {
  width: 220px; flex-shrink: 0; background: var(--surface);
  border-right: 1px solid var(--border);
  position: sticky; top: 64px; height: calc(100vh - 64px);
  overflow-y: auto; overflow-x: hidden;
  padding: 16px 0; transition: width 0.25s ease, padding 0.25s ease;
}
.sidebar::-webkit-scrollbar { width: 4px; }
.sidebar::-webkit-scrollbar-thumb { background: var(--text3); border-radius: 2px; }
.sidebar.collapsed {
  width: 40px; padding: 8px 0; overflow: hidden;
}
.sidebar.collapsed .sb-inner { opacity: 0; pointer-events: none; }
.sb-inner { transition: opacity 0.2s; }
.main-content { flex: 1; min-width: 0; }

/* ===== SIDEBAR: COLLAPSE BUTTON ===== */
.sb-collapse-btn {
  display: flex; align-items: center; justify-content: center;
  width: 100%; padding: 6px 0 10px; background: none; border: none;
  color: var(--text3); cursor: pointer; transition: color 0.15s;
}
.sb-collapse-btn:hover { color: var(--text); }
.sb-collapse-btn svg { width: 18px; height: 18px; transition: transform 0.25s; }
.sidebar.collapsed .sb-collapse-btn svg { transform: rotate(180deg); }

/* ===== TOP NAV ===== */
.top-nav {
  display: flex; gap: 0; background: var(--surface);
  border-bottom: 1px solid var(--border); padding: 0 32px;
}
.nav-link {
  background: none; border: none; color: var(--text3); padding: 12px 20px;
  font-size: 14px; font-weight: 500; font-family: inherit; cursor: pointer;
  border-bottom: 2px solid transparent; transition: all 0.2s;
}
.nav-link:hover { color: var(--text); }
.nav-link.active { color: var(--accent); border-bottom-color: var(--accent); }

/* ===== PAGES ===== */
.page { display: none; }
.page.active { display: block; }

/* ===== ACTIVE FILTERS BAR (above grid) ===== */
.filters-bar {
  display: none; padding: 8px 24px; gap: 8px; flex-wrap: wrap; align-items: center;
  background: rgba(17,17,24,0.5); border-bottom: 1px solid var(--border);
}
.filters-bar.visible { display: flex; }
.filters-bar .active-tag {
  display: inline-flex; align-items: center; gap: 3px;
  background: rgba(124,92,252,0.15); color: var(--accent);
  padding: 3px 10px; border-radius: 10px; font-size: 12px; font-weight: 500;
}
.filters-bar .active-tag button {
  background: none; border: none; color: var(--accent); cursor: pointer;
  font-size: 13px; line-height: 1; padding: 0 0 0 3px;
}
.filters-bar .active-tag button:hover { color: var(--accent2); }
.filters-bar .active-tag.tag-fav { background: rgba(251,191,36,0.15); color: var(--amber); }
.filters-bar .active-tag.tag-fav button { color: var(--amber); }
.filters-bar .active-tag.tag-fps { background: rgba(74,222,128,0.15); color: var(--green); }
.filters-bar .active-tag.tag-fps button { color: var(--green); }
.filters-bar .tag-clear {
  background: none; border: none; color: var(--text3); font-size: 12px;
  cursor: pointer; font-family: inherit; margin-left: auto;
}
.filters-bar .tag-clear:hover { color: var(--accent2); }

/* ===== SIDEBAR: TOP ACTIONS ===== */
.sb-actions {
  display: flex; gap: 6px; padding: 0 14px 12px; flex-wrap: wrap;
}
.sb-btn {
  flex: 1; min-width: 0; background: rgba(255,255,255,0.04); border: 1px solid var(--border);
  color: var(--text3); padding: 6px 8px; border-radius: var(--radius-sm);
  cursor: pointer; font-size: 11px; font-weight: 600; font-family: inherit;
  transition: all 0.2s; display: flex; align-items: center; justify-content: center; gap: 4px;
  white-space: nowrap;
}
.sb-btn:hover { color: var(--text); border-color: var(--border-hover); background: rgba(255,255,255,0.08); }
.sb-btn.active { color: var(--amber); border-color: var(--amber); background: rgba(251,191,36,0.1); }
.sb-btn svg { width: 12px; height: 12px; flex-shrink: 0; }
@keyframes dice-spin { 0% { transform: rotate(0deg); } 100% { transform: rotate(360deg); } }
.sb-btn.spin svg { animation: dice-spin 0.4s ease; }

/* ===== SIDEBAR: STUDIO TABS ===== */
.sb-studios {
  display: flex; flex-direction: column; gap: 1px; padding: 0 10px 8px;
}
.sb-studio-btn {
  background: none; border: none; color: var(--text2);
  padding: 7px 12px; border-radius: var(--radius-sm); cursor: pointer;
  font-size: 13px; font-weight: 500; font-family: inherit;
  text-align: left; transition: all 0.15s;
  display: flex; align-items: center; gap: 8px;
}
.sb-studio-btn:hover { background: rgba(255,255,255,0.06); color: var(--text); }
.sb-studio-btn.active { color: var(--text); background: rgba(124,92,252,0.12); }
.sb-studio-dot {
  width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0;
}
.sb-studio-count {
  margin-left: auto; font-size: 11px; color: var(--text3);
  background: rgba(255,255,255,0.06); padding: 1px 6px; border-radius: 6px;
}

/* ===== SIDEBAR: SECTIONS ===== */
.sb-sep { height: 1px; background: var(--border); margin: 8px 14px; }
.sb-section {}
.sb-section-head {
  display: flex; align-items: center; padding: 6px 14px; cursor: pointer;
  user-select: none; transition: color 0.15s;
}
.sb-section-head:hover { color: var(--text); }
.sb-section-title {
  font-size: 11px; font-weight: 600; text-transform: uppercase;
  letter-spacing: 1px; color: var(--text3); flex: 1;
}
.sb-section-head .sb-badge {
  font-size: 10px; font-weight: 700; color: var(--accent);
  background: rgba(124,92,252,0.15); padding: 1px 6px; border-radius: 8px;
  margin-right: 6px; display: none;
}
.sb-section-head .sb-badge.visible { display: inline; }
.sb-chevron {
  width: 14px; height: 14px; color: var(--text3);
  transition: transform 0.2s;
}
.sb-section.collapsed .sb-chevron { transform: rotate(-90deg); }
.sb-section-body {
  max-height: 600px; overflow: hidden;
  transition: max-height 0.3s ease, opacity 0.2s;
  opacity: 1; padding: 4px 0;
}
.sb-section.collapsed .sb-section-body {
  max-height: 0; opacity: 0; padding: 0;
}

/* ===== SIDEBAR: SEARCH INSIDE SECTION ===== */
.sb-search {
  margin: 2px 14px 6px; padding: 6px 10px; background: rgba(255,255,255,0.05);
  border: 1px solid var(--border); border-radius: var(--radius-sm);
  color: var(--text); font-size: 12px; font-family: inherit; outline: none;
  width: calc(100% - 28px); transition: border-color 0.2s;
}
.sb-search:focus { border-color: var(--accent); }
.sb-search::placeholder { color: var(--text3); }

/* ===== SIDEBAR: ITEMS ===== */
.sb-item {
  display: flex; align-items: center; gap: 8px; padding: 5px 14px;
  cursor: pointer; transition: background 0.12s; font-size: 13px; color: var(--text2);
}
.sb-item:hover { background: rgba(255,255,255,0.05); color: var(--text); }
.sb-item.checked { color: var(--text); }
.sb-check {
  width: 15px; height: 15px; border-radius: 3px; border: 1.5px solid var(--text3);
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
  transition: all 0.15s;
}
.sb-item.checked .sb-check { background: var(--accent); border-color: var(--accent); }
.sb-check svg { width: 9px; height: 9px; opacity: 0; }
.sb-item.checked .sb-check svg { opacity: 1; }
.sb-item-label { flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sb-avatar {
  width: 24px; height: 24px; border-radius: 50%; flex-shrink: 0;
  object-fit: cover; background: var(--card);
}
.sb-avatar-placeholder {
  width: 24px; height: 24px; border-radius: 50%; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  font-size: 10px; font-weight: 700; color: #fff;
}
.sb-item-count {
  font-size: 11px; color: var(--text3); flex-shrink: 0;
}

/* ===== SIDEBAR: FPS TOGGLE ===== */
.sb-toggle-row {
  display: flex; align-items: center; gap: 8px; padding: 4px 14px 6px;
  font-size: 11px; color: var(--text3);
}
.sb-toggle {
  position: relative; width: 32px; height: 18px; border-radius: 9px;
  background: rgba(255,255,255,0.1); border: none; cursor: pointer;
  transition: background 0.2s; padding: 0; flex-shrink: 0;
}
.sb-toggle.on { background: var(--accent); }
.sb-toggle::after {
  content: ''; position: absolute; top: 2px; left: 2px;
  width: 14px; height: 14px; border-radius: 50%; background: #fff;
  transition: transform 0.2s;
}
.sb-toggle.on::after { transform: translateX(14px); }

/* ===== SIDEBAR: CLEAR ===== */
.sb-clear {
  background: none; border: none; color: var(--text3); font-size: 11px;
  cursor: pointer; font-family: inherit; padding: 8px 14px; width: 100%;
  text-align: left; transition: color 0.15s; display: none;
}
.sb-clear.visible { display: block; }
.sb-clear:hover { color: var(--accent2); }

/* ===== FAVORITE STAR ON CARDS ===== */
.fav-star {
  position: absolute; top: 36px; right: 10px; z-index: 3;
  width: 32px; height: 32px; border-radius: 50%;
  background: rgba(0,0,0,0.5); backdrop-filter: blur(8px);
  border: none; cursor: pointer; display: flex;
  align-items: center; justify-content: center;
  opacity: 0; transition: all 0.2s; color: rgba(255,255,255,0.6);
}
.card:hover .fav-star { opacity: 1; }
.fav-star:hover { color: var(--amber); transform: scale(1.15); }
.fav-star.active { opacity: 1; color: var(--amber); }
.fav-star svg { width: 16px; height: 16px; }

/* ===== ACTRESSES PAGE ===== */
.actresses-page-header {
  padding: 32px 32px 16px; display: flex; align-items: center; gap: 16px;
}
.actresses-page-header h2 { font-size: 22px; font-weight: 700; color: var(--text); }
.actresses-page-header .ap-count { color: var(--text3); font-size: 14px; }
.actresses-search {
  margin-left: auto; padding: 8px 14px; background: var(--surface);
  border: 1px solid var(--border); border-radius: var(--radius-sm);
  color: var(--text); font-size: 14px; font-family: inherit; outline: none;
  width: 240px; transition: border-color 0.2s;
}
.actresses-search:focus { border-color: var(--accent); }
.actresses-search::placeholder { color: var(--text3); }
.actresses-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 20px; padding: 16px 32px 40px;
}
.actress-card {
  position: relative; border-radius: var(--radius-lg); overflow: hidden;
  cursor: pointer; transition: all 0.3s; border: 1px solid var(--border);
  aspect-ratio: 3/4;
}
.actress-card:hover { transform: translateY(-6px) scale(1.02); box-shadow: 0 20px 50px rgba(0,0,0,0.5); border-color: var(--accent); }
.actress-card-bg {
  position: absolute; top: 0; left: 0; width: 100%; height: 100%;
  background-size: cover; background-position: center top;
  transition: transform 0.4s;
}
.actress-card:hover .actress-card-bg { transform: scale(1.08); }
.actress-card-overlay {
  position: absolute; bottom: 0; left: 0; right: 0;
  background: linear-gradient(to top, rgba(0,0,0,0.9) 0%, rgba(0,0,0,0.4) 50%, transparent 100%);
  padding: 60px 16px 16px; display: flex; flex-direction: column; justify-content: flex-end;
}
.actress-card-name { font-size: 16px; font-weight: 700; color: #fff; margin-bottom: 6px; text-shadow: 0 1px 4px rgba(0,0,0,0.5); }
.actress-card-meta { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.actress-card-count {
  font-size: 12px; color: rgba(255,255,255,0.7); background: rgba(255,255,255,0.12);
  padding: 2px 10px; border-radius: 10px; backdrop-filter: blur(4px);
}
.actress-card-tags { display: flex; gap: 4px; flex-wrap: wrap; margin-top: 6px; }
.actress-card-tag {
  font-size: 10px; color: rgba(255,255,255,0.6); background: rgba(255,255,255,0.08);
  padding: 2px 8px; border-radius: 8px;
}

/* ===== ACTRESS PROFILE (expanded) ===== */
.actress-profile {
  display: none; padding: 24px 32px;
}
.actress-profile.active { display: block; }
.actress-profile-header {
  display: flex; align-items: center; gap: 20px; margin-bottom: 24px;
}
.actress-profile-avatar {
  width: 80px; height: 80px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 28px; font-weight: 700; color: #fff; flex-shrink: 0;
  object-fit: cover;
}
.actress-profile-info h2 { font-size: 24px; font-weight: 700; color: var(--text); margin-bottom: 4px; }
.actress-profile-info p { color: var(--text3); font-size: 14px; }
.actress-profile-back {
  background: none; border: 1px solid var(--border); color: var(--text2);
  padding: 6px 14px; border-radius: var(--radius-sm); cursor: pointer;
  font-size: 13px; font-family: inherit; margin-left: auto; transition: all 0.2s;
}
.actress-profile-back:hover { color: var(--accent); border-color: var(--accent); }
.actress-profile-videos {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 16px;
}

/* ===== CATEGORIES PAGE ===== */
.categories-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 12px; padding: 24px 32px;
}
.cat-card {
  background: var(--card); border-radius: var(--radius); padding: 16px 20px;
  cursor: pointer; transition: all 0.2s; border: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between;
}
.cat-card:hover { border-color: var(--accent); background: rgba(124,92,252,0.06); }
.cat-card.filtered { border-color: var(--accent); background: rgba(124,92,252,0.1); }
.cat-card-name { font-size: 14px; font-weight: 500; color: var(--text); }
.cat-card-count {
  font-size: 12px; color: var(--text3); background: rgba(255,255,255,0.06);
  padding: 2px 8px; border-radius: 8px;
}

/* ===== RESPONSIVE: SIDEBAR ===== */
@media (max-width: 900px) {
  .sidebar { width: 190px; }
}
@media (max-width: 700px) {
  .main-layout { flex-direction: column; }
  .sidebar {
    width: 100%; height: auto; position: relative; top: 0;
    border-right: none; border-bottom: 1px solid var(--border);
    max-height: 50vh; padding: 12px 0;
  }
}
