:root {
  --scroll-percent: 0;
  --scroll-y: 0px;
}

/* Base styles are mobile-first, but we adjust visibility for bottom nav */

/* Desktop view (min-width: 768px) */
@media (min-width: 768px) {
  html {
    background: #e8eaf6;
    /* Elegant outer background */
    height: 100vh;
    overflow: hidden;
  }

  /* Hide scrollbars on desktop size */
  html, body, .bottom-nav {
    -ms-overflow-style: none !important;  /* IE and Edge */
    scrollbar-width: none !important;  /* Firefox */
  }
  html::-webkit-scrollbar, body::-webkit-scrollbar, .bottom-nav::-webkit-scrollbar {
    display: none !important;  /* Chrome, Safari, Opera */
  }

  body {
    background: var(--soft-cream);
    border-radius: 30px;
    margin: 20px 20px 20px 280px;
    /* Space for the left sidebar (240px) + gap */
    height: calc(100vh - 40px);
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.05);
    position: relative;
    padding-bottom: 0;
    overflow-y: auto;
    overflow-x: hidden;
  }

  /* Hide the top navbar logo in main section on desktop */
  .navbar .logo {
    display: none !important;
  }

  /* Transform bottom nav into left sidebar (always expanded) */
  .bottom-nav {
    display: flex;
    position: fixed;
    top: 20px;
    left: 20px;
    bottom: 20px;
    width: 240px;
    /* Expanded width */
    flex-direction: column;
    justify-content: flex-start; /* Aligned to top */
    align-items: flex-start;
    background: var(--light-bg);
    border-radius: 30px !important; /* Fits main section border radius exactly */
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.05);
    overflow-x: hidden;
    overflow-y: auto;
    padding: 25px 0;
    z-index: 1000;
  }

  .bottom-nav a {
    flex-direction: row;
    width: calc(100% - 20px);
    padding: 12px 0;
    justify-content: flex-start;
    align-items: center;
    border-radius: 12px;
    margin: 5px 10px;
    overflow: hidden;
  }

  .bottom-nav a i {
    min-width: 50px;
    /* Forces icon to center perfectly in the sidebar */
    margin-bottom: 0 !important;
    text-align: center;
    font-size: 1.3rem;
  }

  .bottom-nav a:hover {
    background: rgba(246, 196, 69, 0.1);
  }

  .bottom-nav a span {
    display: inline-block;
    white-space: nowrap;
    opacity: 1 !important;
    font-weight: 600;
    font-size: 1rem;
    transform: translateX(0) !important;
  }

  /* Brand Logo text is always visible */
  .bottom-nav .sidebar-logo span.logo-txt {
    opacity: 1 !important;
    transform: translateX(0) !important;
  }

  /* Desktop menu option rendering */
  .desktop-only-option {
    display: flex !important;
  }

  .bottom-nav a.logout-option:hover {
    background: rgba(255, 107, 107, 0.1) !important;
    color: #ff6b6b !important;
  }

  /* Hide the old top desktop navbar since we have a sidebar now */
  .navbar.desktop-only {
    display: none !important;
  }

  /* Seamless Sections on Desktop */
  section {
    margin: 0 auto !important;
    /* Keep sections centered horizontally */
    max-width: 100% !important;
    /* Force sections to stretch and fit the entire right frame */
    border-radius: 0 !important;
    box-shadow: none !important;
    border-bottom: 1px solid rgba(0, 0, 0, 0.03);
    padding: 40px 30px !important;
  }

  .hero-section {
    border-radius: 30px 30px 0 0 !important;
    margin-bottom: 0 !important;
  }

  .footer-section {
    border-radius: 0 0 30px 30px !important;
    border-bottom: none !important;
    margin-bottom: 0 !important;
    padding-bottom: 40px !important;
  }
  .mobile-menu-btn, .mobile-dropdown-menu, .mobile-drawer-overlay, .mobile-right-drawer {
    display: none !important;
  }
  /* Disable AOS animations on desktop to ensure all sections are fully visible */
  [data-aos] {
    opacity: 1 !important;
    transform: none !important;
    transition: none !important;
    animation: none !important;
  }
}

.mobile-only-chains, .mobile-only-roller-system {
  display: none;
}

/* Mobile view (max-width: 767px) */
@media (max-width: 767px) {
  body {
    padding-bottom: 20px;
    /* Reduced to fix extra space since footer has margin */
  }



  .bottom-nav {
    bottom: 15px;
    left: 15px;
    width: calc(100% - 30px);
    border-radius: 25px;
    padding: 12px 0;
    /* Reduced padding */
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
  }

  .desktop-only {
    display: none !important;
  }

  /* Hide desktop-only extra options on mobile bottom nav */
  .desktop-only-option {
    display: none !important;
  }

  .nav-links {
    display: none;
    /* Hide desktop nav links */
  }

  .navbar {
    padding-bottom: 5px !important;
  }

  .hero-section h1 {
    font-size: 2rem;
  }

  section {
    margin: 0 auto 8px auto;
    padding: 20px 12px;
  }

  .hero-container {
    position: relative;
    padding: 30px 20px 40px 20px !important;
    margin: 15px !important;
    border-radius: var(--border-radius-lg) !important;
    background: linear-gradient(135deg, #fff9ef 0%, #fff0f5 50%, #fff9ef 100%) !important;
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.05) !important;
    overflow: hidden;
  }
  
  .hero-grid {
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    gap: 20px !important;
  }
  
  .hero-visual-col {
    order: 1 !important; /* Move card stack slideshow to the top */
    width: 100% !important;
    display: flex !important;
    justify-content: center !important;
  }
  
  .hero-text-col {
    order: 2 !important; /* Move CTA button below the slideshow */
    align-items: center !important;
    text-align: center !important;
    display: flex !important;
    flex-direction: column !important;
    width: 100% !important;
  }
  
  /* Hide the text copywriting elements on mobile as requested */
  .hero-badge,
  .hero-title,
  .hero-desc,
  .hero-stats {
    display: none !important;
  }
  
  .hero-ctas {
    justify-content: center !important;
    width: 100% !important;
    margin-top: 15px !important;
  }
  
  .couple-card-stack {
    width: 260px !important;
    height: 350px !important;
    margin: 10px auto 0 auto !important;
  }
  
  /* Show floating badges on mobile in a creative way */
  .floating-badge {
    display: flex !important;
    padding: 6px 10px !important;
    font-size: 0.75rem !important;
  }
  
  .badge-compatibility {
    top: 20px !important;
    left: -20px !important;
  }
  
  .badge-verified {
    bottom: 100px !important;
    right: -15px !important;
  }
  
  .badge-location {
    top: 130px !important;
    right: -20px !important;
  }

  /* Mobile menu button and dropdown menu style overrides */
  /* Premium navbar header control buttons on mobile */
  .mobile-menu-btn {
    display: flex !important;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.03) !important;
    border: 1px solid rgba(0, 0, 0, 0.04);
    font-size: 1.25rem;
    cursor: pointer;
    color: var(--dark-text);
    width: 40px;
    height: 40px;
    border-radius: 50%;
    transition: var(--transition-smooth);
    padding: 0;
  }
  
  body.dark-mode .mobile-menu-btn {
    background: rgba(255, 255, 255, 0.05) !important;
    border-color: rgba(255, 255, 255, 0.08);
  }

  .mobile-menu-btn:hover {
    background: rgba(246, 196, 69, 0.15) !important;
    color: var(--sunflower-gold);
    transform: scale(1.08);
  }

  .nav-notification-item {
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.03) !important;
    border: 1px solid rgba(0, 0, 0, 0.04);
    width: 40px;
    height: 40px;
    border-radius: 50%;
    color: var(--dark-text);
    transition: var(--transition-smooth);
  }

  body.dark-mode .nav-notification-item {
    background: rgba(255, 255, 255, 0.05) !important;
    border-color: rgba(255, 255, 255, 0.08);
  }

  .nav-notification-item:hover {
    background: rgba(255, 143, 171, 0.15) !important;
    color: var(--romantic-pink);
    transform: scale(1.08);
  }

  .nav-balance-item {
    display: flex;
    align-items: center;
    gap: 6px;
    background: rgba(246, 196, 69, 0.08) !important;
    border: 1px solid rgba(246, 196, 69, 0.2) !important;
    padding: 8px 14px !important;
    border-radius: 20px !important;
    font-weight: 700;
    font-size: 0.85rem;
    color: #b58000 !important;
    transition: var(--transition-smooth);
  }

  body.dark-mode .nav-balance-item {
    background: rgba(246, 196, 69, 0.05) !important;
    color: var(--sunflower-gold) !important;
  }

  .nav-balance-item:hover {
    background: rgba(246, 196, 69, 0.15) !important;
    transform: translateY(-1px);
    box-shadow: 0 4px 10px rgba(246, 196, 69, 0.15);
  }

  /* Drawer Overlay (Backdrop Blur) */
  .mobile-drawer-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.35);
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
    z-index: 9999;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
  }

  .mobile-drawer-overlay.active {
    opacity: 1;
    pointer-events: all;
  }

  /* Right-Side Drawer Container */
  .mobile-right-drawer {
    position: fixed;
    top: 15px;
    bottom: 15px;
    right: 15px;
    width: 280px;
    height: calc(100vh - 30px);
    background: rgba(255, 255, 255, 0.96);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    z-index: 10000;
    transform: translateX(calc(100% + 30px)); /* slide out fully considering right margin */
    transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1);
    box-shadow: -5px 5px 25px rgba(0, 0, 0, 0.08);
    display: flex;
    flex-direction: column;
    padding: 25px 20px;
    border-radius: 24px;
    border: 1px solid rgba(0, 0, 0, 0.04);
  }

  body.dark-mode .mobile-right-drawer {
    background: rgba(26, 26, 24, 0.96);
    border: 1px solid rgba(255, 255, 255, 0.06);
    box-shadow: -5px 5px 30px rgba(0, 0, 0, 0.3);
  }

  .mobile-right-drawer.active {
    transform: translateX(0);
  }

  /* Drawer Header */
  .drawer-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
    padding-bottom: 15px;
    margin-bottom: 20px;
  }

  body.dark-mode .drawer-header {
    border-color: rgba(255, 255, 255, 0.08);
  }

  .drawer-title {
    font-weight: 800;
    font-size: 1.3rem;
    color: var(--dark-text);
    letter-spacing: -0.5px;
  }

  .close-drawer-btn {
    background: rgba(0, 0, 0, 0.03);
    border: 1px solid rgba(0, 0, 0, 0.04);
    width: 36px;
    height: 36px;
    border-radius: 50%;
    font-size: 1.2rem;
    cursor: pointer;
    color: var(--dark-text);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition-smooth);
    padding: 0;
  }

  body.dark-mode .close-drawer-btn {
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(255, 255, 255, 0.08);
  }

  .close-drawer-btn:hover {
    background: rgba(255, 107, 107, 0.1);
    color: #ff6b6b;
    transform: rotate(90deg);
  }

  /* Drawer Links and Micro-interactions */
  .drawer-links {
    display: flex;
    flex-direction: column;
    gap: 8px;
    overflow-y: auto;
    flex: 1;
    padding-right: 2px;
  }

  .drawer-links::-webkit-scrollbar {
    width: 4px;
  }
  .drawer-links::-webkit-scrollbar-thumb {
    background: rgba(0, 0, 0, 0.05);
    border-radius: 10px;
  }

  .drawer-link-item {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 10px 14px;
    border-radius: 16px;
    font-weight: 700;
    font-size: 0.95rem;
    color: var(--dark-text);
    transition: var(--transition-smooth);
    border: 1px solid transparent;
    position: relative;
    overflow: hidden;
  }

  .drawer-link-item .icon-circle {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.05rem;
    color: white;
    transition: var(--transition-smooth);
  }

  /* Hover & Active effects: Slide, highlight, scale icon */
  .drawer-link-item:hover {
    padding-left: 20px;
  }

  .drawer-link-item:hover .icon-circle {
    transform: scale(1.1) rotate(8deg);
  }

  /* Colorful Icon Gradients and Hover Background Colors */
  .link-home .icon-circle {
    background: linear-gradient(135deg, #FF9800 0%, #FF5722 100%);
    box-shadow: 0 4px 10px rgba(255, 152, 0, 0.25);
  }
  .link-home:hover {
    background: rgba(255, 152, 0, 0.08);
    border-color: rgba(255, 152, 0, 0.15);
  }

  .link-news .icon-circle {
    background: linear-gradient(135deg, #3F51B5 0%, #00BCD4 100%);
    box-shadow: 0 4px 10px rgba(63, 81, 181, 0.25);
  }
  .link-news:hover {
    background: rgba(63, 81, 181, 0.08);
    border-color: rgba(63, 81, 181, 0.15);
  }

  .link-matches .icon-circle {
    background: linear-gradient(135deg, #E91E63 0%, #FF2E93 100%);
    box-shadow: 0 4px 10px rgba(233, 30, 99, 0.25);
  }
  .link-matches:hover {
    background: rgba(233, 30, 99, 0.08);
    border-color: rgba(233, 30, 99, 0.15);
  }

  .link-chat .icon-circle {
    background: linear-gradient(135deg, #9C27B0 0%, #E040FB 100%);
    box-shadow: 0 4px 10px rgba(156, 39, 176, 0.25);
  }
  .link-chat:hover {
    background: rgba(156, 39, 176, 0.08);
    border-color: rgba(156, 39, 176, 0.15);
  }

  .link-profile .icon-circle {
    background: linear-gradient(135deg, #009688 0%, #00E5FF 100%);
    box-shadow: 0 4px 10px rgba(0, 150, 136, 0.25);
  }
  .link-profile:hover {
    background: rgba(0, 150, 136, 0.08);
    border-color: rgba(0, 150, 136, 0.15);
  }

  .link-login .icon-circle {
    background: linear-gradient(135deg, #4CAF50 0%, #8BC34A 100%);
    box-shadow: 0 4px 10px rgba(76, 175, 80, 0.25);
  }
  .link-login:hover {
    background: rgba(76, 175, 80, 0.08);
    border-color: rgba(76, 175, 80, 0.15);
  }

  .link-signup .icon-circle {
    background: linear-gradient(135deg, #FF4081 0%, #FF8FAB 100%);
    box-shadow: 0 4px 10px rgba(255, 64, 129, 0.25);
  }
  .link-signup:hover {
    background: rgba(255, 64, 129, 0.08);
    border-color: rgba(255, 64, 129, 0.15);
  }

  .link-credits .icon-circle {
    background: linear-gradient(135deg, #FFC107 0%, #FF9800 100%);
    box-shadow: 0 4px 10px rgba(255, 193, 7, 0.25);
  }
  .link-credits:hover {
    background: rgba(255, 193, 7, 0.08);
    border-color: rgba(255, 193, 7, 0.15);
  }

  .link-logout .icon-circle {
    background: linear-gradient(135deg, #F44336 0%, #FF5252 100%);
    box-shadow: 0 4px 10px rgba(244, 67, 54, 0.25);
  }
  .link-logout:hover {
    background: rgba(244, 67, 54, 0.08);
    border-color: rgba(244, 67, 54, 0.15);
  }
}