/* Base Styles */
:root {
    --primary-color: #2563eb;
    --background: #f8fafc;
    --text-color: #e6e6e6;
    --container-max-width: 1200px;
}

/* Theme variables (derived from reference image) */
:root {
    --color-text: #e6f3f7;
    --neon-primary: #16e0ff;               /* cyan */
    --neon-primary-rgb: 22,224,255;
    --neon-secondary: #ff2ea6;             /* pink/magenta */
    --neon-secondary-rgb: 255,46,166;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, 'Noto Sans', 'Liberation Sans', sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji';
    font-size: 18px;
    line-height: 1.6;
    color: var(--text-color);
    background-color: var(--background);
    background-image: linear-gradient(rgba(0,0,0,0.45), rgba(0,0,0,0.45)), url('assets/body-bg.jpeg');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    background-attachment: fixed;
    min-height: 100vh;            /* enable sticky footer layout */
    display: flex;               /* flex column layout for page */
    flex-direction: column;
}

/* Loading overlay */
#loading-overlay {
    position: fixed;
    inset: 0;
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0,0,0,0.8);
    opacity: 1;
    transition: opacity 600ms ease;
}
#loading-overlay.fade-out {
    opacity: 0;
    pointer-events: none;
}
#loading-overlay .loading-content {
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    width: 220px;
    height: 220px;
}
#loading-overlay .loading-logo,
#loading-overlay .spinner {
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
}
#loading-overlay .loading-logo {
    width: 200px;
    height: 200px;
    object-fit: contain;
    z-index: 2;
    animation: loadingPulse 1.0s ease-in-out infinite alternate;
}
#loading-overlay .spinner {
    width: 72px;
    height: 72px;
    border: 6px solid rgba(255,255,255,0.35);
    border-top-color: #fff;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    z-index: 1;
}
@keyframes spin {
    to { transform: rotate(360deg); }
}
@keyframes loadingPulse {
    0% { transform: translate(-50%, -50%) scale(0.92); }
    100% { transform: translate(-50%, -50%) scale(1.06); }
}

@media (prefers-reduced-motion: reduce) {
  #loading-overlay .loading-logo { animation: none; }
}

/* Container */
.container {
    width: 100%;
    max-width: var(--container-max-width);
    margin: 0 auto;
    padding: 0 1rem;
}
/* Header */
.site-header {
    background-color: transparent;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    padding: 20px;
    position: sticky;
    top: 0;
    z-index: 100;
    display: flex;
    flex-direction: column;
    gap: 0; /* no vertical spacing between header rows */
    color: inherit; /* inherit global text color */
}

/* Avoid header horizontal overflow when using margins on header containers */
.site-header .container {
    width: 100%;
    max-width: var(--container-max-width);
    margin: 0 auto;
    padding: 0 10px;
    box-sizing: border-box;
}

/* Make main's container align and expand like header/footer, without extra side padding */
.main-content .container {
    width: 100%;
    max-width: var(--container-max-width);
    margin: 0 auto;
    padding: 0;
    box-sizing: border-box;
}

  /* Header inner: mirror footer container */
  #header-inner {
    background: rgba(255,255,255,0.05);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    width: 100%;
    max-width: var(--container-max-width);
    margin: 0 auto;
    padding: 0;
    border-radius: 25px;
    overflow: visible; /* allow children (logo) to overflow visually */
  }
  #header-inner > * {
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
  }
  #header-logo { overflow: visible; position: relative; }
  .site-header .logo {
    width: 100px;
    height: 100px;
    display: block;
    object-fit: contain;
    position: relative; /* stack above container chrome */
    z-index: 2;
  }
#header-inner > #header-logo { justify-content: flex-start; }
#header-inner > #header-nav { justify-content: center; }
#header-inner > #header-action { justify-content: flex-end; }

/* Desktop: make three header blocks act as columns to push logo left and action right */
@media (min-width: 641px) {
  #header-inner > #header-logo,
  #header-inner > #header-nav,
  #header-inner > #header-action {
    flex: 1 1 0;
  }
}

@media (prefers-reduced-motion: reduce) {
  #loading-overlay .loading-logo { animation: none; }
}

/* Sign-in button: simple, no glow */
.btn-signin {
    color: inherit;
    font-size: 18px;
    font-weight: 400;
    height: 48px;
    width: 75px;
    padding: 0;
    margin: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    box-sizing: border-box;
    text-align: center;
    border: none;
    border-radius: 12px;
    background: transparent;
    cursor: pointer;
}

/* Mobile header: stack blocks vertically */
  @media (max-width: 640px) {
    #header-inner {
      flex-direction: column;
      align-items: stretch;
      gap: 8px;
    }
    #header-inner > * {
      width: 100%;
      justify-content: center;
      text-align: center;
    }
    .site-header .logo { width: 100px; height: 100px; }
    .site-header #header-inner > #header-logo,
    .site-header #header-inner > #header-nav,
    .site-header #header-inner > #header-action {
      justify-content: center !important;
      text-align: center;
    }
  }
 
 /* Simple navigation list */
 .site-header .nav-list {
    list-style: none;
    display: flex;
    justify-content: center;
    gap: 10px;
    padding: 0;
    margin: 0;
}
.site-header .nav-list li { display: flex; }
.site-header .nav-list a {
    text-decoration: none;
    color: inherit;
    font-size: 18px;
    font-weight: 400;
    text-transform: none;
    letter-spacing: 0.02em;
    height: 48px;           /* consistent button height */
    padding: 0 10px;        /* add 10px left/right padding */
    margin: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 75px;            /* static width incl. padding (box-sizing: border-box) */
    box-sizing: border-box;
    text-align: center;
    border: none; /* remove per-button default border */
    border-radius: 12px;
}

/* Active (toggled) nav button: magenta neon pulsating border */
.site-header .nav-list a.active {
    border: 2px solid rgba(var(--neon-secondary-rgb), 0.5);
    border-radius: 25px; /* match container radius as requested */
    background: rgba(255,255,255,0.22); /* more whitish, less transparent */
    box-shadow:
      0 0 8px rgba(var(--neon-secondary-rgb), 0.80),
      0 0 16px rgba(var(--neon-secondary-rgb), 0.60),
      inset 0 0 6px rgba(var(--neon-secondary-rgb), 0.45);
    animation: neonBorderPulse 1.2s ease-in-out infinite alternate;
}

@keyframes neonBorderPulse {
  0% {
    box-shadow:
      0 0 6px rgba(var(--neon-secondary-rgb), 0.65),
      0 0 12px rgba(var(--neon-secondary-rgb), 0.50),
      inset 0 0 4px rgba(var(--neon-secondary-rgb), 0.35);
  }
  100% {
    box-shadow:
      0 0 10px rgba(var(--neon-secondary-rgb), 0.95),
      0 0 22px rgba(var(--neon-secondary-rgb), 0.80),
      inset 0 0 10px rgba(var(--neon-secondary-rgb), 0.55);
  }
}

/* Unified nav neon color via --neon / --neon-rgb */

/* Removed glow, hover effects, and background from nav buttons */

/* Toggled (active) nav button: whitish transparent background on top of magenta glow */
/* (removed) No extra background for active; keep magenta glow only */

  /* Reduce motion for accessibility */
  @media (prefers-reduced-motion: reduce) {
    .site-header .nav-list a { transition: none; }
  }

/* Main Content */
.main-content {
    flex: 1;                    /* take remaining space so footer sits at bottom */
    padding: 20px;
}

/* Main container: match translucent container styling */
#main-container {
    width: 100%;
    max-width: var(--container-max-width);
    margin: 0 auto;
    padding: 0;
}

/* Main container and sections */
.main-container section {
    display: none;
    background: rgba(255,255,255,0.05);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border-radius: 25px;
    padding: 20px;
}
.main-container section.active {
    display: block;
}

/* Tools: move background from section to its child items only */
#tools {
  background: none;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  border-radius: 0;
  padding: 0;
}
#tools .tools-sections {
  display: grid;
  gap: 20px;
  grid-template-columns: 1fr;
  align-items: stretch;
}
#tools .tools-item {
  background: rgba(255,255,255,0.05);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border-radius: 25px;
  padding: 20px;
  border: 1px solid rgba(255,255,255,0.08);
  box-shadow: 0 4px 14px rgba(0,0,0,0.25);
  transition: transform 200ms ease, box-shadow 200ms ease, border-color 200ms ease;
  position: relative;
  overflow: hidden;
  display: flex;
  flex-wrap: wrap;           /* allow description to wrap to next row */
  align-items: center;
  gap: 0;                    /* no row gap; we control vertical spacing via margin */
  column-gap: 8px;           /* keep horizontal space between title and icons */
}

#tools .tools-item.focused {
  transform: translateY(-3px);
  box-shadow: 0 10px 24px rgba(0,0,0,0.35), 0 0 18px rgba(var(--neon-secondary-rgb), 0.25);
  border-color: rgba(var(--neon-secondary-rgb), 0.45);
}

#tools .tools-item h2 {
  margin: 0;
  font-size: 1.25rem;
  line-height: 1.3;
}

/* Title on the left, logos on the right */
#tools .tools-item-title {
  display: flex;
  align-items: center;
  margin-right: auto;       /* push tool-links to the right */
}

#tools .tool-links {
  display: flex;
  align-items: center;
  gap: 12px;
}
#tools .tools-item .tool-links { margin-left: 0; }

/* Description spans full width below title+links row */
#tools .tools-item-description {
  flex-basis: 100%;         /* force onto its own row */
  max-height: 0;            /* collapsed by default */
  opacity: 0;
  overflow: hidden;
  margin-top: 0;
  transition: max-height 200ms ease, opacity 200ms ease, margin-top 200ms ease;
}

/* Expanded state: reveal description */
#tools .tools-item.expanded .tools-item-description {
  max-height: 200px;        /* large enough to show content */
  opacity: 1;
  margin-top: 4px;
}
#tools .tool-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 50px;
  height: 50px;
  line-height: 0;
  color: #ffffff;
}
#tools .tool-link svg {
  width: 50px;
  height: 50px;
  fill: currentColor;
  display: block;
}
#tools .tool-link[aria-label="GitHub"] svg path,
#tools .tool-link[aria-label="Google Play"] svg path,
#tools .tool-link[aria-label="Apple App Store"] svg path {
  transform-box: fill-box;
  transform-origin: center;
}

/* Approximate 40x40 visible glyphs in a 50x50 box */
#tools .tool-link[aria-label="GitHub"] svg path {
  transform: scale(0.87);
}

#tools .tool-link[aria-label="Google Play"] svg { overflow: visible; }
#tools .tool-link[aria-label="Google Play"] svg path {
  transform: scale(0.87);
}

#tools .tool-link[aria-label="Apple App Store"] svg { overflow: visible; }
#tools .tool-link[aria-label="Apple App Store"] svg path {
  transform: scale(1.09);
}

/* Home: move background from section to its child blocks */
#home {
  background: none;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  border-radius: 0;
  padding: 0;
}
#home .home-title {
  background: rgba(255,255,255,0.05);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border-radius: 25px;
  padding: 20px;
}
#home .home-logo {
  background: none;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  border-radius: 0;
  padding: 0;
}

/* Home: logo sizing */
.home-logo {
    display: flex;
    align-items: center;
    justify-content: center;
}
.home-logo img {
    width: 500px;
    height: 500px;
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    display: block;
}
@media (max-width: 640px) {
  .home-logo img {
    width: min(250px, 90vw);
    height: min(250px, 90vw);
  }
}

#home .home-sections {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 20px;
}
#home .home-title { display: block; }
#home h2 {
  font-family: 'Roboto', sans-serif;
}
#home .home-logo { justify-self: end; }
@media (max-width: 640px) {
  #home .home-sections {
    grid-template-columns: 1fr;
  }
  #home .home-logo { justify-self: center; }
}

/* Footer */
.site-footer {
    background-color: transparent;
    color: inherit;
    padding: 20px;
    height: auto;
    font-size: 18px;
    text-align: center;
    display: flex;
    align-items: center;
}

/* Footer inner: light grey, 25% transparent with background blur */
#footer-inner {
    background: rgba(255,255,255,0.05);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    width: 100%;
    max-width: var(--container-max-width);
    margin: 0 auto; /* match header's auto side margins */
    padding: 0; /* no padding on the container */
    border-radius: 25px; /* match nav button radius */
}
/* Make the three inner blocks a fixed 50px height */
#footer-inner > * {
    height: 50px;
    display: flex;
    align-items: center;
}

/* Apply left/right padding to specific footer blocks (as direct children) */
#footer-inner > #footer-greeting,
#footer-inner > #footer-nav,
#footer-inner > #footer-social {
    padding-left: 10px;
    padding-right: 10px;
}

/* Override container behavior inside footer so items fit on one row */
.site-footer .container {
    width: auto;
    max-width: none;
    margin: 0;
    height: 100%;
    display: flex;
    align-items: center;
}

/* Align each footer block: left, center, right */
.site-footer #footer-greeting { justify-content: flex-start; }
.site-footer #footer-nav { justify-content: center; }
.site-footer #footer-social { justify-content: flex-end; }

/* Footer social icons spacing and sizing */
.site-footer #footer-social {
    gap: 12px;
}

/* Mobile footer: stack blocks vertically */
@media (max-width: 640px) {
  #footer-inner {
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
  }
  #footer-inner > * {
    width: 100%;
    justify-content: center;
    text-align: center; /* center text/icons inside each row */
  }
  /* Override per-block alignment so content centers while stacked */
  .site-footer #footer-inner > #footer-greeting,
  .site-footer #footer-inner > #footer-nav,
  .site-footer #footer-inner > #footer-social {
    justify-content: center !important;
    text-align: center;
  }
}
.site-footer #footer-social .social-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    line-height: 0; /* remove baseline gap for perfect centering */
}
.site-footer #footer-social .social-link svg {
    width: 40px;
    height: 40px;
    fill: currentColor;
    display: block;
}

/* Nudge Discord icon up slightly to visually match size */
.site-footer #footer-social .social-link[aria-label="Discord"] svg {
    width: 40px;
    height: 40px;
    transform: translateY(0);
    overflow: visible;
}

/* Keep Discord glyph visually centered */
.site-footer #footer-social .social-link[aria-label="Discord"] svg path {
    transform-box: fill-box;
    transform-origin: center;
    transform: translateY(1px);
}

/* Force footer icon and link color to white */
.site-footer #footer-social .social-link { color: #ffffff; }
.site-footer #footer-nav .back-to-top { color: #ffffff; }

/* Registered mark styling next to footer greeting */
.site-footer .reg-mark {
    font-size: 12px;
    vertical-align: super;
    margin-left: 4px; /* tiny space between text and symbol */
    opacity: 0.9;
}

/* Responsive Design */
@media (max-width: 768px) {
    .container {
        padding: 0 1.5rem;
    }
}
