/* Windows 98 Style UI */

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

body {
  font-family: 'MS Sans Serif', Arial, sans-serif;
  background-color: #008080;
  overflow: hidden;
  user-select: none;
  -webkit-user-select: none;
}

/* Desktop */
.desktop {
  width: 100vw;
  height: 100vh;
  display: flex;
  flex-direction: column-reverse;
  background: linear-gradient(135deg, #008080 0%, #0a7a7a 100%);
  position: relative;
}

.desktop-icons {
  flex: 1;
  padding: 20px;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(80px, 1fr));
  gap: 30px;
  overflow-y: auto;
  align-content: start;
}

.desktop-icon {
  width: 80px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  cursor: pointer;
  padding: 8px;
  border-radius: 4px;
  transition: background-color 0.2s;
  user-select: none;
}

.desktop-icon:hover {
  background-color: rgba(0, 0, 128, 0.3);
}

.desktop-icon:active {
  background-color: rgba(0, 0, 128, 0.5);
}

.icon-image {
  width: 48px;
  height: 48px;
  object-fit: contain;
  filter: drop-shadow(1px 1px 0 rgba(0, 0, 0, 0.3));
}

.icon-label {
  font-size: 11px;
  color: white;
  text-align: center;
  word-wrap: break-word;
  text-shadow: 1px 1px 1px rgba(0, 0, 0, 0.8);
  line-height: 1.2;
}

/* Taskbar */
.taskbar {
  height: 28px;
  background: linear-gradient(to bottom, #dfdfdf 0%, #c0c0c0 100%);
  border-top: 2px solid;
  border-color: #dfdfdf #808080 #808080 #dfdfdf;
  display: flex;
  align-items: center;
  padding: 2px 2px;
  gap: 3px;
  flex-shrink: 0;
}

.taskbar-start {
  display: flex;
  align-items: center;
}

.start-button {
  padding: 2px 6px;
  background: linear-gradient(to bottom, #dfdfdf 0%, #c0c0c0 100%);
  border: 2px outset #dfdfdf;
  border-right-color: #808080;
  border-bottom-color: #808080;
  font-size: 11px;
  font-weight: bold;
  cursor: pointer;
  font-family: 'MS Sans Serif', Arial, sans-serif;
  color: #000;
  min-width: 50px;
}

.start-button:hover {
  background: linear-gradient(to bottom, #efefef 0%, #dfdfdf 100%);
}

.start-button:active {
  border-style: inset;
  border-color: #808080 #dfdfdf #dfdfdf #808080;
}

.taskbar-content {
  flex: 1;
  display: flex;
  gap: 3px;
  align-items: center;
  overflow-x: auto;
  padding: 0 2px;
}

.taskbar-button {
  padding: 2px 6px;
  background: linear-gradient(to bottom, #dfdfdf 0%, #c0c0c0 100%);
  border: 2px outset #dfdfdf;
  border-right-color: #808080;
  border-bottom-color: #808080;
  font-size: 11px;
  cursor: pointer;
  font-family: 'MS Sans Serif', Arial, sans-serif;
  color: #000;
  white-space: nowrap;
  max-width: 150px;
  overflow: hidden;
  text-overflow: ellipsis;
}

.taskbar-button:active,
.taskbar-button.active {
  border-style: inset;
  border-color: #808080 #dfdfdf #dfdfdf #808080;
}

.taskbar-tray {
  display: flex;
  align-items: center;
  gap: 5px;
  border-left: 2px solid;
  border-color: #dfdfdf #808080 #808080 #dfdfdf;
  padding-left: 5px;
  margin-left: 3px;
}

.system-clock {
  font-size: 11px;
  padding: 2px 4px;
  min-width: 40px;
  text-align: center;
  color: #000;
}

.volume-control {
  font-size: 14px;
  cursor: pointer;
  padding: 2px 4px;
}

/* Window Styles */
.window {
  position: absolute;
  background: #c0c0c0;
  border: 2px solid;
  border-color: #dfdfdf #808080 #808080 #dfdfdf;
  box-shadow: 1px 1px 0 #ffffff inset, -1px -1px 0 #808080 inset;
  min-width: 300px;
  min-height: 200px;
  display: flex;
  flex-direction: column;
  font-family: 'MS Sans Serif', Arial, sans-serif;
  font-size: 11px;
  z-index: 100;
  touch-action: none;
}

.window.active {
  z-index: 1000;
}

.window-title {
  background: linear-gradient(to right, #000080, #1084d7);
  color: white;
  padding: 2px 2px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  cursor: move;
  font-weight: bold;
  user-select: none;
  height: 22px;
  flex-shrink: 0;
}

.window-title-text {
  flex: 1;
  padding: 0 4px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.window-controls {
  display: flex;
  gap: 2px;
  padding-right: 2px;
}

.window-button {
  width: 16px;
  height: 14px;
  background: linear-gradient(to bottom, #dfdfdf 0%, #c0c0c0 100%);
  border: 2px outset #dfdfdf;
  border-right-color: #808080;
  border-bottom-color: #808080;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 10px;
  color: #000;
  padding: 0;
}

.window-button:active {
  border-style: inset;
  border-color: #808080 #dfdfdf #dfdfdf #808080;
}

.window-button:hover {
  background: linear-gradient(to bottom, #efefef 0%, #dfdfdf 100%);
}

.window-content {
  flex: 1;
  background: #c0c0c0;
  overflow: auto;
  padding: 5px;
  display: flex;
  flex-direction: column;
}

.window-scrollable {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 8px;
  background: white;
  border: 2px inset #dfdfdf;
}

/* Menu Bar */
.menu-bar {
  display: flex;
  gap: 15px;
  padding: 2px 4px;
  border-bottom: 2px solid #c0c0c0;
  background: #c0c0c0;
  flex-shrink: 0;
}

.menu-bar-item {
  padding: 2px 4px;
  cursor: pointer;
  user-select: none;
}

.menu-bar-item:hover {
  background: #000080;
  color: white;
}

/* Start Menu */
.start-menu {
  position: fixed;
  bottom: 28px;
  left: 0;
  width: 200px;
  background: #c0c0c0;
  border: 2px solid;
  border-color: #dfdfdf #808080 #808080 #dfdfdf;
  box-shadow: 1px 1px 0 #ffffff inset, -1px -1px 0 #808080 inset;
  z-index: 2000;
  max-height: 60vh;
  overflow-y: auto;
  display: flex;
  flex-direction: column-reverse;
}

.start-menu.hidden {
  display: none;
}

.menu-items {
  padding: 2px 0;
}

.menu-item {
  padding: 2px 6px;
  cursor: pointer;
  user-select: none;
  font-size: 11px;
  padding: 4px 8px;
}

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

.start-menu hr {
  border: none;
  border-top: 1px solid #c0c0c0;
  border-bottom: 1px solid #ffffff;
  margin: 2px 0;
}

/* Shutdown Screen */
.shutdown-screen {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: #000080;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 3000;
}

.shutdown-screen.hidden {
  display: none;
}

.shutdown-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 20px;
}

.shutdown-image {
  max-width: 200px;
  opacity: 0.9;
}

.shutdown-text {
  color: white;
  font-size: 14px;
  font-family: 'MS Sans Serif', Arial, sans-serif;
  animation: blink 1s infinite;
}

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

/* Boot Screen */
.boot-screen {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: #000080;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 5000;
  animation: bootFadeOut 2s ease-in-out forwards 2s;
}

.boot-screen.hidden {
  display: none;
}

@keyframes bootFadeOut {
  0% { opacity: 1; }
  100% { opacity: 0; pointer-events: none; }
}

.boot-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 30px;
}

.boot-logo {
  max-width: 150px;
  opacity: 0.9;
}

.boot-bar {
  width: 300px;
  height: 20px;
  border: 2px outset #dfdfdf;
  background: #c0c0c0;
  overflow: hidden;
}

.boot-progress {
  height: 100%;
  background: linear-gradient(to right, #000080, #1084d7);
  animation: bootProgress 2s ease-in forwards;
}

@keyframes bootProgress {
  0% { width: 0%; }
  100% { width: 100%; }
}

.boot-text {
  color: white;
  font-size: 14px;
  font-family: 'MS Sans Serif', Arial, sans-serif;
}

/* Mobile Responsive */
@media (max-width: 768px) {
  .desktop-icons {
    grid-template-columns: repeat(3, minmax(60px, 1fr));
    gap: 15px;
    padding: 10px;
  }

  .icon-image {
    width: 40px;
    height: 40px;
  }

  .icon-label {
    font-size: 10px;
  }

  .window {
    min-width: 250px;
    min-height: 150px;
  }

  .taskbar {
    height: 24px;
  }

  .start-button {
    min-width: 40px;
    font-size: 10px;
  }
}

@media (max-width: 480px) {
  .desktop-icons {
    grid-template-columns: repeat(2, minmax(50px, 1fr));
    gap: 10px;
    padding: 8px;
  }

  .icon-image {
    width: 32px;
    height: 32px;
  }

  .icon-label {
    font-size: 9px;
  }

  .window {
    min-width: 200px;
    min-height: 120px;
    width: 100vw !important;
    height: auto !important;
    left: 0 !important;
    top: 30px !important;
    right: 0;
  }
}

/* Windows Not Activated Notice */
.windows-not-activated {
  position: fixed;
  bottom: 40px;
  right: 10px;
  z-index: 1999;
  max-width: 280px;
}

.activation-notice {
  background: #c0c0c0;
  border: 2px solid;
  border-color: #dfdfdf #808080 #808080 #dfdfdf;
  box-shadow: 1px 1px 0 #ffffff inset, -1px -1px 0 #808080 inset;
  padding: 8px;
  font-family: 'MS Sans Serif', Arial, sans-serif;
  font-size: 11px;
  color: #000;
}

.activation-notice p {
  margin: 2px 0;
  padding: 0;
}

.activation-notice p:first-child {
  font-weight: bold;
  color: #000080;
  text-align: center;
  margin-bottom: 5px;
  font-size: 11px;
}

.contact-notice {
  text-align: center;
  margin: 5px 0 !important;
  font-size: 10px;
  line-height: 1.4;
}

.contact-info {
  font-size: 9px !important;
  text-align: center;
  background: #dfdfdf;
  padding: 3px !important;
  margin-top: 5px !important;
  border: 1px inset #dfdfdf;
  color: #000;
}

.contact-info a {
  color: #0000ff;
  text-decoration: underline;
  cursor: pointer;
  font-weight: bold;
}

.contact-info a:hover {
  color: #ff0000;
}

.contact-info a {
  color: #0000ff;
  text-decoration: underline;
  cursor: pointer;
}

/* Mobile adjustment */
@media (max-width: 480px) {
  .windows-not-activated {
    bottom: 5px;
    right: 5px;
    max-width: 240px;
  }

  .activation-notice {
    padding: 5px;
    font-size: 10px;
  }

  .activation-notice p {
    margin: 1px 0;
  }

  .contact-info {
    font-size: 8px !important;
  }
}
