/* 
=================================================
  RESPONSIVE DESKTOP & TABLET STYLES
  Moved from index/style to keep file structure clean
=================================================
*/

/* Structural elements should snap instantly in ALL directions (desktop->mobile and mobile->desktop) */
#av-wrapper, .bottom-bar, .bottom-bar *, .nav-left-controls {
  transition: none !important;
}

/* Hide the Create text on Mobile & Tablet */
#bottomCreateBtn .bottom-bar-label {
  display: none !important;
}

@media (min-width: 768px) {
  :root {
    --sidebar-width: 80px;
    --bottom-bar-h: 0px; /* Disable bottom bar height var on desktop */
  }

  /* Center video feed vertically and horizontally between sidebar and right edge */
  #av-wrapper {
    top: 50% !important;
    bottom: auto !important;
    left: calc(var(--sidebar-width) + (100vw - var(--sidebar-width)) / 2) !important;
    transform: translate(-50%, -50%) !important;
    margin: 0 !important;
    border-radius: 12px !important;
    overflow: hidden !important;
  }

  /* Protect sidebar from full-screen overlays (like template viewer) */
  #template-av-area {
    left: var(--sidebar-width) !important;
    width: calc(100% - var(--sidebar-width)) !important;
  }

  /* ============================================================
     TABLET SIDEBAR: 3 Partitions (Top: Logo, Mid: Icons, End: Empty)
     ============================================================ */
  .bottom-bar {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    bottom: 0 !important;
    right: auto !important;
    width: var(--sidebar-width) !important;
    height: 100vh !important;
    display: flex !important;
    flex-direction: column !important;
    justify-content: space-between !important;
    align-items: center !important;
    padding: 24px 0 !important;
    border-top: none !important;
    border-right: 1px solid rgba(255, 255, 255, 0.1) !important;
    background: #100c0c !important;
    z-index: 100 !important;
    box-sizing: border-box !important;
  }

  /* 1. TOP PARTITION: Smile Logo Icon */
  .bottom-bar-top {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    width: 100% !important;
    cursor: pointer !important;
    padding: 0 !important;
    background: none !important;
  }

  #floating-desktop-logo {
    width: 32px !important;
    height: 32px !important;
    object-fit: contain !important;
    border-radius: 50% !important;
    display: block !important;
    transition: transform 0.15s ease !important;
  }

  .bottom-bar-top:hover #floating-desktop-logo {
    transform: scale(1.06) !important;
  }
  
  #floating-desktop-logo-text {
    display: none !important;
  }

  /* 2. MID PARTITION: Bottom Bar Navigation Icons (Spacious, airy & centered) */
  .bottom-bar-mid {
    flex: 1 !important;
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    justify-content: center !important;
    gap: clamp(38px, 5.5vh, 50px) !important;
    width: 100% !important;
    height: auto !important;
  }

  .bottom-bar button,
  .bottom-bar .bottom-nav-btn {
    flex: 0 0 auto !important;
    width: auto !important;
    height: auto !important;
    padding: 0 !important;
    margin: 0 !important;
    background: none !important;
    border: none !important;
    border-radius: 0 !important;
    box-shadow: none !important;
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    justify-content: center !important;
    cursor: pointer !important;
    transition: transform 0.15s ease, opacity 0.15s ease !important;
  }

  .bottom-bar button:hover,
  .bottom-bar .bottom-nav-btn:hover {
    background: none !important;
    transform: scale(1.06) !important;
  }

  .bottom-bar button.active,
  .bottom-bar .bottom-nav-btn.active {
    background: none !important;
  }

  /* Hide text labels on tablet view (icons only) */
  .bottom-bar button .bottom-bar-label {
    display: none !important;
  }

  /* Icon sizes for tablet */
  .bottom-bar button img {
    width: 28px !important;
    height: 28px !important;
  }

  .bottom-bar button img[src*="add"],
  .bottom-bar button[data-tab="create"] img,
  .bottom-bar button#bottomCreateBtn img {
    width: 44px !important;
    height: 44px !important;
  }

  /* 3. END PARTITION: Empty for now (Instagram/TikTok style) */
  .bottom-bar-end {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    width: 100% !important;
    min-height: 32px !important;
  }
  
  /* Reset nav-controls to not overlap sidebar */
  .nav-left-controls {
    left: calc(var(--sidebar-width) + 3%) !important;
  }
}

/* =================================================
   LARGE DESKTOP (Wide Sidebar with Text on Right)
================================================= */
@media (min-width: 1024px) {
  :root {
    --sidebar-width: 240px; /* Wider sidebar for desktop */
  }

  .bottom-bar {
    align-items: stretch !important;
    padding: 32px 24px 24px 24px !important;
    box-sizing: border-box !important;
  }

  /* 1. TOP PARTITION: Smile Logo + Text (Clean, no background box) */
  .bottom-bar-top {
    display: flex !important;
    align-items: center !important;
    justify-content: flex-start !important;
    gap: 14px !important;
    padding: 0 !important;
    margin: 0 !important;
    background: none !important;
    border-radius: 0 !important;
    cursor: pointer !important;
    transition: opacity 0.15s ease !important;
  }

  .bottom-bar-top:hover {
    opacity: 0.85 !important;
    background: none !important;
  }

  #floating-desktop-logo {
    width: 32px !important;
    height: 32px !important;
  }

  #floating-desktop-logo-text {
    display: block !important;
    font-size: 22px !important;
    font-weight: 700 !important;
    color: #fff !important;
    font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif !important;
    letter-spacing: -0.5px !important;
  }

  /* 2. MID PARTITION: Generous vertical gap so 5 items feel filled, open and balanced */
  .bottom-bar-mid {
    flex: 1 !important;
    display: flex !important;
    flex-direction: column !important;
    align-items: flex-start !important;
    justify-content: center !important;
    gap: clamp(42px, 6vh, 56px) !important; /* Generous airy gap to keep sidebar balanced & filled */
    width: 100% !important;
  }

  .bottom-bar button,
  .bottom-bar .bottom-nav-btn {
    display: flex !important;
    align-items: center !important;
    flex-direction: row !important;
    justify-content: flex-start !important;
    gap: 20px !important;
    width: auto !important;
    height: auto !important;
    padding: 0 !important;
    margin: 0 !important;
    background: none !important;
    border: none !important;
    border-radius: 0 !important;
    box-shadow: none !important;
    cursor: pointer !important;
    transition: opacity 0.15s ease !important;
  }

  .bottom-bar button:hover,
  .bottom-bar .bottom-nav-btn:hover {
    background: none !important;
    opacity: 0.8 !important;
  }

  .bottom-bar button.active,
  .bottom-bar .bottom-nav-btn.active {
    background: none !important;
  }

  /* Consistent icon sizes on desktop (exact 28px match with tablet) */
  .bottom-bar button img,
  .bottom-bar button img[src*="add"],
  .bottom-bar button[data-tab="create"] img,
  .bottom-bar button#bottomCreateBtn img {
    width: 28px !important;
    height: 28px !important;
    object-fit: contain !important;
  }

  /* Consistent text label styling on desktop */
  .bottom-bar button .bottom-bar-label,
  #bottomCreateBtn .bottom-bar-label,
  .bottom-bar button[data-tab="create"] .bottom-bar-label {
    display: block !important;
    margin: 0 !important;
    font-size: 16px !important;
    font-weight: 500 !important;
    color: #ffffff !important;
    opacity: 0.85 !important;
    line-height: 1 !important;
  }

  .bottom-bar button.active .bottom-bar-label,
  .bottom-bar .bottom-nav-btn.active .bottom-bar-label,
  .bottom-bar button.active#bottomCreateBtn .bottom-bar-label {
    opacity: 1 !important;
    font-weight: 600 !important;
  }

  /* 3. END PARTITION: Empty for now (Instagram/TikTok style) */
  .bottom-bar-end {
    display: flex !important;
    align-items: center !important;
    width: 100% !important;
    min-height: 32px !important;
    padding: 0 !important;
    box-sizing: border-box !important;
  }
}

/* Hide desktop arrows globally (mobile/tablet default) */
.desktop-nav-arrows {
  display: none !important;
}

/* =================================================
   LARGE DESKTOP ARROWS
================================================= */
@media (min-width: 1024px) {
  .desktop-nav-arrows {
    display: flex !important;
    flex-direction: column !important;
    position: fixed !important;
    right: 48px !important;
    top: 50% !important;
    transform: translateY(-50%) !important;
    gap: 16px !important;
    z-index: 1000 !important;
  }
  .desktop-nav-arrows .nav-arrow {
    width: 32px !important;
    height: 32px !important;
    border-radius: 50% !important;
    background: rgba(255, 255, 255, 0.25) !important;
    border: none !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    cursor: pointer !important;
    backdrop-filter: blur(8px) !important;
    -webkit-backdrop-filter: blur(8px) !important;
    transition: background 0.2s !important;
    padding: 0 !important;
    margin: 0 !important;
    outline: none !important;
  }
  .desktop-nav-arrows .nav-arrow:hover {
    background: rgba(255, 255, 255, 0.4) !important;
  }
  .desktop-nav-arrows .nav-arrow img {
    width: 16px !important;
    height: 16px !important;
    object-fit: contain !important;
    filter: invert(1) !important;
  }
  #nav-arrow-prev img {
    transform: rotate(180deg) !important;
  }
}
