/* 
  =========================================================
      QUANTUM/DOS RETRO STYLES + MAC WINDOW CONTROLS
      The "One CSS to rule them all."
      Hidden ASCII for watchers:

         .-.
        (   )
         |-|
         |~|   QUANTUM VISIONS
         |~|   SHIFTING REALITIES
         `-'   FOR THE CURIOUS . . .
  =========================================================
*/

/* --- 1. DOS Retro & Scanlines + Flicker --- */

/* Pixel-based DOS-like font */
@font-face {
    font-family: 'ModernDOS8x16';
    src: url('../fonts/ModernDOS8x16.ttf') format('truetype');
}

/* Attempt to fix zoom on various devices */
@viewport {
    zoom: 1;
    min-zoom: 1;
    max-zoom: 1;
}

body {
    margin: 0;
    padding: 0;
    background: #0a192f;
    height: 100vh;
    overflow: hidden;
    image-rendering: pixelated;
    text-rendering: geometricPrecision;
    -webkit-font-smoothing: none;
    zoom: reset;
}

/* Force pixel ratio on hi-dpi screens */
@media screen and (min-resolution: 1dppx) {
    html {
        -webkit-text-size-adjust: none;
        text-size-adjust: none;
    }
}

/* Subtle scanlines layering + color shift effect on body */
body::before {
    content: "";
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background:
      linear-gradient(rgba(10,25,47,0) 50%, rgba(0,20,40,0.25) 50%), /* horizontal lines */
      linear-gradient(90deg, rgba(100,255,218,0.06), rgba(35,166,213,0.02), rgba(100,255,218,0.06));
    z-index: 2;
    background-size: 100% 2px, 3px 100%;
    pointer-events: none;
}

/* Flicker overlay */
body::after {
    content: "";
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background: rgba(18,16,16,0.1);
    opacity: 0;
    z-index: 2;
    pointer-events: none;
    animation: flicker 0.15s infinite;
}

@keyframes flicker {
    0%   { opacity: 0.2; }
    50%  { opacity: 0.08; }
    100% { opacity: 0.2; }
}

.screen {
    height: 100vh; width: 100vw;
    background-color: #0a192f;
    display: flex;
    align-items: flex-start;
    justify-content: flex-start;
    overflow: hidden;
    position: relative;
    padding: 20px;
}

/* Optional "retro-screen" layering */
.retro-screen::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background: 
      linear-gradient(rgba(255,255,255,0.07) 50%, rgba(0,0,0,0.05) 50%),
      linear-gradient(90deg, rgba(255,255,255,0.07) 1px, transparent 1px);
    background-size: 100% 4px, 4px 100%;
    opacity: 0.2;
    pointer-events: none;
    z-index: 1;
}

.bios-content {
    position: relative;
    z-index: 2;
    color: #a8a8a8;
    text-shadow: 0 0 2px rgba(168,168,168,0.8);
}

/* Hide scrollbar if needed */
.hide-scrollbar::-webkit-scrollbar {
    display: none;
}
.hide-scrollbar {
    -ms-overflow-style: none;
    scrollbar-width: none;
    white-space: nowrap !important;
    overflow-x: auto;
    display: flex;
    flex-wrap: nowrap;
}

/* Tab button styling for console-y look */
.tab-button {
    box-shadow: 0 0 15px rgba(255,255,255,0.15);
    transition: all 0.3s ease;
}
.tab-button:hover {
    box-shadow: 0 0 25px rgba(0,255,157,0.3);
}
.tab-button.active-tab {
    box-shadow: 0 0 30px rgba(0,255,157,0.4), inset 0 0 15px rgba(0,255,157,0.2);
    border: 1px solid rgba(0,255,157,0.6);
    background: rgba(0,255,157,0.1);
}

/* Glassmorphism if needed */
.glassmorphism {
    background: rgba(30,41,59,0.7);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255,255,255,0.1);
    box-shadow: 0 8px 32px 0 rgba(31,38,135,0.37);
}

/* Code text style */
pre {
    margin: 0;
    padding: 0;
    color: #64ffda;
    font-family: 'Ubuntu Mono', monospace;
    font-size: 20px;
    line-height: 1.2;
    white-space: pre;
}

/* Console cursor blink */
.cursor {
    animation: blink 1.2s step-end infinite;
    color: #64ffda;
}
@keyframes blink {
    0% { opacity: 1; }
    50% { opacity: 1; }
    51% { opacity: 0; }
    100% { opacity: 0; }
}

/* CRT shutdown effect (vertical collapse) */
.crt-shutdown {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: linear-gradient(transparent, rgba(255,255,255,0.2));
    animation: crtOff 1s ease-in forwards;
    pointer-events: none;
    z-index: 1000;
}
@keyframes crtOff {
    0%   { transform: scaleY(1);   opacity: 1; }
    60%  { transform: scaleY(0.001); opacity: 0.8; }
    100% { transform: scaleY(0);   opacity: 0; }
}

/* Flicker brightness for CRT vibe */
@keyframes crtFlicker {
    0%   { filter: brightness(1); }
    25%  { filter: brightness(0.8); }
    50%  { filter: brightness(0.4); }
    75%  { filter: brightness(0.6); }
    100% { filter: brightness(1); }
}

/* Quantum transition & prompt fade if needed */
@keyframes quantumTransition {
    0%   { transform: scale(1); filter: brightness(1); }
    50%  { transform: scale(1.5); filter: brightness(2) blur(10px); }
    100% { transform: scale(2); filter: brightness(0); }
}
@keyframes promptFade {
    0%   { opacity: 1; transform: scale(1); }
    100% { opacity: 0; transform: scale(0.5); }
}

/* Year or era color classes (if you want to style time periods) */
.year {
    font-size: 0.8em;
    opacity: 0.7;
    color: #888;
}
.era-1986 { color: #33ff33; text-shadow: 0 0 5px #33ff33; }
.era-1995 { color: #00a4ff; text-shadow: 0 0 5px #00a4ff; }
.era-2000 { color: #ffffff; text-shadow: 0 0 5px #ffffff; }
.era-2010 { color: #4287f5; text-shadow: 0 0 8px #4287f5; }
.era-2020 { color: #00ff9d; text-shadow: 0 0 12px #00ff9d; }
.era-2025 { 
    color: #00ffff;
    text-shadow: 0 0 15px #00ffff, 0 0 25px #00ffff;
    animation: futurePulse 2s infinite;
}
@keyframes futurePulse {
    0%   { opacity: 0.8; transform: scale(1); }
    50%  { opacity: 1;   transform: scale(1.1); }
    100% { opacity: 0.8; transform: scale(1); }
}

#dosPrompt {
  transition: transform 0.8s ease-in-out;
  white-space: nowrap;
}

.glitch-container {
  position: relative;
  display: inline-block; /* ensures we can glitch over it */
}


/* --- 2. QUANTUMOS "MAC" WINDOW & TASKBAR --- */

/* Desktop background (semi-opaque) */
.desktop {
    height: 100vh;
    background: rgba(32,32,32,0.1);
    overflow: hidden;
    position: relative;
}

/* Top bar / Taskbar */
.taskbar {
    position: fixed;
    top: 0; left: 0; right: 0;
    height: 32px;
    background: rgba(32,32,32,0.8);
    backdrop-filter: blur(10px);
    display: flex;
    align-items: center;
    padding: 0 10px;
    z-index: 1000;
    border-bottom: 1px solid #444;
}

/* The main "window" in the center (like an app) */
.window {
    position: absolute;
    top: 50%; left: 50%;
    transform: translate(-50%, -50%);
    width: 90vw; 
    height: 85vh;
    background: #1e1e1e;
    border-radius: 8px;
    box-shadow: 0 0 20px rgba(0,0,0,0.5);
    display: flex;
    flex-direction: column;
}

/* Window header bar (like Mac) */
.window-header {
    height: 42px;
    background: #2d2d2d;
    border-radius: 8px 8px 0 0;
    display: flex;
    align-items: center;
    padding: 0 10px;
    justify-content: space-between;
}

/* Window title text */
.window-title {
    color: #fff;
    font-family: 'Ubuntu Mono', monospace;
    font-size: 20px;
}

/* Group of the 3 "Mac" circles */
.window-controls {
    display: flex;
    gap: 8px;
}

/* The circles themselves */
.control-btn {
    width: 16px; height: 16px;
    border-radius: 50%;
    position: relative; /* needed if we do ::before or ::after for icons */
    cursor: pointer;
}

/* Specific colors for each circle */
.close { background: #ff5f57; }
.minimize { background: #febc2e; }
.maximize { background: #28c840; }

/* For the system menu (logo + label) */
.system-menu {
    display: flex;
    gap: 15px;
    align-items: center;
}

/* The clock/time on the right side */
.system-time {
    color: #fff;
    font-family: 'Ubuntu Mono', monospace;
    font-size: 20px;
    margin-left: auto;
}

/* Base icon styling */
.control-btn::before {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) scale(0.8);
  width: 14px;
  height: 14px;
  background-size: contain;
  background-repeat: no-repeat;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.control-btn:hover::before {
  opacity: 0.8;
  transform: translate(-50%, -50%) scale(1);
}

.control-btn.close:hover::before {
  background-image: url("https://cdn.jsdelivr.net/npm/simple-icons@v9/icons/github.svg");
  filter: invert(1);
}

.control-btn.minimize:hover::before {
  background-image: url("https://huggingface.co/favicon.ico");
  background-size: 95% 95%;
  filter: brightness(1.2) contrast(1.2);
}

.control-btn.maximize:hover::before {
  background-image: url("https://cdn.jsdelivr.net/npm/simple-icons@v9/icons/linkedin.svg");
  filter: invert(1);
}

/* Button text colors */
.control-btn.close span { color: #ff5f57; }
.control-btn.minimize span { color: #febc2e; }
.control-btn.maximize span { color: #28c840; }