/* styles/shell.css */

/* Global Reset & Base Layout - Comic Sans for Meme OS */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  user-select: none;
  -webkit-user-drag: none;
}

html, body {
  width: 100vw;
  height: 100vh;
  overflow: hidden;
  font-family: var(--font-ui);
  background-color: var(--color-surface-0);
  color: var(--color-text-primary);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  
  /* Classic Doge Custom Cursor */
  cursor: url('../assets/cursors/doge_pointer.png'), auto !important;
}

button, a, input, textarea, select {
  cursor: url('../assets/cursors/doge_pointer.png'), auto !important;
}

/* Fullscreen Layering System */
#os-desktop {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 28px; /* Classic thin taskbar height */
  z-index: var(--z-desktop);
  overflow: hidden;
  background-color: #008080; /* Windows 95 solid teal */
  background-size: cover;
  background-position: center;
  transition: background-image 0.2s steps(2, end);
}

#os-window-layer {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 28px;
  z-index: var(--z-windows);
  overflow: hidden;
  pointer-events: none;
}

/* Classic Taskbar - Light Gray rectangular bar with raised top border */
#os-taskbar {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 28px;
  z-index: var(--z-taskbar);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 2px 4px;
  background-color: #c0c0c0;
  
  /* 3D border: raised top border */
  border-top: 2px solid #ffffff;
  border-bottom: 1px solid #c0c0c0;
  box-shadow: 0 -1px 0px #808080;
}

#os-overlay-layer {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: var(--z-overlay);
  pointer-events: none;
}

/* Wallpaper Background Custom Classes */
.os-wallpaper--doge-vaporwave {
  background-image: url('../assets/wallpapers/doge_vaporwave.png') !important;
  background-size: cover;
  background-position: center;
}
.os-wallpaper--gradient-blue {
  background-image: url('../assets/wallpapers/troll_vaporwave.png') !important;
  background-size: cover;
  background-position: center;
}
.os-wallpaper--gradient-dark {
  background-image: url('../assets/wallpapers/pepe_vaporwave.png') !important;
  background-size: cover;
  background-position: center;
}

/* Desktop Selection Lasso - dotted selection box */
.os-desktop-lasso {
  position: absolute;
  background-color: rgba(255, 255, 255, 0.05);
  border: 1px dotted #ffffff;
  pointer-events: none;
  z-index: 5;
  display: none;
}

/* Desktop Pinned Shortcuts Grid - Enlarged for full names */
.os-desktop-shortcuts {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 16px 12px;
  display: grid;
  grid-template-columns: repeat(auto-fill, 96px); /* Wider columns */
  grid-template-rows: repeat(auto-fill, 100px); /* Taller rows */
  grid-auto-flow: column;
  gap: 16px;
  z-index: 10;
}

.os-desktop-shortcut {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  text-align: center;
  padding: 4px;
  border: 1px solid transparent;
  width: 92px !important;
  height: 96px !important;
}

/* Hover rotation animation */
.os-desktop-shortcut:hover .os-desktop-shortcut-icon {
  animation: doge-coin-spin 0.6s ease-in-out;
}

@keyframes doge-coin-spin {
  0% { transform: rotateY(0deg); }
  100% { transform: rotateY(360deg); }
}

/* Desktop Shortcut custom icon replacement - enlarged icon */
.os-desktop-shortcut-icon {
  font-size: 0 !important;
  color: transparent !important;
  display: flex;
  width: 38px !important;
  height: 38px !important;
  margin-bottom: 6px !important;
  background-size: contain;
  background-repeat: no-repeat;
  background-position: center;
  image-rendering: pixelated;
}

.os-desktop-shortcut[data-app-id="welcome"] .os-desktop-shortcut-icon {
  background-image: url('../assets/icons/much_welcome.png') !important;
}
.os-desktop-shortcut[data-app-id="notepad"] .os-desktop-shortcut-icon {
  background-image: url('../assets/icons/doge_scribbles.png') !important;
}
.os-desktop-shortcut[data-app-id="settings"] .os-desktop-shortcut-icon {
  background-image: url('../assets/icons/so_settings.png') !important;
}
.os-desktop-shortcut[data-app-id="taskmanager"] .os-desktop-shortcut-icon {
  background-image: url('../assets/icons/very_performance.png') !important;
}
.os-desktop-shortcut[data-app-id="troll"] .os-desktop-shortcut-icon {
  background-image: url('../assets/icons/troll_face.png') !important;
}

.os-desktop-shortcut-name {
  font-size: 11px;
  font-weight: bold;
  color: #ffffff;
  text-shadow: 1px 1px 1px #000;
  line-height: 1.25;
  width: 100%;
  white-space: normal !important; /* Wrap text */
  overflow: visible !important;
  text-overflow: clip !important;
  word-break: break-word !important;
}

/* Classic selection look */
.os-desktop-shortcut--selected .os-desktop-shortcut-name {
  background-color: #000080 !important;
  color: #ffffff !important;
  outline: 1px dotted #ffffff;
}

/* Taskbar Layout Partitions */
.os-taskbar-left {
  display: flex;
  align-items: center;
  gap: 6px;
}

.os-taskbar-center {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  flex: 1;
  margin-left: 6px;
}

.os-taskbar-right {
  display: flex;
  align-items: center;
  gap: 8px;
}

/* Taskbar Buttons & Icons */
.os-taskbar-btn {
  border: none;
  background-color: transparent;
  color: #000000;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  outline: none;
}

/* Start Button Specifics - Classic Windows 95 look */
.os-taskbar-btn--start {
  width: 65px !important;
  height: 22px !important;
  background-color: #c0c0c0 !important;
  border-top: 2px solid #ffffff !important;
  border-left: 2px solid #ffffff !important;
  border-right: 2px solid #404040 !important;
  border-bottom: 2px solid #404040 !important;
  box-shadow: 1px 1px 0px #000000 !important;
  display: flex !important;
  flex-direction: row !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 4px !important;
  font-family: var(--font-ui) !important;
  font-weight: bold !important;
  font-size: 11px !important;
  color: #000000 !important;
  padding: 0px 4px !important;
}

.os-taskbar-btn--start::before {
  content: "";
  display: inline-block;
  width: 14px;
  height: 14px;
  background-image: url('../assets/icons/doge_start.png');
  background-size: contain;
  background-repeat: no-repeat;
  background-position: center;
  image-rendering: pixelated;
}

.os-taskbar-btn--start::after {
  content: "Start";
}

.os-taskbar-btn--start:active {
  border-top: 2px solid #404040 !important;
  border-left: 2px solid #404040 !important;
  border-right: 2px solid #ffffff !important;
  border-bottom: 2px solid #ffffff !important;
  padding-top: 1px !important;
  padding-left: 1px !important;
}

.start-icon {
  display: none !important; /* Hide modern start SVG */
}

.os-taskbar-apps {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-left: 6px;
}

/* Left alignment forced (like classic Windows 95) */
.os-taskbar--align-center .os-taskbar-center {
  justify-content: flex-start !important;
}

/* Wide, rectangular taskbar button for running applications */
/* Wide, rectangular taskbar button for applications */
.os-taskbar-app {
  position: relative;
  display: flex !important;
  flex-direction: row !important;
  align-items: center !important;
  justify-content: flex-start !important;
  width: 120px !important;
  height: 22px !important;
  border-radius: 0px !important;
  padding: 0 4px !important;
  font-family: var(--font-ui) !important;
  font-size: 10px !important;
  font-weight: bold !important;
  color: #000000 !important;
  gap: 4px !important;

  /* Closed / Pinned State: flat, dashed border, semi-transparent */
  background-color: transparent !important;
  border: 1px dashed #808080 !important;
  box-shadow: none !important;
  opacity: 0.55 !important;
}

/* Custom Text Labels for taskbar buttons */
.os-taskbar-app[data-app-id="welcome"]::after { content: "Much Welcome"; }
.os-taskbar-app[data-app-id="notepad"]::after { content: "Doge Scribbles"; }
.os-taskbar-app[data-app-id="settings"]::after { content: "So Settings"; }
.os-taskbar-app[data-app-id="taskmanager"]::after { content: "Very Performance"; }
.os-taskbar-app[data-app-id="troll"]::after { content: "Troll Machine"; }

/* Running & Unfocused State: solid grey, raised 3D bevel, fully opaque */
.os-taskbar-app--running {
  background-color: #c0c0c0 !important;
  border-top: 1.5px solid #ffffff !important;
  border-left: 1.5px solid #ffffff !important;
  border-right: 1.5px solid #404040 !important;
  border-bottom: 1.5px solid #404040 !important;
  box-shadow: 1px 1px 0px #000000 !important;
  opacity: 1 !important;
}

/* Running & Focused State: sunken pressed look, dotted focus ring inside */
.os-taskbar-app--running.os-taskbar-app--focused {
  background-color: #dfdfdf !important;
  border-top: 1.5px solid #404040 !important;
  border-left: 1.5px solid #404040 !important;
  border-right: 1.5px solid #ffffff !important;
  border-bottom: 1.5px solid #ffffff !important;
  box-shadow: inset 1px 1px 0px #000000 !important;
  outline: 1px dotted #000 !important;
  outline-offset: -3px !important;
  opacity: 1 !important;
}

/* Running & Minimized State: raised bevel, text is italicized, slightly dim opacity */
.os-taskbar-app--running.os-taskbar-app--minimized {
  background-color: #c0c0c0 !important;
  border-top: 1.5px solid #ffffff !important;
  border-left: 1.5px solid #ffffff !important;
  border-right: 1.5px solid #404040 !important;
  border-bottom: 1.5px solid #404040 !important;
  box-shadow: 1px 1px 0px #000000 !important;
  font-style: italic !important;
  opacity: 0.8 !important;
}

.os-taskbar-app-icon {
  font-size: 0 !important;
  color: transparent !important;
  display: inline-block !important;
  width: 14px !important;
  height: 14px !important;
  background-size: contain !important;
  background-repeat: no-repeat !important;
  background-position: center !important;
  image-rendering: pixelated;
}

.os-taskbar-app[data-app-id="welcome"] .os-taskbar-app-icon {
  background-image: url('../assets/icons/much_welcome.png') !important;
}
.os-taskbar-app[data-app-id="notepad"] .os-taskbar-app-icon {
  background-image: url('../assets/icons/doge_scribbles.png') !important;
}
.os-taskbar-app[data-app-id="settings"] .os-taskbar-app-icon {
  background-image: url('../assets/icons/so_settings.png') !important;
}
.os-taskbar-app[data-app-id="taskmanager"] .os-taskbar-app-icon {
  background-image: url('../assets/icons/very_performance.png') !important;
}
.os-taskbar-app[data-app-id="troll"] .os-taskbar-app-icon {
  background-image: url('../assets/icons/troll_face.png') !important;
}

.os-taskbar-app-indicator {
  display: none !important; /* Hide modern running dot */
}

/* System Tray & Clock Bevel Box */
.os-system-tray {
  display: flex;
  align-items: center;
  gap: 6px;
  height: 22px;
  background-color: #c0c0c0;
  
  /* Inset 3D border */
  border-top: 1.5px solid #404040 !important;
  border-left: 1.5px solid #404040 !important;
  border-right: 1.5px solid #ffffff !important;
  border-bottom: 1.5px solid #ffffff !important;
  box-shadow: inset 1px 1px 0px #000000 !important;
  padding: 2px 6px !important;
}

.os-tray-icons {
  display: flex;
  align-items: center;
  gap: 4px;
}

.os-tray-icon-btn {
  width: 16px;
  height: 16px;
  border: none;
  background-color: transparent;
  color: #000;
  font-size: 11px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.os-tray-clock {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  justify-content: center;
  padding: 0 !important;
  height: auto !important;
  background: transparent !important;
  border-radius: 0px !important;
}

.os-tray-time {
  font-size: 10px;
  font-weight: bold;
  color: #000000;
}

.os-tray-date {
  display: none !important; /* Classic Win95 tray hides date */
}

/* Toast Notifications - Yellow speech bubble next to Clippy */
.os-notifications-container {
  position: absolute;
  right: 12px;
  bottom: 40px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  z-index: var(--z-notifications);
  pointer-events: auto;
  
  /* Space on the left for Clippy avatar */
  padding-left: 70px;
}

/* Pseudo element to place Clippy next to speech bubble */
.os-notifications-container::before {
  content: "";
  position: absolute;
  left: 0;
  bottom: 0;
  width: 60px;
  height: 80px;
  background-image: url('../assets/icons/clippy.png');
  background-size: contain;
  background-repeat: no-repeat;
  background-position: bottom left;
  image-rendering: pixelated;
  pointer-events: none;
}

.os-toast {
  width: 240px;
  background-color: #ffffe1; /* Clippy yellow post-it color */
  color: #000000;
  border: 1px solid #000000;
  box-shadow: 2px 2px 0px rgba(0, 0, 0, 0.5);
  border-radius: 4px;
  position: relative;
  overflow: hidden;
  opacity: 0;
  transform: translateY(10px);
  transition: opacity 0.2s, transform 0.2s;
  padding: 8px;
}

.os-toast--visible {
  opacity: 1;
  transform: translateY(0);
}

.os-toast-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px dotted #808080;
  padding-bottom: 4px;
  margin-bottom: 6px;
}

.os-toast-icon {
  font-size: 12px;
  margin-right: 4px;
}

.os-toast-title {
  font-size: 11px;
  font-weight: bold;
  flex: 1;
}

.os-toast-close-btn {
  background: transparent;
  border: none;
  font-size: 10px;
  cursor: pointer;
  font-weight: bold;
}

.os-toast-body {
  font-size: 11px;
  line-height: 1.3;
}

.os-toast-progress {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 2px;
  background-color: #808080;
}

/* Power Screen Overlay Styles - Retro boot loader */
.os-power-screen {
  position: absolute;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background-color: #008080; /* Teal background for boot */
  z-index: 99999;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #ffffff;
  opacity: 1;
  transition: opacity 0.4s steps(4, end);
}

.os-power-screen--hidden {
  opacity: 0;
  pointer-events: none;
}

.power-screen-boot {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
}

.boot-logo-img {
  width: 256px;
  height: auto;
  image-rendering: pixelated;
}

.power-loader-bar-container {
  width: 180px;
  height: 10px;
  border-top: 1.5px solid #808080;
  border-left: 1.5px solid #808080;
  border-right: 1.5px solid #ffffff;
  border-bottom: 1.5px solid #ffffff;
  background-color: #000000;
  padding: 1px;
}

.power-loader-bar-fill {
  height: 100%;
  width: 0%;
  background-color: #000080;
  animation: boot-loader-progress 3.5s steps(10, end) forwards;
}

@keyframes boot-loader-progress {
  0% { width: 0%; }
  20% { width: 15%; }
  45% { width: 45%; }
  70% { width: 80%; }
  100% { width: 100%; }
}

.power-screen-shutdown {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.power-text {
  font-size: 14px;
  font-weight: bold;
  color: #c0c0c0;
  text-shadow: 1px 1px 1px #000;
  font-family: var(--font-ui);
}

/* Goofy Meme Animations */
.os-window {
  animation: window-intro-spin 0.35s steps(8, end) forwards;
}

.os-start-menu--open {
  animation: start-menu-grow 0.2s steps(5, end) forwards !important;
}

.os-toast--visible {
  animation: clippy-toast-bounce 0.4s steps(6, end) forwards !important;
}

.os-taskbar-btn--start:hover {
  animation: start-wiggle 0.3s infinite alternate;
}

.os-desktop-shortcut--selected {
  animation: shortcut-pulse 1s infinite alternate;
}

@keyframes window-intro-spin {
  0% { transform: scale(0.1) rotate(-15deg); opacity: 0; }
  70% { transform: scale(1.05) rotate(2deg); }
  100% { transform: scale(1) rotate(0deg); opacity: 1; }
}

@keyframes start-menu-grow {
  0% { transform: scaleY(0); opacity: 0; transform-origin: bottom; }
  100% { transform: scaleY(1); opacity: 1; transform-origin: bottom; }
}

@keyframes clippy-toast-bounce {
  0% { transform: translateY(50px) scale(0.8); opacity: 0; }
  50% { transform: translateY(-10px) scale(1.05); }
  100% { transform: translateY(0) scale(1); opacity: 1; }
}

@keyframes start-wiggle {
  0% { transform: translate(1px, 1px) rotate(0deg); }
  100% { transform: translate(-1px, -1px) rotate(1deg); }
}

@keyframes shortcut-pulse {
  0% { transform: scale(1); }
  100% { transform: scale(1.04); }
}
