/* ── Download / save protection ───────────────────────────────────────────────
   Suppresses the browser's native save affordances on all media elements.
   JS in routing-script.js closes the contextmenu and dragstart vectors;
   this CSS layer handles iOS/Android long-press and drag at the render level. */
img, video {
    -webkit-touch-callout: none; /* iOS: suppress long-press "Save Image" sheet  */
    -webkit-user-drag: none;     /* Safari: prevent drag-to-desktop              */
    user-drag: none;             /* Firefox/standard (non-prefixed)              */
}

/* ── Login error toast ─────────────────────────────────────────────────────────
   Shown when Discord OAuth redirects back with ?loginError=... in the URL.
   Slides in from the top, auto-dismisses after 10 s, then slides back out. */
#loginErrorToast {
    position: fixed;
    top: 1.5rem;
    left: 50%;
    transform: translateX(-50%) translateY(-160%);
    z-index: 9999;
    min-width: 320px;
    max-width: 90vw;
    background: rgba(18, 8, 8, 0.96);
    border: 1px solid rgba(220, 60, 60, 0.55);
    border-radius: 12px;
    padding: 1rem 1.5rem;
    color: #fff;
    text-align: center;
    backdrop-filter: blur(12px);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.6);
    transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
    pointer-events: none;
}
#loginErrorToast.visible {
    transform: translateX(-50%) translateY(0);
}
#loginErrorToast .toast-title {
    font-size: 1.05rem;
    font-weight: 700;
    color: #ff6b6b;
    margin-bottom: 0.35rem;
}
#loginErrorToast .toast-body {
    font-size: 0.88rem;
    color: #ccc;
    line-height: 1.5;
}
#loginErrorToast .toast-timer {
    height: 3px;
    background: rgba(220, 60, 60, 0.25);
    border-radius: 2px;
    margin-top: 0.8rem;
    overflow: hidden;
}
#loginErrorToast .toast-timer-bar {
    height: 100%;
    width: 100%;
    background: #ff6b6b;
}

/* ── Download button spinner ───────────────────────────────────────────────────
   Shown while fetch() is pulling the file from the server.
   The spinner element is injected by JS and removed on completion. */
@keyframes dl-spin {
    to { transform: rotate(360deg); }
}
.dl-spinner {
    display: inline-block;
    width:  1em;
    height: 1em;
    border: 2px solid rgba(255, 255, 255, 0.25);
    border-top-color: #ffffff;
    border-radius: 50%;
    animation: dl-spin 0.65s linear infinite;
    vertical-align: middle;
}

/* CSS Variables */
:root {
    --bg-primary: #050507;
    --bg-secondary: #0a0a0f;
    --bg-card: #12121a;
    --bg-card-hover: #1a1a24;
    --primary: #4A6DED;
    --secondary: #FF6B35;
    --accent: #ff8c5a;
    --success: #2be275;
    --text-primary: #ffffff;
    --text-secondary: #b8b8c8;
    --text-muted: #7a7a8e;
    --border: #2a2a3e;
    --glow-primary: rgba(74, 109, 237, 0.4);
    --glow-secondary: rgba(255, 107, 53, 0.4);
    --gradient-primary: linear-gradient(135deg, var(--primary), var(--secondary));
    --gradient-dark: linear-gradient(180deg, #050507 0%, #0a0a0f 50%, #050507 100%);
}

/* Reset & Base */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

html, body { 
    height: 100%; 
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: var(--gradient-dark);
    color: var(--text-primary);
    min-height: 100vh;
    min-width: 320px;
    overflow-x: clip; /* clip (unlike hidden) never creates a fixed-position containing block */
    position: relative;
    line-height: 1.6;
    word-wrap: break-word;
}

ol, ul {
    list-style: none;
}

hr {
    border: 0;
    padding: 0;
    position: relative;
    width: 7rem;
    margin: 2rem auto;
    border-top: solid 2px var(--border);
}

/* Animated Background */
.background-animation {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    overflow: hidden;
}

.floating-orb {
    position: absolute;
    border-radius: 50%;
    opacity: 0.03;
    animation: float 20s ease-in-out infinite;
}

.floating-orb:nth-child(1) {
    width: 600px;
    height: 600px;
    background: radial-gradient(circle, var(--primary), transparent);
    top: -300px;
    right: -200px;
    animation-duration: 25s;
}

.floating-orb:nth-child(2) {
    width: 500px;
    height: 500px;
    background: radial-gradient(circle, var(--secondary), transparent);
    bottom: -250px;
    left: -150px;
    animation-duration: 30s;
}

.floating-orb:nth-child(3) {
    width: 400px;
    height: 400px;
    background: radial-gradient(circle, var(--accent), transparent);
    top: 50%;
    right: 20%;
    animation-duration: 35s;
}

/* ---------------------------------- Main Section ---------------------------------- */
.mainSection {
    margin: 2rem auto;
    padding: 0 2rem;
    animation: fadeInUp 0.8s ease;
}

/* Header */
.header {
    position: sticky;
    top: 0;
    z-index: 100;
    background: rgba(18, 18, 26, 0.85);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    padding: 1rem 2rem;
    animation: fadeInDown 0.8s ease;
}

.header-content {
    max-width: 1400px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.headerImageContainer {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.headerLogo {
    height: 60px;
    width: auto;
    object-fit: contain;
}

/* Navigation */
.headerButtons {
    display: flex;
    gap: 0.5rem;
}

.navBarButton {
    position: relative;
    padding: 0.75rem 1.5rem;
    color: var(--text-secondary);
    text-decoration: none;
    font-weight: 500;
    border-radius: 12px;
    transition: all 0.3s ease;
    overflow: hidden;
    cursor: pointer;
}

.navBarButton::before {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    width: 0;
    height: 2px;
    background: var(--gradient-primary);
    transform: translateX(-50%);
    transition: width 0.3s ease;
}

.navBarButton:hover {
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.05);
}

.navBarButton:hover::before {
    width: 80%;
}

.navBarButton.active {
    background: rgba(74, 109, 237, 0.15);
    color: var(--primary);
}


/* Mobile Menu Classes */
.menuCollapseIcons {
  display: none;
}

/* Gallery Sidebar */
.gallerySidebar {
  position: absolute;
  max-width: 360px;
  top: 120px;
  left: 0px;
  width: 100%;
  background: rgba(18, 18, 26, 0.98);
  backdrop-filter: blur(20px);
  border-right: 1px solid rgba(255, 255, 255, 0.08);
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  overflow-y: auto;
  height: 80vh;
  z-index: 90;
  box-shadow: 4px 0 24px rgba(0, 0, 0, 0.3);
}

/* Custom Scrollbar for Sidebar */
.gallerySidebar::-webkit-scrollbar {
  width: 8px;
}

.gallerySidebar::-webkit-scrollbar-track {
  background: rgba(42, 42, 62, 0.3);
}

.gallerySidebar::-webkit-scrollbar-thumb {
  background: rgba(74, 109, 237, 0.4);
  border-radius: 4px;
}

.gallerySidebar::-webkit-scrollbar-thumb:hover {
  background: rgba(74, 109, 237, 0.6);
}

/* Sidebar Header */
.gallerySidebar .gallerySidebarHeader {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1.2;
  padding: 2rem 1.5rem;
  text-align: center;
  background: linear-gradient(180deg, rgba(74, 109, 237, 0.15) 0%, rgba(18, 18, 26, 0) 100%);
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  user-select: none;
  letter-spacing: -0.5px;
}

/* Gallery Tab Buttons */
.gallerySidebar .galleryTab {
  display: block;
  padding: 1rem 1.5rem;
  text-decoration: none;
  font-size: 1rem;
  font-weight: 500;
  color: var(--text-secondary);
  box-sizing: border-box;
  border-bottom: 1px solid rgba(255, 255, 255, 0.03);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  cursor: pointer;
  position: relative;
  overflow: hidden;
}

/* Hover Effect for Gallery Tabs */
.gallerySidebar .galleryTab::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  width: 3px;
  height: 100%;
  background: var(--gradient-primary);
  transform: scaleY(0);
  transition: transform 0.3s ease;
}

.gallerySidebar .galleryTab:hover {
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.05);
  padding-left: 1.75rem;
}

.gallerySidebar .galleryTab:hover::before {
  transform: scaleY(1);
}

/* Active Gallery Tab */
.gallerySidebar .galleryTab.active {
  background: rgba(74, 109, 237, 0.15);
  color: var(--primary);
  font-weight: 600;
  padding-left: 1.75rem;
  border-left: 3px solid var(--primary);
}

.gallerySidebar .galleryTab.active::before {
  transform: scaleY(1);
}

/* Gallery Tab Categories */
.gallerySidebar .galleryTabCategory {
  display: block;
  padding: 1rem 1.5rem;
  text-decoration: none;
  text-align: center;
  font-size: 1rem;
  font-weight: 500;
  color: white;
  box-sizing: border-box;
  border-bottom: 1px solid rgba(255, 255, 255, 1);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  overflow: hidden;
}

/* Page Classes */
.page {
    background: rgba(18, 18, 26, 0.6);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 20px;
    padding: 3rem;
    margin-top: 2rem;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

.page-pretitle {
    margin-bottom: 1rem;
    margin-top: 1rem;
    text-align: center;
    text-transform: uppercase;
    color: var(--text-muted);
    letter-spacing: 0.25rem;
    font-size: 0.875rem;
    line-height: 1.125;
    font-weight: 700;
}

.page-title {
    font-size: 2.5rem;
    font-weight: 800;
    margin-bottom: 1rem;
    color: #4A6DED;
    text-align: center;
    line-height: 1.125;
}

.page-text {
    color: var(--text-secondary);
    line-height: 1.8;
    text-align: center;
    max-width: 800px;
    margin: 0 auto 2rem;
    font-weight: 400;
}

/* Nav Buttons — centered button row, stacks vertically and stays centered on mobile */
.nav-buttons {
    display: flex;
    flex-direction: row;
    justify-content: center;
    align-items: center;
    gap: 1rem;
    padding: 2rem 0;
    flex-wrap: wrap;
}

/* Slide Content — flex row layout for partnership/feature slides */
.slide-content {
    display: flex;
    flex-direction: row;
    justify-content: center;
    align-items: center;
    gap: 2rem;
    max-width: 1600px;
    margin: 0 auto;
}

.slide-content > div {
    flex: 1 1 0;
    min-width: 0;
    max-width: 800px;
}

/* Margin utility for spacing page-text after a button */
.mt-lg {
    margin-top: 2rem;
}

/* Persistent layout IDs */
#tab-content {
    min-height: 90vh;
}

#tierMarker {
    font-weight: bold;
}

#gallerySidebarTabs {
    margin-bottom: 10rem;
}

/* Buttons */
.button {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    padding: 1rem 1rem;
    background: #4A6DED; /* Modern blue, no gradient */
    color: white;
    border: none;
    border-radius: 12px;
    font-weight: 600;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    box-shadow: 0 5px 20px rgba(74, 109, 237, 0.3);
    width: fit-content;
    margin: 0 auto;
}

.buttonBottom {
  margin-bottom: 2rem;
}

.button:hover {
    transform: translateY(-2px);
    background: #5a7df0; /* Slightly lighter blue on hover */
    box-shadow: 0 8px 30px rgba(74, 109, 237, 0.4);
}

/* Inside flex rows, let the container handle alignment instead of auto-margin */
.nav-buttons .button {
    margin: 0;
}

/* Footer */
footer {
    margin-top: 4rem;
    padding: 3rem 2rem;
    background: rgba(18, 18, 26, 0.8);
    border-top: 1px solid rgba(255, 255, 255, 0.05);
}

footer section {
    max-width: 1400px;
    margin: 0 auto;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 3rem;
    flex-wrap: wrap;
}

footer h3 {
    color: var(--text-muted);
    font-size: 0.875rem;
    text-transform: uppercase;
    letter-spacing: 2px;
    margin-bottom: 0.5rem;
}

footer a {
    color: var(--text-secondary);
    text-decoration: none;
    transition: color 0.3s ease;
    margin: 0 1rem;
}

footer a:hover {
    color: var(--primary);
}

footer div {
    text-align: center;
    color: var(--text-muted);
    margin-top: 2rem;
    padding-top: 2rem;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
}

footer img {
    margin-top: 10px;
    height: 20px;
    text-align: center;
}

.largeImageStyle {
  display: block;
  margin: 0 auto;
  width: 100%;
  max-width: 600px;
  border-radius: 16px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
  background: var(--bg-card);
  border: 1px solid rgba(255, 255, 255, 0.05);
}

/* Anchor wrapper for centered linked images */
.centered-image-link {
  display: block;
  width: fit-content;
  margin: 0 auto 3.5rem auto;
}

/* Loading Animation */
.loading {
    display: block;
    width: 50px;
    height: 50px;
    border: 3px solid rgba(74, 109, 237, 0.1);
    border-radius: 50%;
    border-top-color: var(--primary);
    animation: spin 1s ease-in-out infinite;
}

/* Animations */
@keyframes float {
    0%, 100% { transform: translate(0, 0) rotate(0deg) scale(1); }
    25% { transform: translate(-60px, 100px) rotate(90deg) scale(1.1); }
    50% { transform: translate(60px, -60px) rotate(180deg) scale(0.95); }
    75% { transform: translate(-30px, -100px) rotate(270deg) scale(1.05); }
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Responsive Design */
@media (max-width: 1024px) {
    .header-content {
        gap: 1rem;
    }
}

@media (max-width: 768px) {
    .header-content {
        flex-direction: column;
        gap: 1rem;
    }

    .headerButtons {
        flex-wrap: wrap;
        justify-content: center;
    }

    .page-title {
        font-size: 2rem;
    }

    footer section {
        flex-direction: column;
        gap: 1rem;
    }

    .slide-content {
        flex-direction: column;
    }

    .slide-content > div {
        max-width: 100%;
        width: 100%;
    }
}

@media (max-width: 480px) {
    .nav-buttons {
        flex-direction: column;
        align-items: center;
    }

    .headerButtons {
        display: none;
    }

    .menuCollapseIcons {
        display: flex;
        gap: 0.5rem;
    }

    .navBarButton {
        padding: 0.5rem;
        font-size: 0.9rem;
    }

    .page {
        padding: 1rem;
    }

    .gallerySidebar {
        top: 165px;
        max-width: 480px;
        height: 80vh;
    }
}