@font-face {
  font-family: "w95font";
  src:
    url("./assets/w95font.woff2") format("woff2"),
    url("./assets/w95font.woff") format("woff");
  font-weight: normal;
  font-style: normal;
}

@font-face {
  font-family: "w95font";
  src:
    url("./assets/w95font-bold.woff2") format("woff2"),
    url("./assets/w95font-bold.woff") format("woff");
  font-weight: bold;
  font-style: normal;
}

body {
  margin: 0;
  background: #1b1d1d;
  overflow: hidden;
  font-family: "w95font", sans-serif;
  font-size: 10px;
  user-select: none;
}

.desktop {
  width: 250px;
  height: 250px;
  background-color: #008080;
  position: relative;
  overflow: hidden;
  border: 1px solid #000;
  touch-action: none; /* Prevent browser scrolling on desktop */
}

/* Estilo Windows 95 (Chicago) */
.window {
  position: absolute;
  background: #c0c0c0;
  border: 2px solid;
  border-color: #fff #808080 #808080 #fff;
  padding: 2px;
  box-shadow: 1px 1px 0 #000;
  display: flex;
  flex-direction: column;
  z-index: 10;
  box-sizing: border-box;
}

.title-bar {
  background: #808080; /* Inactive Grey */
  color: #c0c0c0;
  padding: 2px 3px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  cursor: default;
  user-select: none;
  flex-shrink: 0;
  touch-action: none;
  z-index: 5;
}

.window.active .title-bar {
  background: #000080; /* Active Blue */
  color: white;
}

.title {
  font-weight: bold;
  white-space: nowrap;
  font-size: 9px;
  overflow: hidden;
  text-overflow: ellipsis;
  flex-grow: 1;
  min-width: 0;
  margin-right: 4px;
}

.controls {
  display: flex;
  gap: 0;
  flex-shrink: 0;
}

.controls button {
  width: 12px;
  height: 12px;
  font-size: 8px;
  background: #c0c0c0;
  border: 1px solid;
  border-color: #fff #808080 #808080 #fff;
  box-shadow: 1px 1px 0 #000;
  cursor: pointer;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  font-family: "w95font", sans-serif;
  font-weight: bold;
  position: relative;
  z-index: 200; /* Ensure buttons are clickable over resizers */
  touch-action: none;
}

.controls button.min-btn {
  align-items: flex-end;
  padding-bottom: 3px;
  margin-right: 1px;
  font-size: 12px;
  line-height: 0.6;
}

.controls button.max-btn {
  padding: 0;
}

.max-icon {
  width: 8px;
  height: 8px;
  border: 1px solid black;
  border-top-width: 2px;
  box-sizing: border-box;
}

.controls button.close-btn {
  font-size: 10px;
  margin-left: 2px;
}

.controls button:active {
  border-color: #808080 #fff #fff #808080;
  padding-top: 1px;
  padding-left: 1px;
  box-shadow: none;
}

.window-body {
  padding: 2px;
  flex-grow: 1;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 0;
  touch-action: pan-y; /* Allow vertical scrolling inside windows */
}

.window-body a {
  display: block;
  width: 100%;
}

.content-img {
  width: 100%;
  height: auto;
  display: block;
  image-rendering: pixelated;
}
.content-gif {
  width: 100%;
  height: auto;
  display: block;
  image-rendering: pixelated;
}

.content-img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  image-rendering: pixelated;
}

.content-gif {
  width: 100%;
  height: 100%;
  object-fit: contain;
  image-rendering: pixelated;
  display: block;
}

/* Resizers */
.resizer {
  position: absolute;
  z-index: 100;
  touch-action: none;
}
/* Offset by -5px to ensure they don't overlap the content (title bar) */
.resizer.n {
  top: -5px;
  left: 0;
  width: 100%;
  height: 5px;
  cursor: n-resize;
}
.resizer.s {
  bottom: -5px;
  left: 0;
  width: 100%;
  height: 5px;
  cursor: s-resize;
}
.resizer.e {
  top: 0;
  right: -5px;
  width: 5px;
  height: 100%;
  cursor: e-resize;
}
.resizer.w {
  top: 0;
  left: -5px;
  width: 5px;
  height: 100%;
  cursor: w-resize;
}
.resizer.ne {
  top: -5px;
  right: -5px;
  width: 8px;
  height: 8px;
  cursor: ne-resize;
}
.resizer.nw {
  top: -5px;
  left: -5px;
  width: 8px;
  height: 8px;
  cursor: nw-resize;
}
.resizer.se {
  bottom: -5px;
  right: -5px;
  width: 8px;
  height: 8px;
  cursor: se-resize;
}
.resizer.sw {
  bottom: -5px;
  left: -5px;
  width: 8px;
  height: 8px;
  cursor: sw-resize;
}

/* Desktop Icons */
.desktop-icon {
  position: absolute;
  width: 60px;
  display: flex;
  flex-direction: column;
  align-items: center;
  color: white;
  text-align: center;
  cursor: pointer;
  z-index: 1;
  touch-action: none;
}

.desktop-icon img {
  width: 32px;
  height: 32px;
  margin-bottom: 2px;
}

.desktop-icon span {
  font-size: 9px;
  text-shadow: 1px 1px 1px black;
  padding: 1px 2px;
}

.desktop-icon:active span,
.desktop-icon.selected span {
  background: #000080;
  border: 1px dotted white;
}

/* Start Menu */
.start-menu {
  position: absolute;
  bottom: 22px;
  left: 0;
  width: 120px;
  background: #c0c0c0;
  border: 2px solid;
  border-color: #fff #808080 #808080 #fff;
  display: flex;
  z-index: 1000; /* Increased z-index */
  box-shadow: 2px 2px 5px rgba(0, 0, 0, 0.5);
}

.menu-sidebar {
  background: linear-gradient(to top, #000080, #1084d0);
  width: 18px;
  writing-mode: vertical-rl;
  transform: rotate(180deg);
  color: #fff;
  padding: 5px 2px;
  font-size: 11px;
  font-weight: bold;
  display: flex;
  align-items: center;
  text-align: center;
}

.menu-items {
  flex-grow: 1;
  display: flex;
  flex-direction: column;
  background: #c0c0c0;
}

.menu-item {
  padding: 3px 6px;
  text-decoration: none;
  color: #000;
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 9px;
}

.menu-item img {
  width: 14px;
  height: 14px;
  image-rendering: pixelated;
}
.menu-item:hover {
  background: #000080;
  color: #fff;
}

/* Taskbar */
.taskbar {
  position: absolute;
  bottom: 0;
  width: 100%;
  height: 22px;
  background: #c0c0c0;
  border-top: 2px solid #fff;
  display: flex;
  align-items: center;
  padding: 2px;
  box-sizing: border-box;
  z-index: 900;
  justify-content: space-between;
}

.taskbar-clock {
  margin-left: 4px;
  border: 1px solid;
  border-color: #808080 #fff #fff #808080;
  background: #c0c0c0;
  padding: 0 4px;
  height: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 9px;
  min-width: 40px;
}

.start-btn {
  display: flex;
  align-items: center;
  gap: 3px;
  font-weight: bold;
  height: 16px;
  padding: 0 4px;
  border: 2px solid;
  border-color: #fff #808080 #808080 #fff;
  background: #c0c0c0;
  font-size: 10px;
  font-family: inherit;
  cursor: pointer;
  touch-action: none;
}

.start-btn:active,
.start-btn.active {
  border-color: #808080 #fff #fff #808080;
}
.start-icon {
  width: 12px;
  height: 12px;
  image-rendering: pixelated;
}

.task-items {
  display: flex;
  gap: 2px;
  margin-left: 4px;
  flex-grow: 1;
  overflow: hidden;
}

.task-item {
  height: 16px;
  font-size: 9px;
  background: #c0c0c0;
  border: 2px solid;
  border-color: #fff #808080 #808080 #fff;
  padding: 0 4px;
  width: auto;
  flex-grow: 1;
  flex-basis: 0;
  max-width: 50%;
  min-width: 0;
  overflow: hidden;
  white-space: nowrap;
  cursor: pointer;
  font-family: inherit;
  text-align: left;
  text-overflow: ellipsis;
  touch-action: none;
}

.task-item.active {
  background: #e0e0e0;
  border-color: #808080 #fff #fff #808080;
  font-weight: bold;
}

@font-face {
  font-family: "dosfont";
  src: url("./assets/LessPerfectDOSVGA.ttf") format("truetype");
  font-weight: normal;
  font-style: normal;
}

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

.blink-cursor {
  display: inline-block;
  width: 6px;
  height: 10px;
  background: white;
  vertical-align: text-bottom;
  animation: blink 1s step-end infinite;
}

.hidden {
  display: none !important;
}

#win-note .window-body,
#win-fetch .window-body {
  user-select: text;
  cursor: text;
}
