/* Windows 95 CSS Framework */

/* CSS Variables - Win95 Color Palette */
:root {
  /* Desktop & Background */
  --win95-desktop: #008080;
  --win95-desktop-alt: #00aaaa;

  /* Windows & Panels */
  --win95-gray: #c0c0c0;
  --win95-gray-light: #dfdfdf;
  --win95-gray-dark: #808080;
  --win95-gray-darker: #404040;

  /* Title Bar */
  --win95-titlebar: #000080;
  --win95-titlebar-light: #1084d0;
  --win95-titlebar-text: #ffffff;

  /* Buttons */
  --win95-button-face: #c0c0c0;
  --win95-button-highlight: #ffffff;
  --win95-button-shadow: #808080;
  --win95-button-dark-shadow: #404040;

  /* Text */
  --win95-text: #000000;
  --win95-text-disabled: #808080;

  /* Selection */
  --win95-highlight: #000080;
  --win95-highlight-text: #ffffff;

  /* Status */
  --win95-error: #ff0000;
}

/* Reset & Base */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html, body {
  height: 100%;
  overflow: hidden;
  font-family: "MS Sans Serif", Tahoma, Verdana, sans-serif;
  font-size: 12px;
  color: var(--win95-text);
  background: var(--win95-desktop);
  user-select: none;
  -webkit-user-select: none;
}

/* Desktop Container */
.desktop {
  width: 100%;
  height: calc(100vh - 28px);
  background: var(--win95-desktop);
  position: relative;
  overflow: hidden;
}

.desktop::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(135deg, var(--win95-desktop) 0%, var(--win95-desktop-alt) 100%);
  z-index: 0;
}

/* Icon Grid */
.icon-grid {
  display: flex;
  flex-direction: column;
  flex-wrap: wrap;
  align-content: flex-start;
  height: 100%;
  padding: 8px;
  gap: 8px;
  position: relative;
  z-index: 1;
}

/* Desktop Icon */
.desktop-icon {
  width: 70px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 4px;
  cursor: pointer;
  border: 1px solid transparent;
  z-index: 1;
}

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

.desktop-icon.selected {
  background: var(--win95-highlight);
  border: 1px dotted var(--win95-highlight-text);
}

.desktop-icon.selected .icon-label {
  background: var(--win95-highlight);
  color: var(--win95-highlight-text);
}

/* Icon dragging shadow */
.desktop-icon.dragging {
  opacity: 0.8;
  z-index: 1000;
}

.icon-image {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
}

.icon-label {
  font-size: 11px;
  text-align: center;
  color: var(--win95-titlebar-text);
  text-shadow: 1px 1px 1px rgba(0, 0, 0, 0.5);
  word-wrap: break-word;
  max-width: 70px;
  padding: 1px 2px;
}

/* Window dragging state */
.window.dragging {
  opacity: 0.85;
  cursor: grabbing;
}

/* Window Component */
.window {
  position: absolute;
  min-width: 300px;
  min-height: 200px;
  background: var(--win95-gray);
  border: 2px solid;
  border-color: var(--win95-button-highlight) var(--win95-button-dark-shadow) var(--win95-button-dark-shadow) var(--win95-button-highlight);
  box-shadow: 2px 2px 8px rgba(0, 0, 0, 0.3);
  display: flex;
  flex-direction: column;
  transition: box-shadow 0.2s ease;
}

.window.active {
  box-shadow: 4px 4px 12px rgba(0, 0, 0, 0.4);
}

.window.maximized {
  box-shadow: none;
  top: 0 !important;
  left: 0 !important;
  width: calc(100vw - 4px) !important;
  height: calc(100vh - 32px) !important;
}

.window.hidden {
  display: none;
}

/* Title Bar */
.title-bar {
  background: var(--win95-titlebar);
  padding: 2px 3px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: default;
}

.title-bar.inactive {
  background: var(--win95-gray-dark);
}

.title-text {
  display: flex;
  align-items: center;
  gap: 4px;
  color: var(--win95-titlebar-text);
  font-weight: bold;
  font-size: 12px;
  overflow: hidden;
}

.title-icon {
  font-size: 14px;
}

.title-label {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.title-buttons {
  display: flex;
  gap: 2px;
}

.title-btn {
  width: 16px;
  height: 14px;
  background: var(--win95-button-face);
  border: 1px solid;
  border-color: var(--win95-button-highlight) var(--win95-button-dark-shadow) var(--win95-button-dark-shadow) var(--win95-button-highlight);
  font-size: 9px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  padding: 0;
  font-family: sans-serif;
}

.title-btn:active {
  border-color: var(--win95-button-dark-shadow) var(--win95-button-highlight) var(--win95-button-highlight) var(--win95-button-dark-shadow);
}

.title-btn:disabled {
  color: var(--win95-text-disabled);
  text-shadow: 1px 1px 0 var(--win95-button-highlight);
}

/* Menu Bar */
.menu-bar {
  background: var(--win95-gray);
  padding: 2px 4px;
  display: flex;
  gap: 8px;
  border-bottom: 1px solid var(--win95-gray-dark);
}

.menu-item {
  padding: 1px 4px;
  cursor: pointer;
}

.menu-item:hover {
  background: var(--win95-highlight);
  color: var(--win95-highlight-text);
}

/* Window Content */
.window-content {
  flex: 1;
  overflow: auto;
  padding: 8px;
  background: var(--win95-gray);
}

/* Status Bar */
.status-bar {
  background: var(--win95-gray);
  padding: 2px 4px;
  border-top: 1px solid var(--win95-gray-dark);
  display: flex;
  gap: 8px;
}

.status-field {
  padding: 1px 4px;
  border: 1px solid;
  border-color: var(--win95-button-dark-shadow) var(--win95-button-highlight) var(--win95-button-highlight) var(--win95-button-dark-shadow);
  font-size: 11px;
}

/* Resize Handles */
.resize-handle {
  position: absolute;
  background: transparent;
}

.resize-n { top: 0; left: 10px; right: 10px; height: 4px; cursor: n-resize; }
.resize-s { bottom: 0; left: 10px; right: 10px; height: 4px; cursor: s-resize; }
.resize-e { right: 0; top: 10px; bottom: 10px; width: 4px; cursor: e-resize; }
.resize-w { left: 0; top: 10px; bottom: 10px; width: 4px; cursor: w-resize; }
.resize-ne { top: 0; right: 0; width: 8px; height: 8px; cursor: ne-resize; }
.resize-nw { top: 0; left: 0; width: 8px; height: 8px; cursor: nw-resize; }
.resize-se { bottom: 0; right: 0; width: 8px; height: 8px; cursor: se-resize; }
.resize-sw { bottom: 0; left: 0; width: 8px; height: 8px; cursor: sw-resize; }

/* Taskbar */
.taskbar {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: 28px;
  background: var(--win95-gray);
  border-top: 2px solid var(--win95-button-highlight);
  display: flex;
  align-items: center;
  padding: 2px;
  z-index: 9999;
}

.start-button {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 2px 6px;
  background: var(--win95-button-face);
  border: 2px solid;
  border-color: var(--win95-button-highlight) var(--win95-button-dark-shadow) var(--win95-button-dark-shadow) var(--win95-button-highlight);
  font-weight: bold;
  font-size: 12px;
  cursor: pointer;
  margin-right: 4px;
}

.start-button:active, .start-button.active {
  border-color: var(--win95-button-dark-shadow) var(--win95-button-highlight) var(--win95-button-highlight) var(--win95-button-dark-shadow);
}

.start-button:disabled {
  color: var(--win95-text-disabled);
  text-shadow: 1px 1px 0 var(--win95-button-highlight);
}

.start-button .logo {
  font-size: 16px;
}

.taskbar-windows {
  flex: 1;
  display: flex;
  gap: 2px;
  overflow-x: auto;
}

.taskbar-window-btn {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  background: var(--win95-button-face);
  border: 2px solid;
  border-color: var(--win95-button-highlight) var(--win95-button-dark-shadow) var(--win95-button-dark-shadow) var(--win95-button-highlight);
  font-size: 11px;
  cursor: pointer;
  max-width: 160px;
  min-width: 80px;
}

.taskbar-window-btn:active {
  border-color: var(--win95-button-dark-shadow) var(--win95-button-highlight) var(--win95-button-highlight) var(--win95-button-dark-shadow);
}

.taskbar-window-btn:disabled {
  color: var(--win95-text-disabled);
  text-shadow: 1px 1px 0 var(--win95-button-highlight);
}

.taskbar-window-btn.active {
  background: var(--win95-gray-light);
  border-color: var(--win95-button-dark-shadow) var(--win95-button-highlight) var(--win95-button-highlight) var(--win95-button-dark-shadow);
}

.taskbar-window-btn .icon {
  font-size: 14px;
}

.taskbar-window-btn .label {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.taskbar-clock {
  padding: 2px 8px;
  background: var(--win95-button-face);
  border: 2px solid;
  border-color: var(--win95-button-highlight) var(--win95-button-dark-shadow) var(--win95-button-dark-shadow) var(--win95-button-highlight);
  font-size: 11px;
  margin-left: 4px;
}

/* Start Menu */
.start-menu {
  position: fixed;
  bottom: 28px;
  left: 0;
  width: 200px;
  background: var(--win95-gray);
  border: 2px solid;
  border-color: var(--win95-button-highlight) var(--win95-button-dark-shadow) var(--win95-button-dark-shadow) var(--win95-button-highlight);
  z-index: 10000;
  display: none;
}

.start-menu.open {
  display: block;
}

.start-sidebar {
  width: 24px;
  background: var(--win95-titlebar);
  color: var(--win95-titlebar-text);
  writing-mode: vertical-rl;
  text-orientation: mixed;
  transform: rotate(180deg);
  padding: 8px 4px;
  font-weight: bold;
  font-size: 18px;
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
}

.start-menu-items {
  margin-left: 28px;
  padding: 2px;
}

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

.start-menu-item:hover {
  background: var(--win95-highlight);
  color: var(--win95-highlight-text);
}

.start-menu-item .icon {
  font-size: 20px;
  width: 24px;
  text-align: center;
}

.start-menu-item .label {
  flex: 1;
}

.start-menu-separator {
  height: 1px;
  background: var(--win95-gray-dark);
  margin: 4px 2px;
}

/* Submenu */
.submenu {
  position: absolute;
  left: 100%;
  top: 0;
  width: 160px;
  background: var(--win95-gray);
  border: 2px solid;
  border-color: var(--win95-button-highlight) var(--win95-button-dark-shadow) var(--win95-button-dark-shadow) var(--win95-button-highlight);
  display: none;
}

.start-menu-item.has-submenu:hover .submenu {
  display: block;
}

/* Video List in Window */
.video-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.video-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px;
  border: 1px solid transparent;
  cursor: pointer;
}

.video-item:hover {
  background: var(--win95-highlight);
  color: var(--win95-highlight-text);
}

.video-item .thumbnail {
  width: 60px;
  height: 40px;
  background: #333;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
}

.video-item .info {
  flex: 1;
}

.video-item .title {
  font-weight: bold;
  font-size: 11px;
}

.video-item .meta {
  font-size: 10px;
  color: #666;
}

.video-item:hover .meta {
  color: #ccc;
}

/* Video Embed */
.video-embed-container {
  position: relative;
  width: 100%;
  padding-top: 56.25%;
  background: #000;
}

.video-embed-container iframe {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border: none;
}

/* Tabs */
.tab-bar {
  display: flex;
  background: var(--win95-gray);
  border-bottom: 1px solid var(--win95-gray-dark);
}

.tab {
  padding: 4px 12px;
  background: var(--win95-gray);
  border: 1px solid;
  border-color: var(--win95-button-highlight) var(--win95-gray-dark) transparent var(--win95-gray-dark);
  cursor: pointer;
  margin-right: 2px;
  position: relative;
  top: 1px;
}

.tab.active {
  background: var(--win95-gray-light);
  border-bottom-color: var(--win95-gray-light);
}

.tab:hover:not(.active) {
  background: var(--win95-gray-light);
}

.tab-content {
  padding: 8px;
  background: var(--win95-gray-light);
  min-height: 200px;
}

/* Buttons */
.btn {
  padding: 4px 12px;
  background: var(--win95-button-face);
  border: 2px solid;
  border-color: var(--win95-button-highlight) var(--win95-button-dark-shadow) var(--win95-button-dark-shadow) var(--win95-button-highlight);
  font-family: inherit;
  font-size: 11px;
  cursor: pointer;
}

.btn:active {
  border-color: var(--win95-button-dark-shadow) var(--win95-button-highlight) var(--win95-button-highlight) var(--win95-button-dark-shadow);
}

.btn:disabled {
  color: var(--win95-text-disabled);
  text-shadow: 1px 1px 0 var(--win95-button-highlight);
  cursor: not-allowed;
}

/* Input */
.input {
  padding: 2px 4px;
  border: 2px solid;
  border-color: var(--win95-button-dark-shadow) var(--win95-button-highlight) var(--win95-button-highlight) var(--win95-button-dark-shadow);
  font-family: inherit;
  font-size: 11px;
}

/* Panel / Box */
.panel {
  background: var(--win95-gray);
  border: 2px solid;
  border-color: var(--win95-button-highlight) var(--win95-button-dark-shadow) var(--win95-button-dark-shadow) var(--win95-button-highlight);
  padding: 8px;
}

/* Inset Panel */
.panel-inset {
  background: var(--win95-gray-light);
  border: 2px solid;
  border-color: var(--win95-button-dark-shadow) var(--win95-button-highlight) var(--win95-button-highlight) var(--win95-button-dark-shadow);
  padding: 8px;
}

/* Context Menu */
.context-menu {
  position: fixed;
  background: var(--win95-gray);
  border: 2px solid;
  border-color: var(--win95-button-highlight) var(--win95-button-dark-shadow) var(--win95-button-dark-shadow) var(--win95-button-highlight);
  min-width: 150px;
  z-index: 10001;
  display: none;
}

.context-menu.open {
  display: block;
}

.context-menu-item {
  padding: 4px 20px;
  cursor: pointer;
}

.context-menu-item:hover {
  background: var(--win95-highlight);
  color: var(--win95-highlight-text);
}

.context-menu-separator {
  height: 1px;
  background: var(--win95-gray-dark);
  margin: 2px 0;
}

/* Scrollbar */
::-webkit-scrollbar {
  width: 16px;
  height: 16px;
}

::-webkit-scrollbar-track {
  background: var(--win95-gray-light);
}

::-webkit-scrollbar-thumb {
  background: var(--win95-gray);
  border: 2px solid;
  border-color: var(--win95-button-highlight) var(--win95-button-dark-shadow) var(--win95-button-dark-shadow) var(--win95-button-highlight);
}

::-webkit-scrollbar-button {
  background: var(--win95-gray);
  border: 2px solid;
  border-color: var(--win95-button-highlight) var(--win95-button-dark-shadow) var(--win95-button-dark-shadow) var(--win95-button-highlight);
}

/* Clippy Assistant */
.clippy {
  position: fixed;
  bottom: 40px;
  right: 20px;
  width: 120px;
  height: 120px;
  z-index: 9998;
  display: none;
}

.clippy.show {
  display: block;
  animation: clippyBounce 0.5s ease;
}

.clippy-body {
  font-size: 80px;
  text-align: center;
}

.clippy-bubble {
  position: absolute;
  top: -60px;
  right: 80px;
  background: #ffffcc;
  border: 2px solid;
  border-color: var(--win95-button-shadow) var(--win95-button-highlight) var(--win95-button-highlight) var(--win95-button-shadow);
  padding: 8px;
  max-width: 200px;
  font-size: 11px;
}

.clippy-bubble::after {
  content: '';
  position: absolute;
  bottom: -8px;
  right: 20px;
  border: 8px solid transparent;
  border-top-color: #ffffcc;
}

@keyframes clippyBounce {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-10px); }
}

/* Minesweeper */
.minesweeper {
  padding: 8px;
}

.ms-header {
  display: flex;
  justify-content: space-between;
  margin-bottom: 8px;
}

.ms-display {
  background: #000;
  color: red;
  font-family: "Courier New", monospace;
  font-size: 24px;
  padding: 2px 4px;
  font-weight: bold;
}

.ms-grid {
  display: grid;
  gap: 1px;
  background: var(--win95-gray-dark);
  border: 3px solid;
  border-color: var(--win95-button-dark-shadow) var(--win95-button-highlight) var(--win95-button-highlight) var(--win95-button-dark-shadow);
}

.ms-cell {
  width: 20px;
  height: 20px;
  background: var(--win95-gray);
  border: 2px solid;
  border-color: var(--win95-button-highlight) var(--win95-button-dark-shadow) var(--win95-button-dark-shadow) var(--win95-button-highlight);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: bold;
  font-size: 12px;
  cursor: pointer;
}

.ms-cell:active:not(.revealed):not(.flagged) {
  border-color: var(--win95-button-dark-shadow) var(--win95-button-highlight) var(--win95-button-highlight) var(--win95-button-dark-shadow);
}

.ms-cell.revealed {
  border: 1px solid var(--win95-gray-dark);
  background: var(--win95-gray-light);
}

.ms-cell.mine {
  background: red;
}

.ms-cell.flagged {
  color: red;
}

.ms-cell[data-num="1"] { color: blue; }
.ms-cell[data-num="2"] { color: green; }
.ms-cell[data-num="3"] { color: red; }
.ms-cell[data-num="4"] { color: darkblue; }
.ms-cell[data-num="5"] { color: brown; }
.ms-cell[data-num="6"] { color: teal; }
.ms-cell[data-num="7"] { color: black; }
.ms-cell[data-num="8"] { color: gray; }

/* Task Manager / Ctrl+Alt+Del */
.ctrlaltdel-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: #000080;
  z-index: 20000;
  display: none;
  align-items: center;
  justify-content: center;
}

.ctrlaltdel-overlay.show {
  display: flex;
}

.ctrlaltdel-dialog {
  background: var(--win95-gray);
  border: 2px solid;
  border-color: var(--win95-button-highlight) var(--win95-button-dark-shadow) var(--win95-button-dark-shadow) var(--win95-button-highlight);
  padding: 12px;
  min-width: 400px;
}

.ctrlaltdel-header {
  background: var(--win95-titlebar);
  color: var(--win95-titlebar-text);
  padding: 4px 8px;
  font-weight: bold;
  margin: -12px -12px 12px -12px;
}

/* Now Playing */
.now-playing {
  position: fixed;
  bottom: 28px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--win95-gray);
  border: 2px solid;
  border-color: var(--win95-button-highlight) var(--win95-button-dark-shadow) var(--win95-button-dark-shadow) var(--win95-button-highlight);
  padding: 4px 12px;
  z-index: 9998;
  display: none;
}

.now-playing.show {
  display: block;
}

/* Window Open Animation */
@keyframes windowOpen {
  from {
    opacity: 0;
    transform: scale(0.9);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

.window.opening {
  animation: windowOpen 0.2s ease-out;
}

/* Window Close Animation */
@keyframes windowClose {
  from {
    opacity: 1;
    transform: scale(1);
  }
  to {
    opacity: 0;
    transform: scale(0.9);
  }
}

.window.closing {
  animation: windowClose 0.15s ease-in;
}

/* Icon bounce animation */
@keyframes iconBounce {
  0%, 100% { transform: translateY(0); }
  25% { transform: translateY(-8px); }
  50% { transform: translateY(0); }
  75% { transform: translateY(-4px); }
}

.desktop-icon.bouncing {
  animation: iconBounce 300ms ease;
}

/* Pixel Icon */
.pixel-icon {
  image-rendering: pixelated;
  image-rendering: crisp-edges;
}

/* Utility Classes */
.hidden {
  display: none !important;
}

.text-center {
  text-align: center;
}

.mt-4 {
  margin-top: 16px;
}

.mb-4 {
  margin-bottom: 16px;
}

.p-4 {
  padding: 16px;
}

/* Transcript Viewer */
.transcript-viewer {
  font-size: 11px;
  line-height: 1.6;
  white-space: pre-wrap;
}

.transcript-viewer .timestamp {
  color: var(--win95-titlebar);
  font-weight: bold;
  margin-right: 8px;
}

/* About Dialog */
.about-content {
  text-align: center;
}

.about-logo {
  font-size: 48px;
  margin-bottom: 8px;
}

.about-title {
  font-size: 16px;
  font-weight: bold;
  margin-bottom: 4px;
}

.about-version {
  font-size: 11px;
  color: var(--win95-text-disabled);
  margin-bottom: 16px;
}

/* AISummary */
.ai-summary {
  padding: 8px;
}

.ai-summary h3 {
  font-size: 14px;
  margin-bottom: 8px;
  color: var(--win95-titlebar);
}

.ai-summary p {
  margin-bottom: 8px;
  line-height: 1.5;
}

.ai-summary ul {
  margin-left: 16px;
}

.ai-summary li {
  margin-bottom: 4px;
}
