/* ============================================
   WIN95 DESKTOP & WINDOW SYSTEM
   ============================================ */

* { box-sizing: border-box; margin: 0; padding: 0; }

@import url('https://fonts.googleapis.com/css2?family=VT323&display=swap');

body {
  font-family: 'MS Sans Serif', 'Microsoft Sans Serif', Arial, sans-serif;
  font-size: 12px;
  overflow: hidden;
  width: 100vw;
  height: 100vh;
  background: #008080; /* Win95 teal */
  cursor: default;
  user-select: none;
}

/* ---- DESKTOP ---- */
#desktop {
  width: 100vw;
  height: calc(100vh - 32px);
  position: relative;
  overflow: hidden;
  background:
    #008080
    url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" width="4" height="4"><rect width="4" height="4" fill="%23008080"/><rect x="0" y="0" width="1" height="1" fill="%23007373" opacity="0.4"/></svg>');
}

/* ---- DESKTOP ICONS ---- */
.desktop-icon {
  position: absolute;
  width: 72px;
  text-align: center;
  cursor: pointer;
  padding: 4px;
  color: white;
  text-shadow: 1px 1px 2px black;
}
.desktop-icon img {
  width: 32px;
  height: 32px;
  display: block;
  margin: 0 auto 3px;
  image-rendering: pixelated;
}
.desktop-icon span {
  font-size: 11px;
  display: block;
  word-wrap: break-word;
  line-height: 1.2;
}
.desktop-icon:hover span {
  background: #000080;
  color: white;
}

/* ---- WIN95 WINDOW SYSTEM ---- */
.win95-window {
  position: absolute;
  background: #c0c0c0;
  border: 2px solid;
  border-color: #ffffff #808080 #808080 #ffffff;
  box-shadow: 2px 2px 0 #000;
  min-width: 200px;
  min-height: 100px;
  display: flex;
  flex-direction: column;
}

.win95-titlebar {
  background: linear-gradient(to right, #000080, #1084d0);
  color: white;
  height: 22px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 2px;
  cursor: move;
  flex-shrink: 0;
}

.titlebar-left {
  display: flex;
  align-items: center;
  gap: 4px;
  font-weight: bold;
  font-size: 11px;
  white-space: nowrap;
  overflow: hidden;
}

.title-icon {
  width: 14px;
  height: 14px;
  image-rendering: pixelated;
}

.titlebar-buttons {
  display: flex;
  gap: 2px;
  flex-shrink: 0;
}

.win95-btn {
  font-family: inherit;
  font-size: 11px;
  background: #c0c0c0;
  border: 2px solid;
  border-color: #ffffff #808080 #808080 #ffffff;
  cursor: pointer;
  padding: 0;
  height: 16px;
  min-width: 16px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}
.win95-btn:active {
  border-color: #808080 #ffffff #ffffff #808080;
}

.title-btn {
  width: 16px;
  height: 14px;
  font-size: 9px;
  font-weight: bold;
  color: black;
}

.close-btn {
  color: #000;
}

/* ---- TASKBAR ---- */
#taskbar {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: 32px;
  background: #c0c0c0;
  border-top: 2px solid #ffffff;
  display: flex;
  align-items: center;
  gap: 2px;
  padding: 2px 2px;
  z-index: 9999;
}

.start-btn {
  font-family: 'MS Sans Serif', Arial, sans-serif;
  font-size: 12px;
  font-weight: bold;
  background: #c0c0c0;
  border: 2px solid;
  border-color: #ffffff #808080 #808080 #ffffff;
  height: 26px;
  padding: 0 8px 0 4px;
  display: flex;
  align-items: center;
  gap: 4px;
  cursor: pointer;
  flex-shrink: 0;
}
.start-btn:active {
  border-color: #808080 #ffffff #ffffff #808080;
}

.start-logo {
  width: 16px;
  height: 16px;
  image-rendering: pixelated;
}

.taskbar-divider {
  width: 2px;
  height: 24px;
  background: #808080;
  border-right: 1px solid #fff;
  flex-shrink: 0;
}

#taskbar-items {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 2px;
  overflow: hidden;
}

.taskbar-item {
  font-family: 'MS Sans Serif', Arial, sans-serif;
  font-size: 11px;
  background: #c0c0c0;
  border: 2px solid;
  border-color: #ffffff #808080 #808080 #ffffff;
  height: 24px;
  padding: 0 8px;
  cursor: pointer;
  white-space: nowrap;
  max-width: 160px;
  overflow: hidden;
  text-overflow: ellipsis;
  display: flex;
  align-items: center;
}
.taskbar-item.active {
  border-color: #808080 #ffffff #ffffff #808080;
  background: #b8b8b8;
}
.taskbar-item:hover { background: #d4d4d4; }

.taskbar-tray {
  display: flex;
  align-items: center;
  gap: 4px;
  background: #c0c0c0;
  border: 2px solid;
  border-color: #808080 #ffffff #ffffff #808080;
  padding: 2px 6px;
  height: 26px;
  font-size: 13px;
}

.tray-icon {
  cursor: pointer;
  font-size: 14px;
}

.taskbar-time, .tray-time {
  font-size: 11px;
  font-weight: bold;
  white-space: nowrap;
}

/* ---- START MENU ---- */
#start-menu {
  position: fixed;
  bottom: 32px;
  left: 0;
  background: #c0c0c0;
  border: 2px solid;
  border-color: #ffffff #808080 #808080 #ffffff;
  display: flex;
  z-index: 99999;
  box-shadow: 3px 3px 0 #000;
  min-width: 180px;
}

.start-menu-sidebar {
  width: 20px;
  background: linear-gradient(to top, #000080, #1084d0);
  color: white;
  font-size: 14px;
  font-weight: bold;
  writing-mode: vertical-rl;
  text-orientation: mixed;
  transform: rotate(180deg);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 4px;
  letter-spacing: 2px;
}

.start-menu-items {
  display: flex;
  flex-direction: column;
  flex: 1;
}

.start-menu-item {
  padding: 4px 20px 4px 8px;
  font-size: 12px;
  cursor: pointer;
  white-space: nowrap;
  display: flex;
  align-items: center;
  gap: 6px;
}
.start-menu-item:hover {
  background: #000080;
  color: white;
}
.start-menu-item.has-sub::after {
  content: '▶';
  margin-left: auto;
  font-size: 9px;
}

.start-menu-separator {
  height: 2px;
  background: #808080;
  border-bottom: 1px solid #fff;
  margin: 2px 4px;
}

/* ---- GENERIC WINDOW CONTENT ---- */
.generic-window-content {
  flex: 1;
  background: white;
  overflow: auto;
  border: 2px solid;
  border-color: #808080 #ffffff #ffffff #808080;
  margin: 2px;
}

.win95-statusbar {
  height: 22px;
  background: #c0c0c0;
  border-top: 1px solid #808080;
  font-size: 11px;
  display: flex;
  align-items: center;
  padding: 0 8px;
  flex-shrink: 0;
}

/* folder icon in My Computer */
.folder-icon {
  width: 64px;
  text-align: center;
  cursor: pointer;
  font-size: 10px;
  padding: 4px;
}
.folder-icon:hover { background: #000080; color: white; }

/* ---- CHAT WINDOW ---- */
.chat-toolbar {
  background: #c0c0c0;
  border-bottom: 2px solid;
  border-color: #808080 #ffffff #ffffff #808080;
  padding: 3px 8px;
  font-size: 11px;
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

.chat-toolbar-label {
  font-weight: bold;
  color: #000080;
}

.kiwi-wrapper {
  flex: 1;
  overflow: hidden;
  border: 2px inset #808080;
  margin: 2px;
}

.kiwi-wrapper iframe {
  width: 100%;
  height: 100%;
  border: none;
  display: block;
}

.chat-statusbar {
  height: 22px;
  background: #c0c0c0;
  border-top: 1px solid #808080;
  font-size: 11px;
  display: flex;
  align-items: center;
  padding: 0 8px;
  color: #000080;
  flex-shrink: 0;
}

/* ---- STARTUP OVERLAY ---- */
#startup-overlay {
  position: fixed;
  inset: 0;
  background: #000080;
  z-index: 999999;
  display: flex;
  align-items: center;
  justify-content: center;
}

.startup-box {
  text-align: center;
  color: white;
}

.startup-logo {
  margin-bottom: 24px;
}

.startup-tagline {
  font-size: 18px;
  color: #aad4ff;
  margin-bottom: 20px;
  font-style: italic;
}

.startup-connecting {
  margin: 20px auto;
  width: 300px;
}

.connecting-text {
  font-size: 14px;
  color: #aad4ff;
  margin-bottom: 8px;
}

.modem-bar {
  width: 300px;
  height: 20px;
  background: #000040;
  border: 2px inset #808080;
  overflow: hidden;
}

.modem-progress {
  height: 100%;
  width: 0%;
  background: linear-gradient(to right, #00aa00, #00ff00);
  transition: width 0.1s;
}

.startup-version {
  font-size: 11px;
  color: #7788aa;
  margin-top: 20px;
}
