/* Global Styles */
body {
    margin: 0;
    padding: 0;
    font-family: "MS Sans Serif", "Segoe UI", sans-serif;
    overflow: hidden;
    background: #000;
}

.hidden {
    display: none !important;
}

/* 3D Mode Styles */
#gameContainer {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

#gameCanvas {
    width: 100%;
    height: 100%;
}

#interactionHint {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.7);
    color: white;
    padding: 8px 16px;
    border-radius: 4px;
    font-size: 14px;
}

/* PC Interface Styles */
#desktopUI {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: #008080; /* Windows 95 teal background */
}

.desktop-area {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 40px; /* Taskbar height */
}

.start-button {
    background: #C0C0C0;
    border: 2px solid #FFFFFF;
    border-bottom-color: #7B7B7B;
    border-right-color: #7B7B7B;
    padding: 2px 8px;
    font-size: 12px;
    cursor: pointer;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 150px;
    min-width: 80px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 2px;
    padding: 5px 10px;
}

.start-button:active {
    border: 2px solid #7B7B7B;
    border-bottom-color: #FFFFFF;
    border-right-color: #FFFFFF;
}

.start-button.active {
    background: #C0C0C0;
    border: 2px solid #7B7B7B;
    border-bottom-color: #FFFFFF;
    border-right-color: #FFFFFF;
}


/* Taskbar */
.taskbar {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 40px;
    background: #C0C0C0;
    border-top: 2px solid #FFFFFF;
    border-bottom: 2px solid #7B7B7B;
    display: flex;
    align-items: center;
    padding: 0 4px;
    z-index: 2000; /* TASKBAR_Z */
}

.taskbar-button {
    background: #C0C0C0;
    border: 2px solid #FFFFFF;
    border-bottom-color: #7B7B7B;
    border-right-color: #7B7B7B;
    padding: 2px 8px;
    font-size: 12px;
    cursor: pointer;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 150px;
    min-width: 80px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.taskbar-button:active {
    border: 2px solid #7B7B7B;
    border-bottom-color: #FFFFFF;
    border-right-color: #FFFFFF;
}

.taskbar-button.active {
    background: #C0C0C0;
    border: 2px solid #7B7B7B;
    border-bottom-color: #FFFFFF;
    border-right-color: #FFFFFF;
}

.taskbar-windows {
    flex: 1;
    display: flex;
    gap: 4px;
    margin: 0 8px;
}

#taskbar-clock {
    font-family: 'Consolas', monospace;
    font-size: 14px;
    padding: 0 10px;
    display: flex;
    align-items: center;
    gap: 8px;
}

#taskbar-clock::after {
    content: '';
    display: inline-block;
    width: 1px;
    height: 14px;
    margin-left: 4px;
}

/* Desktop Icons */
.desktop-icon {
    position: absolute;
    width: 64px;
    height: 64px;
    display: flex;
    flex-direction: column;
    align-items: center;
    cursor: pointer;
    padding: 4px;
    user-select: none;
}

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

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

.desktop-icon-text {
    font-size: 12px;
    text-align: center;
    color: white;
    text-shadow: 1px 1px 1px black;
    max-width: 64px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* --- drag feedback --- */
.desktop-icon.dragging {
    opacity: .8;
    transform: scale(1.12);
    box-shadow: 0 0 8px 2px rgba(255,255,255,.65);
    transition: none;                 /* keep it perfectly responsive */
}

/* Email badge - unread indicator */
.desktop-icon-badge {
  position: absolute;
  top: 2px;
  right: 2px;
  background: red;
  color: white;
  font-size: 10px;
  line-height: 1;
  padding: 0 4px;
  border-radius: 8px;
  pointer-events: none;
  min-width: 8px;
  height: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Start Menu */
.start-menu {
    position: absolute;
    bottom: 40px;
    left: 0;
    width: 200px;
    background: #c0c0c0;
    border: 2px solid;
    border-color: #ffffff #808080 #808080 #ffffff;
    padding: 2px;
    z-index: 3000; /* START_MENU_Z */
}

#programSearch {
    width: 90%;
    margin: 4px;
    padding: 2px 4px;
    height: 20px;
    font-family: "MS Sans Serif", "Segoe UI", sans-serif;
    font-size: 12px;
    background: white;
    border: 2px solid;
    border-color: #808080 #ffffff #ffffff #808080;
    outline: none;
}

#programSearch:focus {
    border-color: #000080;
}

#programSearch::placeholder {
    color: #808080;
    font-style: italic;
}

.start-menu ul {
    list-style: none;
    padding: 0;
    margin: 0;
    border-top: 1px solid #808080;
}

.start-menu li {
    padding: 4px 8px;
    display: flex;
    align-items: center;
    cursor: pointer;
}

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

.program-icon {
    width: 16px;
    height: 16px;
    margin-right: 8px;
}

.clock-out-item {
    border-top: 1px solid #808080;
    margin-top: 4px;
    padding-top: 4px;
}

/* Window Styles */
.window {
    position: absolute;
    background: #C0C0C0;
    border: 2px solid;
    border-color: #FFFFFF #7B7B7B #7B7B7B #FFFFFF;
    box-shadow: 2px 2px 0 #7B7B7B;
}

.title-bar {
    background: #000080;
    color: white;
    padding: 2px 5px;
    font-size: 14px;
    display: flex;
    justify-content: space-between;
    cursor: move;
}

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

.window-controls button {
    background: #C0C0C0;
    border: 1px solid #7B7B7B;
    width: 16px;
    height: 16px;
    font-size: 12px;
    line-height: 12px;
    padding: 0;
    cursor: pointer;
}

.window-controls button:active {
    border-style: inset;
}

.window-content {
    padding: 4px;
    background: #FFFFFF;
    height: calc(100% - 35px);
    display: flex;
    flex-direction: column;
    border: 1px solid #7B7B7B;
    margin: 2px;
}

/* Minesweeper Grid */
.minesweeper-grid {
    display: grid;
    gap: 1px;
    background: #7B7B7B;
    padding: 1px;
}

.cell {
    width: 30px;
    height: 30px;
    background: #C0C0C0;
    border: 2px solid;
    border-color: #FFFFFF #7B7B7B #7B7B7B #FFFFFF;
    text-align: center;
    line-height: 30px;
    font-weight: bold;
    cursor: pointer;
}

.cell.revealed {
    background: #E0E0E0;
    border: 1px solid #7B7B7B;
}


/* Text Editor */
.menu-bar {
    background: #000080;
    color: white;
    padding: 2px 5px;
    font-size: 13px;
    cursor: default;
}

.menu-bar span {
    margin-right: 15px;
}


.menu-item {
    position: relative;
    display: inline-block;
    padding: 0 8px;
    cursor: pointer;                 /* pointer cursor */
    user-select: none;
  }
  .menu-item:hover { background: #000080; color: #fff; }


  .submenu {
  display: none;
  position: absolute;
  top: 100%; left: 0;
  background: #C0C0C0;
  border: 2px solid #808080;
  list-style: none;
  margin: 0; padding: 2px;
  min-width: 120px;
  z-index: 100;
}
.menu-item:hover .submenu { display: block; }

.submenu-item {
  padding: 2px 10px;
  cursor: pointer;
  white-space: nowrap;
}
.submenu-item:hover {
  background: #000080;
  color: #fff;
}

/* doc list popup */
.doc-list { list-style:none; margin:0; padding:4px; }
.doc-link  { padding:2px 6px; cursor:pointer; }
.doc-link:hover { background:#000080; color:#fff; }

/* bigger textarea fills remaining space */
.editor-textarea {
    width: 100%;
    height: 100%;
    border: none;
    outline: none;
    font-family: monospace;
    font-size: 14px;
    resize: none;
    flex: 1;
}

@keyframes titleBlink {
    0%, 100% { filter: brightness(1);   }
    50%      { filter: brightness(2.2); }
}

.window.blink .title-bar {
    animation: titleBlink 0.45s step-end 4;  /* ~2 s total flash time */
}

/* Popup Button Styles */
.popup-button {
    background: #C0C0C0;
    border: 2px solid;
    border-color: #FFFFFF #7B7B7B #7B7B7B #FFFFFF;
    padding: 4px 16px;
    font-family: "MS Sans Serif", "Segoe UI", sans-serif;
    font-size: 12px;
    cursor: pointer;
    min-width: 80px;
}

.popup-button:active {
    border-color: #7B7B7B #FFFFFF #FFFFFF #7B7B7B;
    padding: 5px 15px 3px 17px; /* Shift text slightly when pressed */
}

.popup-button:hover {
    background: #D0D0D0;
}
