/* ============================================
   ANIMATIONS.CSS — Transitions, open/close animations
   ============================================ */

/* ---- BOOT SEQUENCE ---- */
#boot-screen {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: #0a0a0a;
  z-index: 99999;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  font-family: 'Space Mono', monospace;
  color: #3DF2E5;
  transition: opacity 0.5s ease;
}

#boot-screen.fade-out {
  opacity: 0;
  pointer-events: none;
}

.boot__text {
  font-size: 14px;
  margin-bottom: 24px;
  min-height: 80px;
  text-align: left;
  width: 300px;
}

.boot__text-line {
  opacity: 0;
  margin-bottom: 4px;
}

.boot__text-line.visible {
  opacity: 1;
}

.boot__cursor {
  display: inline-block;
  animation: blink-cursor 0.8s step-end infinite;
}

.boot__progress-container {
  width: 300px;
  height: 4px;
  background: #1a1a1a;
  border-radius: 2px;
  overflow: hidden;
  opacity: 0;
  transition: opacity 0.2s ease;
}

.boot__progress-container.visible {
  opacity: 1;
}

.boot__progress-bar {
  height: 100%;
  width: 0;
  background: #3DF2E5;
  border-radius: 2px;
  transition: width 1.5s ease-in-out;
}

.boot__progress-bar.loading {
  width: 100%;
}

@keyframes blink-cursor {
  0%, 100% { opacity: 1; }
  50% { opacity: 0; }
}

/* ---- DESKTOP ELEMENTS ---- */
#menubar {
  transform: translateY(-100%);
  transition: transform 0.3s ease;
}

#menubar.visible {
  transform: translateY(0);
}

#taskbar {
  transform: translateY(100%);
  transition: transform 0.3s ease;
}

#taskbar.visible {
  transform: translateY(0);
}

.desktop-icon {
  opacity: 0;
  transform: scale(0.5);
  transition: opacity 0.2s ease, transform 0.2s ease, background-color 0.1s ease;
}

.desktop-icon.visible {
  opacity: 1;
  transform: scale(1);
}

/* ---- WINDOW ANIMATIONS ---- */
.window--opening {
  animation: window-open 0.2s ease-out forwards;
}

.window--closing {
  animation: window-close 0.15s ease-in forwards;
  pointer-events: none;
}

.window--minimizing {
  animation: window-minimize 0.2s ease-in forwards;
  pointer-events: none;
}

.window--restoring {
  animation: window-restore 0.2s ease-out forwards;
}

@keyframes window-open {
  from {
    opacity: 0;
    transform: scale(0.88);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

@keyframes window-close {
  from {
    opacity: 1;
    transform: scale(1);
  }
  to {
    opacity: 0;
    transform: scale(0.88);
  }
}

@keyframes window-minimize {
  from {
    opacity: 1;
    transform: scale(1);
  }
  to {
    opacity: 0;
    transform: scale(0.5) translateY(50%);
  }
}

@keyframes window-restore {
  from {
    opacity: 0;
    transform: scale(0.5) translateY(50%);
  }
  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

/* ---- DROPDOWN ANIMATION ---- */
.menubar__dropdown {
  transform-origin: top left;
  animation: dropdown-open 0.12s ease-out;
}

@keyframes dropdown-open {
  from {
    opacity: 0;
    transform: scaleY(0.95);
  }
  to {
    opacity: 1;
    transform: scaleY(1);
  }
}

/* ---- MOBILE MENU ---- */
@keyframes mobile-menu-in {
  from { opacity: 0; transform: translateY(-10px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ---- REDUCED MOTION ---- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
