/* ========== Variables ========== */
:root {
  /* ===== Backgrounds ===== */
  --color-bg-black: #000000;
  --color-desktop: url('assets/background.jpg') repeat;

  /* ===== Taskbar + Buttons ===== */
  --color-taskbar-bg: #aea8d9;
  --color-taskbar-border: #d8d5ec;
  --color-taskbar-highlight: #d8d5ec;
  --color-taskbar-shadow: #808080;

  /* ===== Text ===== */
  --color-text-white: #ffffff;
  --color-text-black: #000000;

  /* ===== Borders & Effects ===== */
  --color-border-light: #ffffff;
  --color-border-dark: #404040;
  --color-border-outer: #000000;

  /* ===== Fonts ===== */
  --font-main: 'Win98', sans-serif;
}

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

/* ========== Fonts ========== */
@font-face {
  font-family: 'Win98';
  src: url('fonts/98Reg.ttf') format('truetype');
  font-weight: normal;
  font-style: normal;
}

@font-face {
  font-family: 'Win98';
  src: url('fonts/98Bold.ttf') format('truetype');
  font-weight: bold;
  font-style: normal;
}

/* ========== Base Styles ========== */
html, body {
  height: 100%;
  width: 100%;
  font-family: var(--font-main);
  background: var(--color-bg-black);
  overflow: hidden;
  color: var(--color-text-white);
}

a {
  color: var(--color-text-white);
  text-decoration: none;
}

/* ========== Boot Screen ========== */
#boot-screen {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--color-bg-black);
  transition: opacity 1s ease;
  z-index: 9999;
}

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

#boot-logo {
  width: 150px;
}

#boot-bar {
  width: 130px;
}

#boot-button {
  margin-top: 20px;
  padding: 8px 20px;
  font-family: var(--font-main);
  font-size: 12px;
  font-weight: bold;
  background-color: var(--color-taskbar-bg);
  border: 2px solid var(--color-taskbar-border);
  cursor: pointer;
  display: none;
}

#boot-button:hover {
  background-color: var(--color-taskbar-border);
  border: 2px solid var(--color-taskbar-bg);
}

/* ========== Desktop ========== */
#desktop {
  display: none;
  width: 100%;
  height: 100%;
  background: var(--color-desktop);
  position: relative;
}

#icons {
  display: flex;
  flex-direction: column;
  flex-wrap: wrap;
  height: calc(100% - 35px);
  padding: 12px;
  gap: 20px;
  overflow-y: auto;
}

.desktop-icon {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 80px;
  padding: 6px;
  margin-bottom: 16px;
  text-align: center;
  font-size: 12px;
  color: var(--color-text-white);
  text-shadow: 1px 1px 0 var(--color-bg-black);
  border: 1px solid transparent;
  cursor: pointer;
  transition: border 0.2s ease-in-out;
}

.desktop-icon span {
  margin-top: 6px;
  padding: 4px;
  line-height: 1.2;
  word-wrap: break-word;
  width: 100%;
  text-align: center;
}

.desktop-icon img {
  width: 48px;
  height: 48px;
}

.desktop-icon:hover {
  border: 1px solid var(--color-text-white);
}

.desktop-icon:focus {
  outline: 2px solid var(--color-text-white);
}

/* ========== Taskbar ========== */
#taskbar {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 28px;
  background: var(--color-taskbar-bg);
  border-top: 1px solid var(--color-taskbar-highlight);
  box-shadow: inset 0 1px 0 var(--color-taskbar-bg);
  display: flex;
  align-items: center;
  padding: 0 6px;
  font-size: 14px;
  color: var(--color-text-black);
}

#taskbar-windows {
  flex-grow: 1;
  display: flex;
  align-items: center;
  gap: 5px;
  padding-left: 10px;
  margin-top: 4px;
  margin-bottom: 4px;
}

.taskbar-window {
  background: var(--color-taskbar-bg);
  font-family: var(--font-main);
  font-size: 12px;
  color: var(--color-text-black);
  padding: 2px 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 22px;
  margin-top: 4px;
  margin-bottom: 4px;
  box-shadow:
    inset 1px 1px 0 var(--color-taskbar-highlight),
    inset -1px -1px 0 var(--color-taskbar-shadow),
    1px 1px 0 var(--color-border-outer);
  border: none;
  cursor: pointer;
  white-space: nowrap;
  max-width: 200px;
  text-overflow: ellipsis;
  overflow: hidden;
}

.taskbar-window.active {
  box-shadow:
    inset -1px -1px 0 var(--color-taskbar-highlight),
    inset 1px 1px 0 var(--color-taskbar-shadow),
    inset 0 0 0 1px var(--color-border-outer);
  background: #a0a0a0;
}

#start-button {
  width: 55px;
  height: 22px;
  margin-top: 4px;
  margin-bottom: 4px;
  background: var(--color-taskbar-bg);
  font-family: var(--font-main);
  font-size: 12px;
  font-weight: bold;
  color: var(--color-text-black);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  box-shadow:
    inset 1px 1px 0 var(--color-taskbar-highlight),
    inset -1px -1px 0 var(--color-taskbar-shadow),
    1px 1px 0 var(--color-border-outer);
  border: none;
  cursor: pointer;
  position: relative;
}

.taskbar-divider {
  width: 2px;
  height: 22px;
  margin: 0 3px;
  display: inline-block;
  position: relative;
}

.taskbar-divider::before,
.taskbar-divider::after {
  content: '';
  position: absolute;
  width: 1px;
  height: 100%;
  top: 0;
}

.taskbar-divider::before {
  left: 0;
  background: var(--color-taskbar-shadow);
}

.taskbar-divider::after {
  left: 1px;
  background: var(--color-taskbar-highlight);
}

#taskbar-time {
  background: var(--color-taskbar-bg);
  border: 2px inset var(--color-taskbar-border);
  padding: 2px 6px;
}

.taskbar-button {
  background: var(--color-taskbar-bg);
  box-shadow:
    inset 1px 1px 0 var(--color-taskbar-highlight),
    inset -1px -1px 0 var(--color-taskbar-shadow),
    1px 1px 0 var(--color-border-outer);
  border: none;
  color: var(--color-text-black);
  padding: 4px 6px;
  margin: 2px;
  font-size: 12px;
  cursor: pointer;
  height: 22px;
}

.taskbar-button.active {
  background: var(--color-taskbar-border);
  color: var(--color-text-white);
}

/* ========== Windows ========== */
.window {
  position: absolute;
  top: 100px;
  left: 100px;
  width: 854px;
  height: 480px;
  resize: both;
  overflow: hidden;
  background: var(--color-bg-black);
  border: 2px solid var(--color-taskbar-border);
  display: flex;
  flex-direction: column;
}

.title-bar {
  background: var(--color-taskbar-bg);
  color: var(--color-text-black);
  font-weight: bold;
  padding: 4px 8px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  cursor: move;
}

.window-controls {
  display: flex;
  gap: 4px;
  margin-left: auto;
}

.window-controls button {
  background: var(--color-taskbar-bg);
  border: 1px solid var(--color-taskbar-border);
  width: 20px;
  height: 20px;
  font-weight: bold;
  cursor: pointer;
  padding: 0;
  text-align: center;
}

.window-controls button:hover {
  background: var(--color-taskbar-border);
}

.window.maximized {
  box-shadow: none;
}

.window.minimized {
  display: none;
}

iframe {
  width: 100%;
  height: 100%;
  border: none;
}
