/* ======================================================================
   SINLESS GG - GLOBAL STYLES, GLASSMORPHISM & DRAWER CONTROLS
   ====================================================================== */

body { 
    background-color: #02050b; 
    color: #f8fafc; 
    font-family: 'Plus Jakarta Sans', sans-serif; 
    scroll-behavior: smooth; 
    touch-action: manipulation; 
    overflow-x: hidden;
}

/* Custom Scrollbars */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

::-webkit-scrollbar-track {
    background: #02050b;
}

::-webkit-scrollbar-thumb {
    background: #0f1d36;
    border-radius: 9999px;
    border: 1px solid rgba(0, 243, 255, 0.2);
}

::-webkit-scrollbar-thumb:hover {
    background: #00f3ff;
}

.scrollbar-none::-webkit-scrollbar { 
    display: none; 
}

.scrollbar-none {
    -ms-overflow-style: none;
    scrollbar-width: none;
}

/* Glassmorphic Panel Styling */
.glass-panel { 
    background: rgba(11, 22, 44, 0.9); 
    backdrop-filter: blur(20px); 
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(0, 243, 255, 0.15); 
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1); 
}

.glass-panel:hover { 
    border-color: rgba(0, 243, 255, 0.3); 
    box-shadow: 0 10px 30px -10px rgba(0, 243, 255, 0.2); 
}

/* Verified Badge Glow Effect */
.verified-badge { 
    color: #f97316; 
    text-shadow: 0 0 10px rgba(249, 115, 22, 0.5); 
}

/* Media Viewers & Sticky Lightbox Frame */
#mediaViewerContainer, 
#mediaZoomModal { 
    touch-action: none !important; 
    overscroll-behavior: none !important; 
}

.sticky-media-frame {
    position: sticky;
    top: 60px;
    z-index: 40;
    background: #02050b;
    border-radius: 1rem;
    overflow: hidden;
    border: 1px solid rgba(0, 243, 255, 0.25);
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.8);
}

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

.drawer-overlay.active {
    display: block !important;
    opacity: 1;
    pointer-events: auto;
}

/* Slide-in Side Drawer */
.side-drawer {
    position: fixed;
    top: 0;
    left: -280px;
    width: 280px;
    height: 100%;
    background: #070f1e;
    border-right: 1px solid rgba(0, 243, 255, 0.2);
    z-index: 2001;
    transition: left 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    flex-direction: column;
    gap: 20px;
    padding: 24px 16px;
    box-sizing: border-box;
    box-shadow: 10px 0 30px rgba(0, 0, 0, 0.8);
    pointer-events: auto;
    /* phones: let the menu scroll so Account Settings, Sign out and the bottom links are reachable */
    height: 100dvh;
    overflow-y: auto;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
    padding-bottom: calc(24px + env(safe-area-inset-bottom));
}
.side-drawer > * { flex-shrink: 0; }

.side-drawer.active {
    left: 0;
}

.drawer-profile {
    display: flex;
    align-items: center;
    gap: 12px;
    padding-bottom: 16px;
    border-bottom: 1px solid rgba(0, 243, 255, 0.15);
}

.logo-avatar {
    width: 42px;
    height: 42px;
    border-radius: 12px;
    background: linear-gradient(135deg, #00f3ff, #ff007f);
    color: #000;
    font-weight: 800;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.9rem;
}

.drawer-menu {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.drawer-menu-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px;
    border-radius: 12px;
    color: #ffffff;
    font-weight: 700;
    font-size: 0.85rem;
    cursor: pointer;
    background: rgba(15, 29, 54, 0.6);
    border: 1px solid rgba(0, 243, 255, 0.1);
    transition: all 0.2s ease;
}

.drawer-menu-item:hover {
    background: rgba(0, 243, 255, 0.15);
    border-color: rgba(0, 243, 255, 0.4);
}

.badge {
    background: #00f3ff;
    color: #000;
    font-size: 0.75rem;
    padding: 2px 8px;
    border-radius: 10px;
    font-weight: 800;
}

/* Animations */
@keyframes fadeIn { 
    from { 
        opacity: 0; 
        transform: translateY(6px); 
    } 
    to { 
        opacity: 1; 
        transform: translateY(0); 
    } 
}

.fade-in { 
    animation: fadeIn 0.3s ease-out forwards; 
}

/* ======================================================================
   DESKTOP / PC LAYOUT (v24) — left menu, centred feed, right info rail,
   pop-up windows instead of full-screen pages. Phones are not affected.
   ====================================================================== */
#deskNav, #deskRail, #deskBackdrop { display: none; }
@media (min-width: 1024px) {
  body.sg-desk > header { display: none; }
  body.sg-desk #mainNavBar { display: none !important; }
  body.sg-desk main { max-width: 680px !important; margin-right: 0 !important; padding-top: 18px !important;
    margin-left: max(266px, calc(250px + (100vw - 250px - 680px) / 2)) !important; }
  #deskNav { display: flex; flex-direction: column; position: fixed; left: 0; top: 0; bottom: 0; width: 250px; z-index: 45;
    background: linear-gradient(180deg, #070f1e 0%, #02050b 100%); border-right: 1px solid rgba(0,243,255,.12); padding: 18px 14px 14px; overflow-y: auto; }
  #deskNav .dn-logo { display: flex; align-items: center; gap: 10px; padding: 4px 8px 18px; cursor: pointer; }
  #deskNav .dn-logo img { width: 42px; height: 42px; border-radius: 12px; box-shadow: 0 0 18px rgba(56,189,248,.25); }
  #deskNav .dn-item { display: flex; align-items: center; gap: 14px; width: 100%; padding: 8px 14px; border-radius: 13px; color: #cbd5e1;
    font-size: 14.5px; font-weight: 700; text-align: left; transition: background .15s, color .15s; position: relative; }
  #deskNav .dn-item i { width: 22px; text-align: center; font-size: 17px; color: #64748b; transition: color .15s; }
  #deskNav .dn-item:hover { background: rgba(255,255,255,.05); color: #fff; }
  #deskNav .dn-item:hover i { color: #00f3ff; }
  #deskNav .dn-item.on { background: linear-gradient(90deg, rgba(255,0,127,.22), rgba(0,243,255,.08)); color: #fff; }
  #deskNav .dn-item.on i { color: #ff007f; }
  #deskNav .dn-item.on::before { content: ''; position: absolute; left: -14px; top: 8px; bottom: 8px; width: 4px; border-radius: 0 4px 4px 0; background: #ff007f; }
  #deskNav .dn-sep { height: 1px; background: rgba(255,255,255,.07); margin: 8px 8px; flex-shrink: 0; }
  #deskNav > * { flex-shrink: 0; }
  #deskNav .dn-badge { margin-left: auto; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 10px; background: #ef4444; color: #fff; font-size: 11px; font-weight: 900; display: flex; align-items: center; justify-content: center; }
  #deskNav .dn-post { margin: 12px 4px 10px; padding: 13px; border-radius: 16px; font-weight: 900; font-size: 15px; color: #02050b;
    background: linear-gradient(90deg, #22d3ee, #ff007f); box-shadow: 0 10px 30px rgba(255,0,127,.25); transition: transform .15s; }
  #deskNav .dn-post:hover { transform: translateY(-1px) scale(1.01); }
  #deskNav .dn-me { margin-top: auto; display: flex; align-items: center; gap: 10px; padding: 10px; border-radius: 16px; cursor: pointer; }
  #deskNav .dn-me:hover { background: rgba(255,255,255,.05); }
  #deskNav .dn-me img { width: 40px; height: 40px; border-radius: 12px; object-fit: cover; }

  /* pop-up windows on PC */
  body.sg-desk .sg-desk-card { top: 3vh !important; bottom: 3vh !important; left: 50% !important; right: auto !important; height: auto !important;
    width: min(600px, 94vw) !important; transform: translateX(-50%); border-radius: 24px; border: 1px solid rgba(0,243,255,.18);
    box-shadow: 0 30px 90px rgba(0,0,0,.65); overflow: hidden; }
  body.sg-desk #userProfileModal.sg-desk-card, body.sg-desk #goLiveModal.sg-desk-card { overflow-y: auto; }
  body.sg-desk #gameModal.sg-desk-card { width: min(520px, 94vw) !important; }
  body.sg-desk #notifModal.sg-desk-card, body.sg-desk #dmModal.sg-desk-card, body.sg-desk #hlModal.sg-desk-card, body.sg-desk #postDetailModal.sg-desk-card { width: min(680px, 94vw) !important; }
  body.sg-desk #liveRoomModal.sg-desk-card { width: min(1100px, 94vw) !important; }
  body.sg-desk #adminModal.sg-desk-card { width: min(980px, 94vw) !important; }
  body.sg-desk #commentsModal { justify-content: center !important; }
  body.sg-desk #commentsModal > * { width: 100%; max-width: 640px; margin: 0 auto; border-radius: 24px; max-height: 86vh; }
  #deskBackdrop { position: fixed; inset: 0; background: rgba(2,5,11,.74); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); }
  body.sg-desk #deskBackdrop.on { display: block; }
  body.sg-desk .glass-panel:hover { border-color: rgba(0,243,255,.28); }
}
@media (min-width: 1280px) {
  body.sg-desk main { margin-left: max(266px, calc(250px + (100vw - 250px - 340px - 680px) / 2)) !important; }
  #deskRail { display: block; position: fixed; right: 0; top: 0; bottom: 0; width: 340px; z-index: 44; padding: 18px 18px 18px 6px; overflow-y: auto; }
  #deskRail .dr-card { background: rgba(7,15,30,.85); border: 1px solid rgba(0,243,255,.12); border-radius: 20px; padding: 14px; margin-bottom: 14px; }
  #deskRail .dr-title { font-size: 12px; font-weight: 900; letter-spacing: .12em; text-transform: uppercase; color: #94a3b8; margin-bottom: 10px; display: flex; justify-content: space-between; align-items: center; }
  #deskRail .dr-title button { font-size: 11px; letter-spacing: 0; text-transform: none; color: #22d3ee; font-weight: 800; }
  #deskRail .dr-row { display: flex; align-items: center; gap: 10px; width: 100%; text-align: left; padding: 8px; border-radius: 12px; transition: background .15s; }
  #deskRail .dr-row:hover { background: rgba(255,255,255,.05); }
  #deskRail .dr-foot { font-size: 11px; color: #64748b; line-height: 1.9; padding: 0 6px; }
  #deskRail .dr-foot a:hover { color: #22d3ee; }
}
