/* Desktop, Boot, Login & Title Screen Styles */

/* Screen transitions */
.screen {
  position: absolute;
  inset: 0;
  display: none !important;
  flex-direction: column;
  z-index: 10;
}

.screen.active {
  display: flex !important;
}

/* ==================================================
   PHASE 0: BOOT SCREEN
   ================================================== */
#screen-boot {
  background-color: #050505;
  color: #33ff33;
  font-family: var(--font-retro);
  padding: 40px;
  justify-content: flex-start;
  align-items: flex-start;
  overflow: hidden;
  font-size: 24px;
  line-height: 1.5;
  text-shadow: 0 0 5px rgba(51, 255, 51, 0.6);
}

.terminal-line {
  margin-bottom: 8px;
  opacity: 0;
  transform: translateY(2px);
  animation: term-appear 0.1s forwards;
}

@keyframes term-appear {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.terminal-cursor {
  display: inline-block;
  width: 12px;
  height: 20px;
  background-color: #33ff33;
  animation: term-blink 0.8s infinite;
  vertical-align: text-bottom;
}

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

/* ==================================================
   INTRO: GAMELOFT-STYLE COMPANY LOGO
   ================================================== */
#screen-company-intro {
  background-color: #000000;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  cursor: pointer;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}

.company-intro-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  position: relative;
}

.company-logo-frame {
  position: relative;
  width: 250px;
  height: 250px;
  max-width: 68vw;
  max-height: 68vw;
  background: #000000;
  border-radius: 6px;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 0 50px rgba(255, 255, 255, 0.12);
  animation: gameloft-logo-in 1.1s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.company-logo-img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}

.gameloft-shine-sweep {
  position: absolute;
  top: -60%;
  left: -120%;
  width: 60%;
  height: 220%;
  background: linear-gradient(
    90deg,
    transparent 0%,
    rgba(255, 255, 255, 0) 15%,
    rgba(255, 255, 255, 0.85) 50%,
    rgba(255, 255, 255, 0) 85%,
    transparent 100%
  );
  transform: rotate(28deg);
  pointer-events: none;
  opacity: 0;
}

@keyframes gameloft-logo-in {
  0% {
    transform: scale(0.8);
    opacity: 0;
    filter: brightness(0.2) blur(6px);
  }
  50% {
    filter: brightness(1.25) blur(0px);
  }
  100% {
    transform: scale(1);
    opacity: 1;
    filter: brightness(1) blur(0px);
  }
}

@keyframes gameloft-shine {
  0% {
    left: -120%;
    opacity: 0;
  }
  15% {
    opacity: 1;
  }
  85% {
    opacity: 1;
  }
  100% {
    left: 160%;
    opacity: 0;
  }
}

.company-intro-tagline {
  font-family: var(--font-pixel, monospace);
  font-size: 15px;
  letter-spacing: 8px;
  color: #a4b0be;
  margin-top: 26px;
  opacity: 0;
  text-shadow: 0 0 12px rgba(255, 255, 255, 0.4);
  animation: gameloft-text-fade 0.8s ease forwards 0.8s;
}

@keyframes gameloft-text-fade {
  0% {
    opacity: 0;
    transform: translateY(8px);
  }
  100% {
    opacity: 0.95;
    transform: translateY(0);
  }
}

.company-skip-hint {
  position: absolute;
  bottom: 24px;
  font-size: 12px;
  letter-spacing: 2px;
  color: #4b5262;
  font-family: var(--font-pixel, monospace);
  opacity: 0;
  animation: gameloft-text-fade 0.6s ease forwards 1.2s;
  pointer-events: none;
}

/* ==================================================
   PHASE 1: LOGIN SCREEN
   ================================================== */
#screen-login {
  background-color: #245edb;
  background-image: url('../Assets/Wallpapers/windows_bliss_pixel.png');
  background-size: cover;
  background-position: center center;
  background-repeat: no-repeat;
  image-rendering: pixelated;
  align-items: center;
  justify-content: center;
  z-index: 20;
}

.login-dialog {
  width: 440px;
  padding: 6px;
  background-color: var(--retro-gray);
  box-shadow: 0 12px 36px rgba(0, 0, 0, 0.5), 4px 4px 0 #000000;
}

#screen-login.active .login-dialog {
  animation: login-appear 0.22s cubic-bezier(0.18, 0.89, 0.32, 1.28) forwards;
}

#screen-login.active .lockscreen-clock-widget {
  animation: login-appear 0.3s cubic-bezier(0.18, 0.89, 0.32, 1.28) forwards;
}

@keyframes login-appear {
  0% { transform: scale(0.94); opacity: 0; }
  100% { transform: scale(1); opacity: 1; }
}

/* ==================================================
   LOCK SCREEN BOTTOM RIGHT CLOCK & DATE (PIXEL FONT)
   ================================================== */
.lockscreen-clock-widget {
  position: absolute;
  right: 28px;
  bottom: 24px;
  text-align: right;
  z-index: 25;
  pointer-events: none;
  font-family: var(--font-pixel, 'Silkscreen', monospace);
  color: #ffffff;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 4px;
  text-shadow: 2px 2px 0 #000000, -1px -1px 0 #000000, 1px -1px 0 #000000, -1px 1px 0 #000000, 0 3px 12px rgba(0, 0, 0, 0.9);
  user-select: none;
}

.lockscreen-time {
  font-size: 34px;
  line-height: 1.1;
  font-weight: 700;
  letter-spacing: 1.5px;
  color: #ffffff;
}

.lockscreen-date {
  font-size: 13px;
  line-height: 1.2;
  letter-spacing: 1px;
  color: #f1f2f6;
  opacity: 0.95;
  text-transform: uppercase;
}

@media (max-width: 600px), (max-height: 520px) {
  .lockscreen-clock-widget {
    right: 16px;
    bottom: 14px;
    gap: 2px;
  }
  .lockscreen-time {
    font-size: 22px;
    letter-spacing: 1px;
  }
  .lockscreen-date {
    font-size: 10px;
    letter-spacing: 0.5px;
  }
}

.login-header {
  background: linear-gradient(90deg, #000080, #1084d0);
  color: #ffffff;
  padding: 6px 12px;
  font-family: var(--font-pixel);
  font-size: 14px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.login-body {
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.login-user-row {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 22px;
  font-weight: bold;
}

.login-user-avatar {
  width: 54px;
  height: 54px;
  background: #fff;
  border: 2px solid #808080;
  border-radius: 50%;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 28px;
  flex-shrink: 0;
}

.login-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.login-field label {
  font-size: 18px;
  color: #222;
}

.login-input {
  width: 100%;
  padding: 8px 12px;
  font-size: 20px;
  font-family: var(--font-mono);
  outline: none;
  background-color: #ffffff;
}

.login-hint {
  font-size: 16px;
  color: #555;
  font-style: italic;
}

.login-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 10px;
}

.retro-btn {
  padding: 6px 16px;
  font-size: 18px;
  font-family: var(--font-retro);
  background-color: var(--retro-gray);
  border-top: 2px solid #ffffff;
  border-left: 2px solid #ffffff;
  border-right: 2px solid #000000;
  border-bottom: 2px solid #000000;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.retro-btn:active {
  border-top: 2px solid #000000;
  border-left: 2px solid #000000;
  border-right: 2px solid #ffffff;
  border-bottom: 2px solid #ffffff;
  transform: translate(1px, 1px);
}

.login-feedback {
  min-height: 44px;
  padding: 8px;
  font-size: 16px;
  line-height: 1.3;
  color: #b00020;
  background: #ffebee;
  border: 1px solid #ffcdd2;
  white-space: pre-line;
}

/* ==================================================
   PHASE 2: TITLE SCREEN
   ================================================== */
#screen-title {
  background: radial-gradient(circle at center, #2d3436 0%, #111417 100%);
  color: #ffffff;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 40px;
}

.title-card {
  max-width: 600px;
  width: 90%;
  padding: 30px;
  background-color: rgba(20, 24, 30, 0.95);
  border: 3px solid #ff4757;
  box-shadow: 0 0 30px rgba(255, 71, 87, 0.3), inset 0 0 15px rgba(0,0,0,0.8);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
}

.title-main {
  font-family: var(--font-pixel);
  font-size: 32px;
  color: #ff4757;
  text-shadow: 3px 3px 0 #000;
  letter-spacing: 2px;
}

.title-sub {
  font-size: 22px;
  color: #ced6e0;
}

.title-creator {
  font-size: 20px;
  color: #ffa502;
}

.title-advisory {
  font-size: 18px;
  color: #a4b0be;
  line-height: 1.6;
  white-space: pre-line;
  padding: 15px;
  border-top: 1px dashed #57606f;
  border-bottom: 1px dashed #57606f;
  margin: 10px 0;
}

/* ==================================================
   PHASE 3+: DESKTOP SCREEN & TASKBAR
   ================================================== */
#screen-desktop {
  background-color: #245edb;
  background-image: url('../Assets/Wallpapers/windows_bliss_pixel.png');
  background-size: cover;
  background-position: center center;
  background-repeat: no-repeat;
  position: absolute;
  inset: 0;
  display: none;
  flex-direction: column;
  overflow: hidden;
  transition: background 0.3s;
}

#screen-desktop.theme-wallpaperrrr {
  background-color: #0b0f19;
  background-image: url('../Assets/Wallpapers/wallpaperrrr.gif');
  background-size: cover;
  background-position: center center;
  background-repeat: no-repeat;
}

#screen-desktop.theme-spoodermon {
  background-color: #0b0f19;
  background-image: url('../Assets/Wallpapers/spoodermon.jpg');
  background-size: cover;
  background-position: center center;
  background-repeat: no-repeat;
}

#screen-desktop.theme-arsenal-squad {
  background-color: #1a162b;
  background-image: url('../Assets/Wallpapers/arsenal_squad_16_9.jpg?v=hd');
  background-size: cover;
  background-position: center center;
  background-repeat: no-repeat;
}

#screen-desktop.theme-windows-bliss {
  background-color: #245edb;
  background-image: url('../Assets/Wallpapers/windows_bliss_pixel.png');
  background-size: cover;
  background-position: center center;
  background-repeat: no-repeat;
  image-rendering: pixelated;
}

#screen-desktop.theme-romantic {
  background: radial-gradient(circle at 50% 50%, rgba(255, 71, 87, 0.2) 0%, transparent 60%), linear-gradient(135deg, #2c0b1e 0%, #11050d 100%);
}

.desktop-workspace {
  flex: 1;
  position: relative;
  overflow: hidden;
  padding: 16px;
}

/* Desktop Icon Grid */
.desktop-icons-container {
  display: flex;
  flex-direction: column;
  flex-wrap: wrap;
  align-content: flex-start;
  gap: 16px;
  height: calc(100% - 20px);
  width: max-content;
}

.desktop-icon {
  width: 86px;
  height: 86px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 6px;
  color: #ffffff;
  text-align: center;
  border: 1px dotted transparent;
  cursor: pointer;
  border-radius: 2px;
  transition: background 0.1s;
}

.desktop-icon:hover {
  background-color: rgba(255, 255, 255, 0.15);
}

.desktop-icon.selected {
  background-color: rgba(0, 0, 128, 0.6);
  border-color: #ffffff;
}

.desktop-icon.pulse-highlight {
  animation: retro-pulse-glow 1.2s infinite alternate;
}

@keyframes retro-pulse-glow {
  0% {
    background-color: rgba(231, 76, 60, 0.25);
    box-shadow: 0 0 6px #e74c3c;
    border-color: #ff4757;
  }
  100% {
    background-color: rgba(231, 76, 60, 0.65);
    box-shadow: 0 0 16px #ff4757;
    border-color: #ffffff;
  }
}

.desktop-icon-img {
  width: 44px;
  height: 44px;
  object-fit: contain;
}

.desktop-icon-label {
  font-size: 15px;
  line-height: 1.1;
  text-shadow: 1px 1px 2px #000000;
  max-width: 80px;
  word-wrap: break-word;
  font-family: var(--font-retro);
}

/* Taskbar */
.taskbar {
  height: 38px;
  background-color: var(--retro-gray);
  border-top: 2px solid var(--retro-border-light);
  display: flex;
  align-items: center;
  padding: 2px 4px;
  gap: 4px;
  z-index: 50000;
}

.start-btn {
  font-family: var(--font-pixel);
  font-size: 13px;
  font-weight: bold;
  height: 30px;
  padding: 0 10px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.taskbar-divider {
  width: 2px;
  height: 26px;
  border-left: 1px solid #808080;
  border-right: 1px solid #ffffff;
  margin: 0 3px;
}

.taskbar-windows-list {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 4px;
  overflow-x: auto;
  height: 100%;
}

.taskbar-tab {
  height: 28px;
  max-width: 160px;
  min-width: 90px;
  padding: 0 8px;
  font-size: 15px;
  display: flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.taskbar-tab.active {
  border-top: 2px solid #000000;
  border-left: 2px solid #000000;
  border-right: 2px solid #ffffff;
  border-bottom: 2px solid #ffffff;
  background-color: #e4e4e4;
  font-weight: bold;
}

/* System Tray */
.taskbar-tray {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 2px 8px;
  height: 28px;
  border-top: 1px solid #808080;
  border-left: 1px solid #808080;
  border-right: 1px solid #ffffff;
  border-bottom: 1px solid #ffffff;
  background: rgba(0, 0, 0, 0.05);
}

.tray-icon-btn {
  background: none;
  border: none;
  font-size: 16px;
  padding: 2px 4px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

.tray-pixel-icon {
  width: 16px;
  height: 16px;
  image-rendering: pixelated;
  image-rendering: -moz-crisp-edges;
  image-rendering: crisp-edges;
}

.tray-clock {
  font-size: 16px;
  font-family: var(--font-retro);
  color: #111;
  padding-left: 4px;
}

/* Start Menu Popup */
#start-menu {
  position: absolute;
  bottom: 40px;
  left: 4px;
  width: 220px;
  background: var(--retro-gray);
  border-top: 2px solid #fff;
  border-left: 2px solid #fff;
  border-right: 2px solid #000;
  border-bottom: 2px solid #000;
  box-shadow: 4px 4px 0 rgba(0,0,0,0.5);
  display: none;
  flex-direction: column;
  z-index: 60000;
}

#start-menu.open {
  display: flex;
}

.start-menu-sidebar {
  background: linear-gradient(180deg, #000080 0%, #1084d0 100%);
  color: #ffffff;
  font-family: var(--font-pixel);
  font-size: 14px;
  padding: 10px 8px;
  writing-mode: vertical-rl;
  transform: rotate(180deg);
  letter-spacing: 2px;
}

.start-menu-items {
  display: flex;
  flex-direction: column;
  padding: 4px 0;
  flex: 1;
}

.start-menu-item {
  padding: 8px 14px;
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 16px;
  cursor: pointer;
}

.start-menu-item:hover {
  background-color: #000080;
  color: #ffffff;
}

/* Toast Notifications */
#toast-container {
  position: absolute;
  bottom: 48px;
  right: 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  z-index: 70000;
  pointer-events: none;
}

.retro-toast {
  width: 280px;
  background-color: #ffffe1;
  border: 1px solid #000000;
  box-shadow: 3px 3px 0 rgba(0,0,0,0.4);
  padding: 10px;
  font-family: var(--font-retro);
  font-size: 16px;
  color: #111;
  pointer-events: auto;
  display: flex;
  align-items: flex-start;
  gap: 10px;
  animation: toast-in 0.2s ease-out;
}

@keyframes toast-in {
  from { transform: translateX(50px); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}

.toast-title {
  font-weight: bold;
  font-size: 17px;
  margin-bottom: 2px;
  color: #000080;
}

/* Mobile & Touchscreen Desktop Styling */
@media (max-width: 820px), (max-height: 560px), (pointer: coarse) {
  .login-dialog {
    width: 92vw !important;
    max-width: 420px !important;
    padding: 4px !important;
  }

  .login-body {
    padding: 14px 10px !important;
    gap: 12px !important;
  }

  .login-user-row {
    font-size: 18px !important;
  }

  .login-user-avatar {
    width: 44px !important;
    height: 44px !important;
  }

  .login-input {
    font-size: 16px !important;
    padding: 8px 10px !important;
  }

  .login-actions .retro-btn {
    padding: 8px 20px !important;
    font-size: 17px !important;
  }

  .title-card {
    padding: 16px !important;
    max-width: 94vw !important;
    gap: 14px !important;
  }

  .title-main {
    font-size: 24px !important;
  }

  .title-sub {
    font-size: 17px !important;
  }

  .title-advisory {
    font-size: 15px !important;
    padding: 10px !important;
    line-height: 1.4 !important;
  }

  .desktop-workspace {
    padding: 0 !important;
  }

  .login-dialog {
    width: 380px !important;
    max-width: calc(100vw - 40px) !important;
    padding: 4px !important;
  }

  .login-body {
    padding: 12px 16px !important;
    gap: 10px !important;
  }

  .login-user-avatar {
    width: 40px !important;
    height: 40px !important;
  }

  .login-user-row {
    font-size: 18px !important;
  }

  .desktop-workspace {
    padding: 0 !important;
  }

  .desktop-icons-container {
    flex-direction: column !important;
    flex-wrap: wrap !important;
    align-content: flex-start !important;
    width: max-content !important;
    height: 100% !important;
    gap: 8px !important;
    padding: 10px 12px !important;
  }

  .desktop-icon {
    width: 68px !important;
    height: 68px !important;
    padding: 3px !important;
    touch-action: manipulation;
  }

  .desktop-icon-img {
    width: 34px !important;
    height: 34px !important;
  }

  .desktop-icon-label {
    font-size: 12px !important;
    max-width: 64px !important;
  }

  .taskbar {
    height: 34px !important;
    padding: 2px 4px !important;
  }

  .start-btn {
    height: 28px !important;
    padding: 0 8px !important;
    font-size: 13px !important;
    touch-action: manipulation;
  }

  .taskbar-tab {
    height: 26px !important;
    min-width: 70px !important;
    max-width: 150px !important;
    font-size: 12px !important;
    padding: 0 6px !important;
    touch-action: manipulation;
  }

  .taskbar-tray {
    height: 26px !important;
    padding: 2px 4px !important;
    gap: 4px !important;
  }

  .tray-icon-btn {
    padding: 2px 4px !important;
    touch-action: manipulation;
  }

  .tray-clock {
    font-size: 12px !important;
    padding-left: 2px !important;
  }

  #start-menu {
    bottom: 36px !important;
    width: 220px !important;
    max-width: 80vw !important;
  }

  .start-menu-item {
    padding: 8px 12px !important;
    font-size: 15px !important;
    touch-action: manipulation;
  }

  #toast-container {
    bottom: 40px !important;
    right: 8px !important;
    left: 8px !important;
  }

  .retro-toast {
    width: 100% !important;
    max-width: 100% !important;
  }
}

