/* ========================================
   COSMIC CATS - CLEANED & OPTIMIZED STYLESHEET
   🎯 PURPOSE: A clean, deduplicated, and functional stylesheet for the entire site.
   📄 USED BY: index.html + all *-content.html files
   ✨ FEATURES: Neon semi-transparent look, responsive design, all features preserved.
   
   ⚠️ REMINDER: When adding new code, merge with existing sections! 
   ⚠️ Put main-content styles with other main-content styles!
   ⚠️ Avoid code bloat - organize by functional sections!
======================================== */

/* ========================================
   0. Imports
======================================== */

@import url('https://fonts.googleapis.com/css2?family=Agu+Display&family=Audiowide&family=Ewert&family=Micro+5&family=Poiret+One&family=Rubik+Glitch&display=swap');

.rubik-glitch-regular {
  font-family: "Rubik Glitch", system-ui;
  font-weight: 400;
  font-style: normal;
}

.agu-display-normal {
  font-family: "Agu Display", serif;
  font-optical-sizing: auto;
  font-weight: 400;
  font-style: normal;
  font-variation-settings:
    "MORF" 0;
}

.micro-5-regular {
  font-family: "Micro 5", sans-serif;
  font-weight: 400;
  font-style: normal;
}

.audiowide-regular {
  font-family: "Audiowide", sans-serif;
  font-weight: 400;
  font-style: normal;
}

.ewert-regular {
  font-family: "Ewert", serif;
  font-weight: 400;
  font-style: normal;
}

.poiret-one-regular {
  font-family: "Poiret One", sans-serif;
  font-weight: 400;
  font-style: normal;
}

/* ========================================
   1. FONTS & BASE STYLES
======================================== */

html {
  scroll-behavior: auto; /* Disable smooth scrolling during fast scroll */
  /* Performance optimizations for scrolling */
  transform-style: preserve-3d;
}

body {
  /* Prevent layout thrashing during scroll */
  will-change: scroll-position;
}

/* Prevent horizontal panning/whitespace on mobile */
html, body {
  width: 100%;
  max-width: 100%;
  overflow-x: hidden;

  overscroll-behavior-x: none;
  touch-action: pan-y; /* allow vertical only; prevents accidental horizontal drag */
}

/* Ensure fixed, full-viewport layers use the visual viewport on mobile */
@supports (width: 100svw) {
  .star-sector,
  .cosmos,
  .content-container,
  .content-frame,
  .orbit-stars {
    width: 100svw;
  }
  .star-sector,
  .cosmos,
  .content-container,
  .orbit-stars {
    height: 100svh;
  }
  .content-frame {
    height: calc(100svh - 5vh); /* account for marquee height */
  }
}

/* DESKTOP-ONLY: Prevent scrolling only on desktop screens */
@media (min-width: 768px) and (pointer: fine) {
  body.index-page {
    overflow: hidden; /* Prevent body scrolling only on desktop */
    height: 100vh; /* Lock to viewport height only on desktop */
    margin: 0;
    padding: 0;
  }

  html.no-scroll-page {
    overflow: hidden; /* Prevent HTML scrolling only on desktop */
    height: 100%;
  }
}

/* INDEX-ONLY: Lock parent scrolling on all devices (iframe remains scrollable) */
html.no-scroll-page,
body.index-page {
  overflow: hidden !important;
  overscroll-behavior: contain;
}

/* Ensure sidebar and other fixed elements work properly on index */
body.index-page .sidebar {
  position: fixed; /* Ensure sidebar stays fixed on index */
  z-index: 1000; /* Ensure it's above other elements */
}

body.index-page .sidebar-grip-2 {
  position: fixed; /* Ensure sidebar grip stays fixed on index */
  z-index: 1100; /* Above sidebar */
}

/* Minimize angle variable impact */
@property --angle {
  syntax: "<angle>";
  initial-value: 0deg;
  inherits: false;
}

#layerNeko0 {
  /* Z-INDEX 2200: Draggable UI, always above panels */
  z-index: 2200;
}

/* Performance optimization for iframe scrolling lag */
* {
  /* Reduce repaints during scroll - less aggressive for iframes */
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Iframe-specific performance optimizations */
iframe {
  /* Force hardware acceleration for iframe content */
  transform: translateZ(0);
  will-change: scroll-position;
  /* Improve scrolling performance */
  overflow: auto;
  -webkit-overflow-scrolling: touch;
  /* Additional optimizations for iframe content */
  contain: layout style;
  isolation: isolate;
}

/* Reduce CPU load when iframe is focused/hovered */
body:has(iframe:focus) .star-sector,
body:has(iframe:hover) .star-sector,
body:has(.content-frame:focus) .star-sector,
body:has(.content-frame:hover) .star-sector {
  animation-duration: 60s; /* Much slower during iframe interaction */
  opacity: 0.6; /* Reduce visual complexity */
}

body:has(iframe:focus) .orbit-star,
body:has(iframe:hover) .orbit-star,
body:has(.content-frame:focus) .orbit-star,
body:has(.content-frame:hover) .orbit-star {
  animation-duration: calc(var(--orbit-speed, 10s) * 3); /* Much slower orbit */
  opacity: 0.7; /* Reduce visual complexity */
}

/* Dynamic animation speed control based on iframe interaction */
body[style*="--animation-speed-multiplier"] .star-sector {
  animation-duration: calc(30s / var(--animation-speed-multiplier, 1));
}

body[style*="--animation-speed-multiplier"] .orbit-star {
  animation-duration: calc(var(--orbit-speed, 10s) / var(--animation-speed-multiplier, 1));
}

body[style*="--animation-speed-multiplier"] .main-content::before {
  animation-duration: calc(6s / var(--animation-speed-multiplier, 1));
}

/* Reduce backdrop-filter complexity during iframe interaction */
body:has(.content-frame:focus) .main-content,
body:has(.content-frame:hover) .main-content {
  backdrop-filter: blur(calc(var(--cosmic-global-blur, 6px) * 0.5)); /* Reduced blur */
}

/* Pause complex animations when iframe is scrolling */
.iframe-scrolling .star-sector {
  animation-play-state: paused;
}

.iframe-scrolling .orbit-star {
  animation-play-state: paused;
}





* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

/* ========================================
   2. ANIMATED BACKGROUNDS - STAR SECTOR (MODULAR)
======================================== */

/* Modular starfield effect with adjustable variables - OPTIMIZED */
.star-sector {
  --star-size: 1.5px;
  --star-density: 8;
  --star-tiling: 400px;
  /* Only 4 color options for performance and style */
  --star-color-1: #fff;
  --star-color-2: #8be9fdcc;
  --star-color-3: #ff79c6cc;
  --star-color-4: #a14affcc;
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  /* Z-INDEX 0: Starfield background, always at the bottom */
  z-index: 0;
  pointer-events: none;
  opacity: 0.8;
  /* Reduced from 8 to 4 gradients for performance */
  background:
    radial-gradient(var(--star-size) var(--star-size) at 20px 40px, var(--star-color-1), transparent 60%),
    radial-gradient(calc(var(--star-size) * 1.2) calc(var(--star-size) * 1.2) at 120px 80px, var(--star-color-2), transparent 60%),
    radial-gradient(calc(var(--star-size) * 0.8) calc(var(--star-size) * 0.8) at 200px 160px, var(--star-color-3), transparent 60%),
    radial-gradient(calc(var(--star-size) * 1.1) calc(var(--star-size) * 1.1) at 300px 200px, var(--star-color-4), transparent 60%);
  background-repeat: repeat;
  background-size: var(--star-tiling) var(--star-tiling);
  animation: starfield-move 30s linear infinite; /* Slower for performance */
  /* Performance optimizations */
  will-change: transform;
  transform: translateZ(0); /* Force GPU acceleration */
  contain: layout style;
}

@keyframes starfield-move {
  0% { transform: translateY(0px); }
  50% { transform: translateY(-50px); }
  100% { transform: translateY(0px); }
}



/* ========================================
   3.COSMIC BACKGROUND WRAPPER - .cosmos
======================================== */
.cosmos {
  font-family: 'Exo 2', 'Segoe UI', Arial, sans-serif;
  background: 
    radial-gradient(ellipse 60% 40% at 70% 30%, rgba(255, 0, 255, 0.18) 0%, transparent 80%),
    radial-gradient(ellipse 50% 30% at 30% 60%, rgba(0, 255, 255, 0.15) 0%, transparent 80%),
    radial-gradient(ellipse 40% 60% at 60% 70%, rgba(255, 255, 0, 0.10) 0%, transparent 80%),
    radial-gradient(ellipse 30% 40% at 80% 80%, rgba(255, 0, 0, 0.10) 0%, transparent 80%),
    radial-gradient(ellipse 80% 60% at 50% 50%, rgba(0, 0, 64, 0.7) 0%, transparent 100%),
    linear-gradient(120deg, #0a0a1e 0%, #1a1a2e 100%);
  background-blend-mode: lighten, lighten, lighten, lighten, normal, normal;
  background-size: cover;
  color: #ffffff;
  line-height: 1.6;
  position: relative;
  min-height: 100vh;
  min-width: 100vw;
  z-index: -10;
}


/* ========================================
   4. Navigational Tablet - Sidebar
======================================== */
.sidebar {
  position: fixed;
  top: 10vh;

  width: 40vw;
  right: 35px;
  max-width: 600px;
  min-width: 320px;
  height: 80vh;

  background-color: rgba(26, 15, 46, var(--cosmic-global-opacity));
  backdrop-filter: blur(var(--cosmic-global-blur));


  border-radius: 28px 0 0 28px;
  border: 4px solid rgba(255,255,255,0.12);
  /* Simplified shadow - reduced from 4 to 2 shadows */
  box-shadow:
    -8px 0 20px rgba(0,0,0,0.4),
    0 0 20px 4px rgba(139,233,253,0.15);
  
  overflow: visible; /* So the border effect is not clipped */

  /* Z-INDEX 1000: Sidebar navigation */
  z-index: 1000;
  padding: 6px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  transform: translateX(100%);
  opacity: 0;
  transition: transform 0.5s cubic-bezier(0.25, 0.46, 0.45, 0.94), opacity 0.4s ease;
  /* Grip handle positioning context */
  overflow: visible;
}

/* Second sidebar grip for additional functionality */
.sidebar-grip-2 {
  position: fixed;
  top: 10vh;
  right: -3vw;
  width: 9vw;
  height: 80vh;
  border-radius: 28px 0 0 28px;
  border: 4px solid rgba(255,255,255,0.12);
  background: linear-gradient(120deg, #232a3a 60%, #001d24 100%);
  /* Z-INDEX 1100: Sidebar open/close handles */
  z-index: 1100;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: transform 0.5s cubic-bezier(0.25, 0.46, 0.45, 0.94), opacity 0.4s;
  opacity: 1;
  pointer-events: auto;
  transform: none;
  transition: transform 0.3s, opacity 0.3s;

  box-shadow: 0 0 18px 4px #8be9fd88, 0 0 0 2px #ff79c6 inset;
  animation: grip2-glow 2.5s linear infinite;
}

/* Keep the grip visible but inside visual viewport on small screens */
@media (max-width: 600px) {
  .sidebar-grip-2 {
    right: -10px;
    width: 56px;
    height: 70vh;
  }
  .sidebar-grip-2:hover {
    transform: none; /* avoid extra nudge that can cause horizontal pressure */
  }
}
@keyframes grip2-glow {
  0%, 100% { box-shadow: 0 0 18px 4px #8be9fd88, 0 0 0 2px #ff79c6 inset; }
  50% { box-shadow: 0 0 32px 8px #ff79c6cc, 0 0 0 4px #8be9fd inset; }
}
.sidebar-grip-2::after {
  content: "Open the Cosmic Tablet!";
  position: absolute;
  left: 110%;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(30,30,40,0.95);
  color: #8be9fd;
  font-size: 1rem;
  padding: 6px 14px;
  border-radius: 8px;
  opacity: 0;
  pointer-events: none;
  white-space: nowrap;
  box-shadow: 0 2px 12px #0008;
  transition: opacity 0.3s, left 0.3s;
  z-index: 9999;
}
.sidebar-grip-2:hover::after {
  opacity: 1;
  left: 120%;
}
.sidebar-grip-2:hover {
  transform: translateX(-3vw);
  opacity: 1;
}
.sidebar-grip-2.open {
  opacity: 0;
  pointer-events: none;
  transform: translateY(-9vh); /* or whatever your out-of-view animation is */
}

/* === Futuristic Tablet Grip/Handle === */
.sidebar-grip {
  position: absolute;
  top: 50%;
  right: -60px; /* sticks out further from sidebar edge */
  width: 60px;
  height: 102%; /* slightly bigger than sidebar */
  transform: translateY(-50%);
  background: linear-gradient(120deg, #232a3a 60%, #8be9fd 100%);
  border-radius: 0 28px 28px 0;
  box-shadow: 2px 0 24px 6px #8be9fd55, 0 0 0 2px #fff2 inset;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  /* Z-INDEX 1100: Sidebar open/close handles */
  z-index: 1100;
  border-left: 2px solid #8be9fd88;
  box-shadow: 0 0 18px 4px #8be9fd88, 0 0 0 2px #ff79c6 inset;
  animation: grip2-glow 2.5s linear infinite;
}

.sidebar-grip::before {
  content: '';
  display: block;
  width: 18px;
  height: 60px;
  margin-top: 18px;
  border-radius: 8px;
  background: repeating-linear-gradient(
    to bottom,
    #8be9fd33 0 8px,
    transparent 8px 16px
  );
  opacity: 0.7;
}

.sidebar-model {
  writing-mode: vertical-rl;
  text-orientation: mixed;
  font-size: 0.95rem;
  letter-spacing: 0.12em;
  color: #8be9fd;
  font-family: 'Exo 2', 'Poiret One', monospace;
  margin-bottom: 18px;
  opacity: 0.85;
  text-shadow: 0 0 8px #8be9fd88, 0 0 2px #fff;
  user-select: none;
}


.sidebar::-webkit-scrollbar {
  width: 8px;
  background: transparent;
}
.sidebar::-webkit-scrollbar-thumb {
  background: linear-gradient(120deg, #8be9fdcc, #ff79c6cc);
  border-radius: 8px;
  box-shadow: 0 0 8px #8be9fd88;
}
.sidebar {
  scrollbar-width: thin;
  scrollbar-color: #8be9fdcc #222;
}

/* Custom scrollbar for iframe content */
.content-frame::-webkit-scrollbar {
  width: 12px;
  background: rgba(26, 15, 46, 0.8);
}

.content-frame::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, #8be9fd, #ff79c6);
  border-radius: 6px;
  border: 2px solid rgba(26, 15, 46, 0.8);
  box-shadow: 
    0 0 8px #8be9fd88,
    inset 0 0 4px rgba(255, 255, 255, 0.2);
}

.content-frame::-webkit-scrollbar-thumb:hover {
  background: linear-gradient(180deg, #50fa7b, #f1fa8c);
  box-shadow: 
    0 0 12px #50fa7b88,
    inset 0 0 6px rgba(255, 255, 255, 0.3);
}

.content-frame::-webkit-scrollbar-track {
  background: rgba(26, 15, 46, 0.6);
  border-radius: 6px;
  margin: 5px 0;
}

/* Firefox scrollbar for iframe */
.content-frame {
  scrollbar-width: thin;
  scrollbar-color: #8be9fd rgba(26, 15, 46, 0.8);
}

/* ========================================
   15. SCROLL PROGRESS INDICATOR - HIGH PERFORMANCE
======================================== */

.scroll-progress-container {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 4px;
  background: rgba(255, 255, 255, 0.1);
  z-index: 10000;
  pointer-events: none; /* Allow clicks to pass through */
}

.scroll-progress-bar {
  height: 100%;
  background: linear-gradient(90deg, #8be9fd, #ff79c6, #f1fa8c);
  background-size: 200% 100%;
  animation: gradient-flow 3s linear infinite;
  width: 0%;
  will-change: width; /* Performance hint */
}

@keyframes gradient-flow {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

.sidebar.closed {
  opacity: 0;
  pointer-events: none;
  transform: translateX(100%);
}

.sidebar:not(.closed) {
  opacity: 1;
  pointer-events: auto;
  transform: translateX(0);
}

.sidebar::after {
  content: '';
  position: absolute;
  left: 8px; top: 50%; transform: translateY(-50%);
  width: 6px; height: 60px;
  border-radius: 6px;
  background: repeating-linear-gradient(
    to bottom,
    rgba(255,255,255,0.12),
    rgba(255,255,255,0.12) 8px,
    transparent 8px,
    transparent 12px
  );
  opacity: 0.7;
  z-index: 2;
}

/* Sidebar inner wrapper to prevent content from overlapping border effect */

.sidebar-inner {
  padding: 22px; /* Match or slightly exceed border + ::before padding */
  height: 100%;
  box-sizing: border-box;
  overflow-y: auto;
  position: relative;
  z-index: 3;
}



.sidebar-overlay {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(30, 30, 40, 0.65);
  /* Z-INDEX 900: Sidebar overlay, below sidebar */
  z-index: 900;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s cubic-bezier(0.4,0,0.2,1);
}
.sidebar-overlay.active {
  opacity: 1;
  pointer-events: auto;
}

/*CosmicCat's Navigational Tablet*/
.sidebar h2 {
  text-align: center;
  margin: 30px 0;
  font-size: 2rem;
  font-weight: 700;
  background: linear-gradient(90deg, #fff, #ff79c6, #8be9fd, #50fa7b);
  background-size: 200% 200%;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  filter: drop-shadow(0 0 16px rgba(255, 255, 255, 0.9));
  animation: gradient-text 4s ease infinite;
  font-family: 'Exo 2', sans-serif;
}

@keyframes gradient-text {
  0%, 100% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
}



.sidebar-section {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  transition: max-height 0.4s ease, opacity 0.3s ease;
  max-height: 0;
  width: 100%;
  opacity: 0;
}

.sidebar-section.open {
  max-height: 200px; /* Adjust as needed */
  opacity: 1;
}

.sidebar-category {
  margin: 10px;
  padding: 6px;

  border-radius: 5px;
  transition: all 0.3s ease;
  cursor: pointer;
  border: 2px solid transparent;
}

.sidebar-category:hover {
  transform: scale(1.02);
}

/* Category Themes */
.sidebar-category.cosmic-portal {
  background: linear-gradient(135deg, 
    rgba(139, 233, 253, 0.3) 0%, 
    rgba(139, 233, 253, 0.2) 50%, 
    rgba(139, 233, 253, 0.15) 100%);
  border-color: rgba(139, 233, 253, 0.5);
  box-shadow: 
    0 8px 25px rgba(139, 233, 253, 0.25),
    inset 0 1px 0 rgba(139, 233, 253, 0.4);
}
.sidebar-category.fire {
  background: linear-gradient(135deg, 
    rgba(255, 69, 0, 0.4) 0%, 
    rgba(220, 20, 60, 0.5) 50%, 
    rgba(255, 140, 0, 0.3) 100%);
  border-color: rgba(255, 69, 0, 0.6);
  box-shadow: 
    0 8px 25px rgba(255, 69, 0, 0.2),
    inset 0 1px 0 rgba(255, 140, 0, 0.3);
}
.sidebar-category.matrix {
  background: linear-gradient(135deg, 
    rgba(0, 255, 0, 0.25) 0%, 
    rgba(0, 200, 0, 0.35) 50%, 
    rgba(0, 150, 0, 0.2) 100%);
  border-color: rgba(0, 255, 0, 0.5);
  box-shadow: 
    0 8px 25px rgba(0, 255, 0, 0.15),
    inset 0 1px 0 rgba(0, 255, 0, 0.3);
}
.sidebar-category.synthwave {
  background: linear-gradient(135deg, 
    rgba(255, 0, 110, 0.4) 0%, 
    rgba(131, 56, 236, 0.5) 50%, 
    rgba(255, 20, 147, 0.3) 100%);
  border-color: rgba(255, 0, 110, 0.6);
  box-shadow: 
    0 8px 25px rgba(255, 0, 110, 0.2),
    inset 0 1px 0 rgba(255, 20, 147, 0.3);
}

.sidebar h3 {
  text-align: center;
  font-size: 1.1rem;
  font-weight: 700;
  letter-spacing: 1.4px;
  user-select: none;
  pointer-events: none;
  background: linear-gradient(90deg, #fff, #ff79c6, #8be9fd);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  filter: drop-shadow(0 0 4px rgba(255, 255, 255, 0.3));
  font-family: 'Poiret One', sans-serif;
  width: 100%;
  font-family: 'Exo 2', sans-serif;
  padding: 18px;

}

.sidebar a {
  display: block;
  color: #fff;
  text-decoration: none;
  font-size: 0.95rem;
  padding: 10px 12px;
  border-radius: 6px;
  margin: 4px 0;
  transition: all 0.3s ease;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  width: 90%;
  text-align: center;
  font-family: 'Exo 2', sans-serif;
}

.sidebar a:hover {
  background: rgba(139, 233, 253, 0.2);
  transform: scale(1.02);
  border-color: rgba(139, 233, 253, 0.4);
}

.sidebar a.active {
  background: rgba(255, 121, 198, 0.25);
  font-weight: 600;
  border-color: rgba(255, 121, 198, 0.5);
}

/* ========================================
   5. IFRAME & CONTENT AREA
======================================== */

/*Main Content Loader*/
.content-container {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;

  z-index: 1;

  width: 100vw;
  height: 100vh;
  min-width: 100vw;
  min-height: 100vh;
  background: transparent;
}

.loading-indicator {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  text-align: center;
  z-index: 10;
  color: #8be9fd;
}

.cosmic-spinner {
  font-size: 2rem;
  animation: spin 2s linear infinite;
  margin-bottom: 10px;
}

@keyframes spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

/* Literal iframe - OPTIMIZED FOR SMOOTH SCROLLING */
.content-frame {
  width: 100%;
  height: 100%;
  border: none;
  background: transparent;
  transition: opacity 0.3s ease;
  /* Critical iframe performance optimizations */
  transform: translateZ(0); /* Force GPU layer */
  will-change: contents; /* Hint for content changes */
  contain: layout style; /* Isolate layout calculations */
  overflow: auto; /* Enable iframe scrolling */
  -webkit-overflow-scrolling: touch; /* Smooth iOS scrolling */
  /* Reduce compositing complexity */
  isolation: isolate;
  /* Ensure iframe can scroll its content properly */
  max-height: calc(100vh - 5vh); /* Match the fixed positioning - just below marquee */
}

/* (Moved to styles/main-iframe.css) Flexbox layouts used inside iframe content pages */


/* ========================================
   Main Content & Sub Content - MERGED & OPTIMIZED
======================================== */

/* (Moved to styles/main-iframe.css) .main-content card styles */

/* Note: sub-content merged into main-content (hover behavior unchanged intentionally omitted) */

/* Simplified border system - OLD VERSION COMMENTED */
/* 
OLD COMPLEX BORDER SYSTEM:
.main-content::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  border-radius: 25px;
  padding: 5px;
  background: linear-gradient(45deg, 
    rgb(234, 0, 255), 
    rgb(6, 209, 255), 
    rgb(200, 255, 0),
    rgb(234, 0, 255)
  );
  background-size: 400% 400%;
  animation: border-colors-move 8s linear infinite;
  -webkit-mask:
    linear-gradient(#fff 0 0) content-box, 
    linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask:
    linear-gradient(#fff 0 0) content-box, 
    linear-gradient(#fff 0 0);
  mask-composite: exclude;
  pointer-events: none;
}
*/

/* NEW SIMPLIFIED BORDER SYSTEM */
/* (Moved to styles/main-iframe.css) .main-content decorative border */

/* Color variations (formerly sub-content) - now apply to main-content */
/* (Moved to styles/main-iframe.css) .main-content color variants */
@keyframes spin-border {
  from { --angle: 0deg; }
  to   { --angle: 360deg; }
}

@keyframes border-colors-move {
  0%, 100% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
}

@keyframes cosmic-galaxy {
  0%, 100% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
}
body.sidebar-open .main-content {
  box-shadow: 0 0 60px 0 rgba(0,0,0,0.18), 0 0 0 8px rgba(139,233,253,0.06);
  transition: box-shadow 0.5s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}


/* (Moved to styles/main-iframe.css) .third-row-content */


/* (Moved to styles/main-iframe.css) .huge-content */

/* (Moved to styles/main-iframe.css) .huge-content::before */
@keyframes border-colors-move {
  0%, 100% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
}

/* ========================================
   RESPONSIVE IFRAME CONTAINERS - AUTO-SIZING
======================================== */

/* Video container - auto-resizes based on content */
/* (Moved to styles/main-iframe.css) .video and .survey components */

/* Make iframe a true window: no background, border, or effects */
.content-frame {
  position: fixed;
  top: 5vh; /* Start below the marquee */
  left: 0;
  width: 100vw;
  height: calc(100vh - 5vh); /* Full height minus marquee */
  min-width: 100vw;
  /* Remove min-height to prevent overflow */
  border: none;
  background: transparent !important;
  box-shadow: none !important;
  outline: none !important;
  filter: none !important;
  transition: opacity 0.3s ease;
  z-index: 10;
}

/* (Iframe text wrapping moved to styles/main-iframe.css) */

/* (Moved to styles/main-iframe.css) .content-item */

.background-catmic-saturn {
  position: fixed;
  bottom: -30vw;
  right: -45vw;
  width: 100vw;
  height: 100vw;
  z-index: -9;
  pointer-events: none;
  filter: blur(4px) brightness(0.8) saturate(0.7) drop-shadow(0 0 60px #8be9fd88);
  opacity: 0.5;
}
.background-catmic-saturn img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;  
}
.background-catmic-saturn::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(139,233,253,0.18) 0%, transparent 70%);
  z-index: 1;
  pointer-events: none;
}

/* ========================================
   8. TYPOGRAPHY & CONTENT STYLES - ENHANCED PADDING
======================================== */
/* (Moved to styles/main-iframe.css) typography, helpers, and italics */

/* Enhanced cosmic image styling - merged with existing */
/* (Moved to styles/main-iframe.css) .cosmic-image component */

/* (Moved to styles/main-iframe.css) .tooltip component */

/* (Moved to styles/main-iframe.css) hr styles */



/* ========================================
   9. EASTER EGGS & SPECIAL MODES
======================================== */

/* MLG Mode */
.mlg-background {
  background: linear-gradient(45deg, red, lime, blue, red);
  background-size: 400% 400%;
  animation: mlg-background 0.2s linear infinite;
}
.mlg-screen-shake {
  animation: mlg-shake 0.1s linear infinite;
}
@keyframes mlg-background {
  50% { background-position: 100% 100%; }
}
@keyframes mlg-shake {
  25% { transform: translate(2px, 2px) rotate(0.5deg); }
  75% { transform: translate(-3px, 1px) rotate(-0.5deg); }
}



/* ========================================
   11. UTILITIES & PRINT
======================================== */
@media (prefers-reduced-motion: reduce) {
  * {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

.hidden {
  display: none !important;
}
@media print {
  .sidebar, .menu-toggle, /* .cat-cursor, */ .orbit-stars, .cosmic-marquee {
    display: none;
  }
  
  .main-content {
    margin: 0;
    padding: 0;
    box-shadow: none;
    border: none;
    background: white;
    color: black;
  }
  
  body {
    background: white;
    color: black;
  }
}


/* ========================================
   IFRAME NAVIGATION SYSTEM
======================================== */


/* ========================================
   CONTENT FRAME BASE STYLES - CONSISTENT SIZING & ENHANCED DESIGN
======================================== */
/* Applied to all iframe content pages for consistent sizing */

@keyframes cosmic-border {
  0%, 100% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
}

.cosmic-image:hover {
  transform: translateY(-5px) scale(1.02);
  box-shadow: 
    0 15px 40px rgba(139, 233, 253, 0.3),
    0 25px 50px rgba(0, 0, 0, 0.15);
}

.cosmic-image img,
.cosmic-image iframe {
  width: 100%;
  height: auto;
  border-radius: 16px;
  display: block;
}

.cosmic-image iframe {
  min-height: 315px;
}

/* Enhanced list styling */
/* (Moved to styles/main-iframe.css) list styles */

/* Enhanced link styling */
/* (Moved to styles/main-iframe.css) link styles */


#mydiv {
  position: absolute;
  top: 10vh;
  left: 0;
  padding: 200px;
  z-index: 9;
  text-align: center;
}
#mydiv img {
  width: 100px;       /* Set image width */
  height: 100px;      /* Set image height */
  object-fit: contain; /* Keeps aspect ratio, prevents stretching */
  display: block;
  margin: 0 auto;    /* Center the image */
}

/* Z-INDEX 3000+: Alerts, tooltips, and other overlays (future-proof) */
.alert, .tooltip, .overlay {
  z-index: 3000;
}


/* ========================================
   2. Marquee
======================================== */

.cosmic-marquee {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 5vh;
  background: linear-gradient(90deg, 
  rgba(26,26,46,var(--cosmic-global-opacity)) 0%, 
  rgba(255,121,198,var(--cosmic-global-opacity)) 25%, 
  rgba(139,233,253,var(--cosmic-global-opacity)) 50%, 
  rgba(80,250,123,var(--cosmic-global-opacity)) 75%, 
  rgba(26,26,46,var(--cosmic-global-opacity)) 100%);
  /* Z-INDEX 1200: Top fixed marquee */
  z-index: 1200;
  overflow: hidden;
  border-bottom: 2px solid rgba(139, 233, 253, 0.5);
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.4);
  cursor: pointer;
  transition: all 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}
.marquee-track {
  display: flex;
  width: 300%;
  height: 100%;
  animation: seamless-scroll 20s linear infinite;
}
@keyframes seamless-scroll {
  0% { transform: translateX(0%); }
  100% { transform: translateX(-33.3333%); }
}
.marquee-content {
  line-height: 50px;
  font-size: 1.3rem;
  font-weight: 700;
  color: white;
  white-space: nowrap;
  font-family: 'Poiret One', sans-serif;
  letter-spacing: 2px;
  flex: 0 0 33.3333%;
  min-width: 33.3333%;
  max-width: 33.3333%;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  text-align: left;
  padding: 0;
  margin: 0;
  box-sizing: border-box;
  overflow: hidden;
  position: relative;
}
.marquee-crazy .marquee-content {
  animation: crazy-colors 2s ease infinite;
}
@keyframes crazy-colors {
  0% { color: #ff0000; text-shadow: 0 0 10px #ff0000; }
  25% { color: #00ff00; text-shadow: 0 0 10px #00ff00; }
  50% { color: #0000ff; text-shadow: 0 0 10px #0000ff; }
  75% { color: #ffff00; text-shadow: 0 0 10px #ffff00; }
  100% { color: #ff00ff; text-shadow: 0 0 10px #ff00ff; }
}
.marquee-shake {
  animation: marquee-shake 0.2s ease-in-out 2;
}
@keyframes marquee-shake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-2px); }
  75% { transform: translateX(2px); }
}
.marquee-teleport {
  animation: marquee-teleport 1.5s ease-in-out forwards;
}
@keyframes marquee-teleport {
  0% { transform: scale(1) rotate(0deg); opacity: 1; }
  100% { transform: scale(0) rotate(360deg); opacity: 0; }
}


/* ========================================
3. TIMECHURCH FONT & FEATURE TOGGLE MENU
======================================== */

/* TimeChurch special font */
.timechurch-font {
  font-family: 'Orbitron', 'Exo 2', Arial, sans-serif;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
/* Feature Toggle Menu Styles */
#feature-toggle-menu {
  margin-top: 18px;
  margin-bottom: 10px;
  display: flex;
  justify-content: center;
  gap: 12px;
}
.feature-toggle-btn {
  width: 44px;
  height: 44px;
  border-radius: 8px;
  border: 2px solid #8be9fd;
  background: rgba(30,30,40,0.7);
  color: #fff;
  font-size: 1.5rem;
  cursor: pointer;
  transition: background 0.2s, border-color 0.2s;
  outline: none;
}
.feature-toggle-btn:hover, .feature-toggle-btn.active {
  background: #8be9fd;
  color: #222;
  border-color: #ff79c6;
}

/* Sound System Button Special Animation */
.feature-toggle-btn.active#toggle-feature-4 {
  animation: soundButtonPulse 3s ease-in-out infinite;
}

@keyframes soundButtonPulse {
  0%, 100% { 
    box-shadow: 0 0 8px rgba(139, 233, 253, 0.3);
  }
  50% { 
    box-shadow: 0 0 15px rgba(139, 233, 253, 0.6), 0 0 25px rgba(139, 233, 253, 0.3);
  }
}

/* ========================================
   COSMIC SOUND SYSTEM STYLES
======================================== */
.cosmic-sound-panel {
  position: fixed;
  top: 260px;
  right: 20px;
  width: 280px;
  background: linear-gradient(135deg, rgba(30,30,40,0.97), rgba(50,50,70,0.97));
  backdrop-filter: blur(12px);
  border: 2px solid #8be9fd;
  border-radius: 14px;
  padding: 10px;
  z-index: 2100;
  box-shadow: 0 0 24px rgba(139, 233, 253, 0.35), 0 0 40px rgba(139, 233, 253, 0.12);
  transition: opacity 0.3s, transform 0.3s;
  font-family: 'Exo 2', sans-serif;
  user-select: none;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.sound-panel-drag-handle {
  width: 90%;
  height: 30px;
  margin: 10px;
  cursor: move;
  background: none;
  display: flex;
  align-items: center;
  justify-content: center;
  user-select: none;
  border-bottom: none;
  box-shadow: none;

  font-size: 1.2rem;
  color: #8be9fdcc;
}

.sound-icon {
  font-size: 1.7rem;
  margin-bottom: 2px;
  animation: soundPulse 2s ease-in-out infinite;
}

@keyframes soundPulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.1); }
}

.sound-controls {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.volume-row {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 2px;
}

.volume-label {
  font-size: 1.2rem;
  min-width: 20px;
  margin-right: 2px;
}

.cosmic-volume-slider {
  flex: 1 1 70%;
  min-width: 120px;
  max-width: 170px;
  height: 7px;
  border-radius: 4px;
  background: rgba(139, 233, 253, 0.22);
  outline: none;
  -webkit-appearance: none;
  appearance: none;
  cursor: pointer;
  margin: 0 6px;
}

.cosmic-volume-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: linear-gradient(45deg, #8be9fd, #ff79c6);
  box-shadow: 0 0 10px rgba(139, 233, 253, 0.6);
  cursor: pointer;
  transition: transform 0.2s;
}

.cosmic-volume-slider::-webkit-slider-thumb:hover {
  transform: scale(1.18);
  box-shadow: 0 0 14px rgba(139, 233, 253, 0.85);
}

.cosmic-volume-slider::-moz-range-thumb {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: linear-gradient(45deg, #8be9fd, #ff79c6);
  border: none;
  box-shadow: 0 0 10px rgba(139, 233, 253, 0.6);
  cursor: pointer;
}

.volume-percentage {
  color: #8be9fd;
  font-weight: 700;
  min-width: 38px;
  text-align: right;
  font-size: 1rem;
  letter-spacing: 0.5px;
}

.sound-toggle-row {
  display: flex;
  gap: 14px;
  margin-top: 6px;
  justify-content: center;
}

.sound-mute-btn, .sound-test-btn {
  flex: 1 1 45%;
  padding: 10px 0;
  border: 1.5px solid #8be9fd;
  border-radius: 7px;
  background: rgba(139, 233, 253, 0.13);
  color: #8be9fd;
  cursor: pointer;
  transition: all 0.18s;
  font-size: 1.05rem;
  font-weight: 600;
  box-shadow: 0 2px 8px rgba(139,233,253,0.07);
  letter-spacing: 0.2px;
}

.sound-mute-btn:hover, .sound-test-btn:hover {
  background: rgba(139, 233, 253, 0.22);
  border-color: #ff79c6;
  color: #ff79c6;
  transform: translateY(-2px) scale(1.04);
}

.sound-mute-btn.muted {
  background: rgba(255, 121, 198, 0.18);
  border-color: #ff79c6;
  color: #ff79c6;
}

/* ===============================
   COSMIC CUSTOMIZATION PANEL
=============================== */
.cosmic-customization-panel {
  position: fixed;
  top: 180px;
  right: 20px;
  width: 320px;
  background: linear-gradient(135deg, rgba(30,30,40,0.97), rgba(50,50,70,0.97));
  backdrop-filter: blur(10px);
  border: 2px solid #ff79c6;
  border-radius: 12px;
  padding: 18px 18px 16px 18px;
  /* Z-INDEX 2000: Customization modal/panel */
  z-index: 2000;
  box-shadow: 0 0 20px rgba(255, 121, 198, 0.25), 0 0 40px rgba(139, 233, 253, 0.08);
  transition: opacity 0.3s, transform 0.3s, left 0.2s, top 0.2s;
  font-family: 'Exo 2', sans-serif;
  cursor: default;
  user-select: none;
}
.customization-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 16px;
  color: #ff79c6;
  font-weight: 600;
  font-size: 1.1rem;
  justify-content: space-between;
}
.customization-icon {
  font-size: 1.4rem;
  animation: soundPulse 2s ease-in-out infinite;
}
.customization-close-btn {
  background: none;
  border: none;
  color: #ff79c6;
  font-size: 1.2rem;
  cursor: pointer;
  padding: 2px 6px;
  border-radius: 4px;
  transition: background 0.2s;
}
.customization-close-btn:hover {
  background: rgba(255, 121, 198, 0.12);
}
.customization-controls {
  display: flex;
  flex-direction: column;
  gap: 18px;
}
.slider-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 4px;
}
.slider-row label {
  min-width: 90px;
  color: #8be9fd;
  font-size: 1rem;
}
.cosmic-custom-slider {
  flex: 1;
  height: 6px;
  border-radius: 3px;
  background: rgba(255, 121, 198, 0.18);
  outline: none;
  -webkit-appearance: none;
  appearance: none;
  cursor: pointer;
}
.cosmic-custom-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: linear-gradient(45deg, #ff79c6, #8be9fd);
  box-shadow: 0 0 8px rgba(255, 121, 198, 0.5);
  cursor: pointer;
  transition: transform 0.2s;
}
.cosmic-custom-slider::-webkit-slider-thumb:hover {
  transform: scale(1.2);
  box-shadow: 0 0 12px rgba(255, 121, 198, 0.8);
}
.cosmic-custom-slider::-moz-range-thumb {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: linear-gradient(45deg, #ff79c6, #8be9fd);
  border: none;
  box-shadow: 0 0 8px rgba(255, 121, 198, 0.5);
  cursor: pointer;
}
.slider-row span {
  color: #ff79c6;
  font-weight: 600;
  min-width: 38px;
  text-align: right;
  font-size: 0.95rem;
}
.preset-row {
  display: flex;
  width: 100%;
  overflow-y: hidden;
  overflow-x: scroll;
  scrollbar-width: none; /* Hide scrollbar in Firefox */
  gap: 12px;
  margin-bottom: 2px;
}
.preset-btn {
  flex: 1;
  padding: 6px 8px;
  border: 1px solid #8be9fd;
  border-radius: 6px;
  background: rgba(139, 233, 253, 0.08);
  color: #8be9fd;
  cursor: pointer;
  font-size: 0.85rem;
  font-weight: 500;
  transition: all 0.2s;
}
.preset-btn:hover {
  background: rgba(255, 121, 198, 0.18);
  border-color: #ff79c6;
  color: #ff79c6;
}
.action-row {
  display: flex;
  gap: 8px;
}
.reset-btn, .random-btn {
  flex: 1;
  padding: 8px 12px;
  border: 1px solid #ff79c6;
  border-radius: 6px;
  background: rgba(255, 121, 198, 0.08);
  color: #ff79c6;
  cursor: pointer;
  font-size: 0.85rem;
  font-weight: 500;
  transition: all 0.2s;
}
.reset-btn:hover, .random-btn:hover {
  background: rgba(139, 233, 253, 0.18);
  border-color: #8be9fd;
  color: #8be9fd;
}

/* ========================================
   OPTIMIZED ORBIT STARS SYSTEM
======================================== */

.orbit-stars {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  pointer-events: none;
  z-index: 10;
  width: 100vw;
  height: 100vh;
}

.orbit-star {
  position: absolute;
  top: 50%;
  left: 50%;
  width: var(--star-size, 3px);
  height: var(--star-size, 3px);
  background: var(--star-color, #fff);
  border-radius: 50%;
  box-shadow: 0 0 6px var(--star-color, #fff);
  transform-origin: 0 0;
  animation: orbit-rotate var(--orbit-speed, 10s) linear infinite;
  transform: 
    rotate(var(--orbit-angle, 0deg)) 
    translate(var(--orbit-radius, 35vw), 0) 
    rotate(calc(-1 * var(--orbit-angle, 0deg)));
  will-change: transform;
  backface-visibility: hidden;
  /* Performance optimizations */
  contain: layout style;
  isolation: isolate;
}

@keyframes orbit-rotate {
  from {
    transform: 
      rotate(var(--orbit-angle, 0deg)) 
      translate(var(--orbit-radius, 35vw), 0) 
      rotate(calc(-1 * var(--orbit-angle, 0deg)));
  }
  to {
    transform: 
      rotate(calc(var(--orbit-angle, 0deg) + 360deg)) 
      translate(var(--orbit-radius, 35vw), 0) 
      rotate(calc(-1 * (var(--orbit-angle, 0deg) + 360deg)));
  }
}

/* Performance mode for lower-end devices */
@media (prefers-reduced-motion: reduce) {
  .orbit-star {
    animation-duration: 20s; /* Slower for accessibility */
  }
}

/* Further optimization for very low-end devices */
@media (max-width: 768px) and (max-height: 1024px) {
  .orbit-star {
    animation-duration: calc(var(--orbit-speed, 10s) * 1.5); /* Slower on mobile */
  }
}

/* ========================================
   SCROLL PROGRESS BAR & SPACESHIP INDICATOR
======================================== */

/* Scroll Progress Bar */
.scroll-progress-container {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 10px; /* Adjust height as needed */
  background-color: rgba(255, 255, 255, 0.1);
  z-index: 10000; /* High z-index to be on top */
  margin-top: 5vh;
}

.scroll-progress-bar {
  height: 100%;
  background-color: #8be9fd; /* Or any color you prefer */
  width: 0%;
  transition: width 0.1s linear;
}

.scroll-spaceship {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  font-size: 30px; /* Adjust size as needed */
  left: 0%;
  transition: left 0.1s linear;
}