/* ============================================
   FamTubeX — Desktop Responsive Overrides
   All rules scoped inside @media (min-width: 1024px)
   ============================================ */

@media (min-width: 1024px) {

  /* ── 1. Bottom Nav → Left Sidebar ── */
  .bottom-nav {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    width: 220px;
    max-width: 220px;
    height: 100vh;
    flex-direction: column;
    justify-content: flex-start;
    align-items: stretch;
    padding: 0;
    padding-top: 24px;
    border-top: none;
    border-right: 1px solid rgba(255, 255, 255, 0.06);
    background: rgba(10, 10, 15, 0.95);
    backdrop-filter: blur(28px) saturate(1.6);
    -webkit-backdrop-filter: blur(28px) saturate(1.6);
    transform: none;
    z-index: 200;
    gap: 4px;
  }

  /* Logo via pseudo-element */
  .bottom-nav::before {
    content: 'FamTubeX';
    display: block;
    font-family: var(--font-display);
    font-size: 1.35rem;
    font-weight: 800;
    background: var(--accent-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    padding: 0 24px 24px;
    letter-spacing: -0.5px;
    filter: drop-shadow(0 0 12px rgba(255, 77, 141, 0.3));
  }

  /* Nav items — horizontal rows */
  .nav-item {
    flex-direction: row;
    gap: 12px;
    padding: 12px 24px;
    font-size: 0.85rem;
    font-weight: 600;
    border-radius: 0;
    justify-content: flex-start;
    color: var(--text-secondary);
    position: relative;
    transition: background 0.2s, color 0.2s;
  }

  .nav-item:hover {
    background: rgba(255, 255, 255, 0.04);
    color: var(--text-primary);
  }

  .nav-item .nav-icon {
    width: 24px;
    height: 24px;
  }

  .nav-item .nav-icon svg {
    width: 20px;
    height: 20px;
  }

  /* Active state: left accent bar instead of top bar */
  .nav-item.active::before {
    top: 0;
    bottom: 0;
    left: 0;
    right: auto;
    width: 3px;
    height: 100%;
    border-radius: 0 3px 3px 0;
    transform: none;
    box-shadow: 0 0 8px rgba(255, 77, 141, 0.4);
  }

  .nav-item.active {
    background: rgba(255, 61, 127, 0.06);
  }

  /* ── 2. App Container — shift right for sidebar ── */
  .app-container {
    max-width: none;
    margin-left: 220px;
    width: calc(100% - 220px);
  }

  /* Remove ambient glow on desktop */
  .app-container::before {
    display: none;
  }

  /* Hide pull-to-refresh on desktop */
  .ptr-indicator { display: none; }

  /* Sticky action bar not needed on desktop */
  .sticky-action-bar { display: none; }

  /* Login page orbs and background */
  .login-orb.orb-1 { width: 300px; height: 300px; }
  .login-orb.orb-2 { width: 250px; height: 250px; }
  .login-content { max-width: 420px; }

  /* ── 3. Top Bar — wider ── */
  .top-bar {
    padding: 14px 32px;
  }

  /* ── 4. Profile Grid — expand columns ── */
  .profile-grid {
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 16px;
    padding: 0 32px;
    max-width: 1400px;
  }

  /* Filter tabs — wider padding */
  .filter-tabs {
    padding: 14px 32px 8px;
  }

  /* Home greeting — wider padding */
  .home-greeting {
    padding: 0 32px 10px;
  }

  /* Page content — wider padding */
  .page-content {
    padding: 24px 32px;
    padding-bottom: 40px;
    max-width: 1400px;
  }

  /* ── 5. Filter Panel → Centered Modal ── */
  .filter-panel {
    position: fixed !important;
    width: 440px !important;
    max-width: 90vw;
    top: 50% !important;
    left: 50% !important;
    right: auto !important;
    bottom: auto !important;
    transform: translate(-50%, -50%) !important;
    border-radius: 20px !important;
    box-shadow: 0 24px 80px rgba(0, 0, 0, 0.6);
    max-height: 85vh;
    overflow-y: auto;
    z-index: 500 !important;
  }

  /* ── 6. Profile Page — Premium Two Column Layout ── */
  .sp-container {
    display: grid;
    grid-template-columns: 42% 58%;
    grid-template-rows: auto;
    max-width: 1360px;
    margin: 0 auto;
    min-height: 100vh;
    scroll-behavior: smooth;
  }

  /* Hero — Cinematic framed photo */
  .sp-hero {
    grid-row: 1 / -1;
    grid-column: 1;
    position: sticky;
    top: 0;
    height: 100vh;
    max-height: 100vh;
    aspect-ratio: auto;
    padding: 16px;
    padding-right: 0;
    background: var(--bg-primary);
  }

  .sp-hero video,
  .sp-hero img {
    border-radius: 20px 0 0 20px;
  }

  .sp-hero-gradient {
    height: 200px;
    background: linear-gradient(transparent, rgba(10, 10, 15, 0.4) 40%, rgba(10, 10, 15, 0.95));
    border-radius: 0 0 0 20px;
  }

  .sp-back-btn {
    top: 32px;
    left: 32px;
    width: 46px;
    height: 46px;
    background: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.08);
    transition: all 0.2s ease;
  }

  .sp-back-btn:hover {
    background: rgba(255, 61, 127, 0.15);
    border-color: rgba(255, 61, 127, 0.3);
    transform: scale(1.08);
  }

  .sp-status-badge {
    top: 32px;
    right: 20px;
    padding: 6px 16px;
    font-size: 0.75rem;
    letter-spacing: 0.8px;
  }

  .sp-viewer-count {
    bottom: 28px;
    right: 20px;
    padding: 6px 14px;
    font-size: 0.78rem;
    border-radius: 20px;
  }

  /* Right column — all sections */
  .sp-name-section,
  .sp-actions,
  .sp-tabs,
  #tab-profile,
  #tab-photos,
  #tab-exclusive,
  .sp-similar {
    grid-column: 2;
  }

  /* Name — prominent headline */
  .sp-name-section {
    padding: 40px 32px 8px;
  }

  .sp-name {
    font-size: 2rem;
    letter-spacing: -0.02em;
    line-height: 1.2;
  }

  .sp-name-row {
    gap: 10px;
  }

  .sp-gender-icon {
    width: 28px;
    height: 28px;
    font-size: 1.3rem;
  }

  /* Action buttons — horizontal pill style */
  .sp-actions {
    padding: 16px 32px;
    gap: 10px;
    flex-wrap: nowrap;
  }

  .sp-action-btn {
    flex-direction: row;
    gap: 8px;
    padding: 12px 20px;
    border-radius: 14px;
    font-size: 0.82rem;
    min-height: 48px;
    transition: all 0.25s ease;
  }

  .sp-action-btn svg {
    width: 18px;
    height: 18px;
    margin-bottom: 0;
  }

  .sp-action-btn span {
    font-size: 0.82rem !important;
  }

  .sp-action-btn.primary,
  .sp-action-btn.chat-btn,
  .sp-action-btn.live-btn {
    flex: 1.5;
    font-size: 0.85rem;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
  }

  .sp-action-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.4);
  }

  .sp-action-btn.primary:hover {
    box-shadow: 0 6px 24px rgba(255, 61, 127, 0.35);
  }

  .sp-action-btn.chat-btn:hover {
    box-shadow: 0 6px 24px rgba(0, 212, 170, 0.3);
  }

  .sp-action-btn.live-btn:hover {
    box-shadow: 0 6px 24px rgba(255, 23, 68, 0.35);
  }

  .sp-action-btn:not(.primary):not(.chat-btn):not(.live-btn) {
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
  }

  .sp-action-btn:not(.primary):not(.chat-btn):not(.live-btn):hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.15);
  }

  /* Tabs — spacious */
  .sp-tabs {
    padding: 0 32px;
    margin-top: 8px;
  }

  .sp-tab {
    padding: 14px 0;
    margin-right: 32px;
    font-size: 0.88rem;
    letter-spacing: 0.01em;
  }

  .sp-tab:hover:not(.active) {
    color: var(--text-secondary);
  }

  /* Bio — card style */
  .sp-bio {
    padding: 0 32px 12px;
  }

  .sp-bio-text {
    font-size: 0.9rem;
    padding: 18px 20px;
    border-radius: 16px;
    line-height: 1.7;
    border-color: rgba(255, 255, 255, 0.06);
  }

  /* Info table — contained card */
  .sp-info-section {
    padding: 0 32px 24px;
  }

  .sp-info-table {
    background: var(--bg-card);
    border-radius: 16px;
    border: 1px solid rgba(255, 255, 255, 0.05);
    overflow: hidden;
  }

  .sp-info-table td {
    padding: 15px 20px;
    font-size: 0.85rem;
  }

  .sp-info-table td:first-child {
    width: 38%;
    font-weight: 500;
  }

  .sp-info-table tr:hover {
    background: rgba(255, 255, 255, 0.02);
  }

  /* Pricing — richer cards */
  .sp-pricing {
    padding: 0 32px 28px;
  }

  .sp-pricing-title {
    font-size: 0.82rem;
    margin-bottom: 14px;
  }

  .sp-pricing-grid {
    gap: 12px;
  }

  .sp-pricing-card {
    padding: 16px 18px;
    border-radius: 14px;
    border-color: rgba(255, 255, 255, 0.06);
    transition: all 0.2s ease;
  }

  .sp-pricing-card:hover {
    border-color: rgba(255, 255, 255, 0.12);
    background: rgba(255, 255, 255, 0.02);
    transform: translateY(-1px);
  }

  .sp-pricing-icon {
    width: 42px;
    height: 42px;
    border-radius: 12px;
  }

  .sp-pricing-label {
    font-size: 0.76rem;
  }

  .sp-pricing-value {
    font-size: 0.88rem;
  }

  /* Photos — polished grid */
  .sp-photos-section {
    padding: 24px 32px;
  }

  .sp-photos-grid {
    gap: 6px;
    border-radius: 16px;
  }

  .sp-photo-item {
    transition: all 0.3s ease;
  }

  .sp-photo-item:hover {
    z-index: 2;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5);
  }

  .sp-photo-item:hover img {
    transform: scale(1.05);
  }

  /* Exclusive content — hover effects */
  .sp-exclusive-grid {
    gap: 14px;
  }

  .sp-exclusive-item {
    border-radius: 16px;
    transition: all 0.3s ease;
  }

  .sp-exclusive-item:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5);
  }

  /* Similar models — bigger cards with hover */
  .sp-similar {
    padding: 0 32px 56px;
  }

  .sp-similar-title {
    font-size: 0.85rem;
    margin-bottom: 16px;
  }

  .sp-similar-scroll {
    gap: 14px;
    scrollbar-width: thin;
    padding-bottom: 8px;
  }

  .sp-similar-scroll::-webkit-scrollbar {
    display: block;
    height: 4px;
  }

  .sp-similar-scroll::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.02);
    border-radius: 2px;
  }

  .sp-similar-scroll::-webkit-scrollbar-thumb {
    background: rgba(255, 77, 141, 0.2);
    border-radius: 2px;
  }

  .sp-similar-card {
    width: 150px;
    transition: transform 0.25s ease;
  }

  .sp-similar-card:hover {
    transform: translateY(-4px);
  }

  .sp-similar-img {
    width: 150px;
    height: 195px;
    border-radius: 14px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
    transition: box-shadow 0.25s ease;
  }

  .sp-similar-card:hover .sp-similar-img {
    box-shadow: 0 8px 28px rgba(0, 0, 0, 0.5), 0 0 16px rgba(255, 61, 127, 0.1);
  }

  .sp-similar-name {
    font-size: 0.8rem;
    margin-top: 8px;
  }

  .sp-similar-age {
    font-size: 0.72rem;
  }

  .sp-similar-status {
    padding: 3px 8px;
    font-size: 0.6rem;
    border-radius: 10px;
  }

  /* Lightbox — premium overlay */
  .sp-lightbox img {
    max-width: 85vw;
    max-height: 85vh;
    border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.8);
  }

  .sp-lightbox-close {
    top: 24px;
    right: 24px;
    width: 48px;
    height: 48px;
    font-size: 1.4rem;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.1);
    transition: all 0.2s ease;
  }

  .sp-lightbox-close:hover {
    background: rgba(255, 61, 127, 0.2);
    border-color: rgba(255, 61, 127, 0.3);
  }

  /* ── 7. Live Page — Horizontal Layout ── */
  body:has(.live-video-wrap) {
    overflow: hidden;
  }

  body:has(.live-video-wrap) > div:first-child {
    display: grid !important;
    grid-template-columns: 65% 35%;
    grid-template-rows: auto auto 1fr auto auto;
    height: 100dvh;
    overflow: hidden;
    overflow-y: auto;
  }

  .live-video-wrap {
    grid-column: 1;
    grid-row: 1 / 5;
    height: 100vh;
    max-height: 100vh;
    min-height: 100vh;
    position: sticky;
    top: 0;
  }

  .live-actions {
    grid-column: 2;
    grid-row: 1;
  }

  .live-private-row {
    grid-column: 2;
    grid-row: 2;
  }

  .live-chat-wrap {
    grid-column: 2;
    grid-row: 3;
    max-height: none;
    min-height: 0;
  }

  .live-input-bar {
    grid-column: 2;
    grid-row: 4;
  }

  .live-related-section {
    grid-column: 1 / -1;
    grid-row: 5;
    padding: 24px 32px 40px;
  }

  .live-related-grid {
    grid-template-columns: repeat(auto-fill, minmax(180px, 220px));
    gap: 16px;
  }

  .live-rel-card {
    border-radius: 16px;
    transition: transform 0.2s, box-shadow 0.2s;
    max-width: 220px;
  }

  .live-rel-card img {
    aspect-ratio: 3 / 4;
    object-fit: cover;
  }

  .live-rel-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5);
  }

  /* ── 8. Chat Page — Centered, Wider ── */
  .app-container:has(.chat-top-bar) {
    max-width: 800px;
    margin: 0 auto;
  }

  /* ── 9. Chats List Page — Sidebar offset + wider padding ── */
  .conv-item {
    padding: 14px 24px;
  }

  .chats-header {
    padding: 20px 24px 12px;
  }

  /* ── 10. Credits Page — Centered ── */
  .cr-page {
    max-width: 600px;
    margin: 0 auto;
  }

  /* Show sidebar on credits page (overrides inline display:none) */
  #cr-bottom-nav {
    display: flex !important;
  }

  .cr-page {
    margin-left: 220px;
    max-width: calc(100% - 220px);
  }

  .cr-page > .cr-scroll,
  .cr-page > .pay-step {
    max-width: 560px;
    margin: 0 auto;
  }

  .cr-footer {
    left: 220px;
  }

  /* ── 11. Wallet — Sidebar offset + centered content ── */
  .app-container:has(.balance-card) .page-content {
    max-width: 700px;
    margin: 0 auto;
  }

  /* ── 12. Account Page — Centered form ── */
  .acct-page {
    margin-left: 220px;
    width: calc(100% - 220px);
  }

  .acct-form {
    max-width: 500px;
    margin-left: auto;
    margin-right: auto;
  }

  .acct-avatar-section {
    padding-top: 40px;
  }

  .acct-credits-card {
    max-width: 500px;
    margin-left: auto;
    margin-right: auto;
  }

  .acct-logout-btn {
    max-width: 500px;
    margin-left: auto;
    margin-right: auto;
    width: 100%;
  }

  /* Account bottom nav → sidebar */
  .acct-page .bottom-nav {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    width: 220px;
    max-width: 220px;
    height: 100vh;
    flex-direction: column;
    justify-content: flex-start;
    align-items: stretch;
    padding: 0;
    padding-top: 24px;
    border-top: none;
    border-right: 1px solid rgba(255, 255, 255, 0.06);
    transform: none;
    gap: 4px;
  }

  .acct-page .bottom-nav::before {
    content: 'FamTubeX';
    display: block;
    font-family: var(--font-display);
    font-size: 1.35rem;
    font-weight: 800;
    background: var(--accent-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    padding: 0 24px 24px;
    letter-spacing: -0.5px;
    filter: drop-shadow(0 0 12px rgba(255, 77, 141, 0.3));
  }

  .acct-page .nav-item {
    flex-direction: row;
    gap: 12px;
    padding: 12px 24px;
    font-size: 0.85rem;
    font-weight: 600;
    border-radius: 0;
    justify-content: flex-start;
  }

  .acct-page .nav-item.active::before {
    top: 0;
    bottom: 0;
    left: 0;
    right: auto;
    width: 3px;
    height: 100%;
    border-radius: 0 3px 3px 0;
    transform: none;
  }

  .acct-page .nav-item.active {
    background: rgba(255, 61, 127, 0.06);
  }

  /* ── 13. Login Page — Centered, wider ── */
  .login-page {
    max-width: none;
  }

  .login-form {
    max-width: 400px;
  }

  /* Remove app-container constraints on login */
  .app-container:has(.login-page) {
    max-width: none;
    margin-left: 0;
    width: 100%;
  }

  /* ── 14. Onboarding — Centered, wider ── */
  .onboarding {
    max-width: 600px;
    margin: 0 auto;
  }

  /* ── 15. Modals & Sheets → Centered Dialogs ── */
  .sheet-backdrop {
    align-items: center;
    justify-content: center;
  }

  .sheet {
    width: auto;
    max-width: 440px;
    border-radius: 20px;
    margin: 0 auto;
    animation: desktopModalIn 0.3s ease;
  }

  @keyframes desktopModalIn {
    from { opacity: 0; transform: scale(0.95) translateY(10px); }
    to   { opacity: 1; transform: scale(1) translateY(0); }
  }

  /* Call confirmation sheet → centered modal */
  .call-sheet-backdrop {
    align-items: center;
    justify-content: center;
  }

  .call-sheet {
    width: auto;
    max-width: 440px;
    border-radius: 20px;
    animation: desktopModalIn 0.3s ease;
  }

  /* ── 16. Toast & Notification Prompt — Account for sidebar ── */
  .toast {
    left: calc(220px + (100% - 220px) / 2);
  }

  #notif-prompt {
    left: calc(220px + (100% - 220px) / 2) !important;
  }

  /* ── 17. Scrollbar — Custom dark styling ── */
  ::-webkit-scrollbar {
    width: 6px;
  }

  ::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.02);
  }

  ::-webkit-scrollbar-thumb {
    background: rgba(255, 77, 141, 0.25);
    border-radius: 3px;
  }

  ::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 77, 141, 0.4);
  }

  /* ── 18. Profile card hover effects — enhanced on desktop ── */
  .profile-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5), 0 0 20px rgba(255, 61, 127, 0.1);
  }

  /* ── 19. Bottom nav padding removal for pages with sidebar ── */
  .page-content {
    padding-bottom: 40px;
  }

  /* Pages without bottom-nav: no sidebar offset */
  .sp-container {
    margin-left: 0;
  }

  body:has(.live-video-wrap) > div:first-child {
    margin-left: 0;
  }

  .app-container:has(.chat-top-bar) {
    margin-left: 0;
  }
}

/* ── Tablet breakpoint — refine between mobile and desktop ── */
@media (min-width: 768px) and (max-width: 1023px) {
  .profile-grid {
    gap: 14px;
    padding: 0 20px;
  }

  .page-content {
    padding: 20px 24px;
  }
}
