/* ============================================
   w1nd0w.css — Window Chrome & Controls
   Draggable terminal window, title bar, traffic
   light buttons, minimize/maximize states,
   taskbar dock, and resize handle
   ============================================ */

/* ---------- Main window container ---------- */
.window {
  width: 800px;
  height: 480px;
  background-color: rgba(0, 0, 0, 0.95);
  box-shadow: 0 0 30px #00ff00;
  border: 1px solid #222;
  display: flex;
  flex-direction: column;
  position: absolute;
  z-index: 10;
  cursor: default;
  user-select: none;
}

/* ---------- Title bar — draggable header ---------- */
.title-bar {
  height: 30px;
  background-color: #222;
  display: flex;
  align-items: center;
  padding: 0 10px;
  color: #ccc;
  font-size: 0.9rem;
  justify-content: space-between;
  cursor: grab;
}

.title-bar:active {
  cursor: grabbing;
}

/* ---------- Traffic light window controls ---------- */
.window-controls {
  display: flex;
  gap: 6px;
}

/* Base circle for all three buttons */
.window-controls div {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background-color: #444;
  cursor: pointer;
  position: relative;
  transition: all 0.2s ease;
}

.window-controls div:hover {
  transform: scale(1.1);
  box-shadow: 0 0 8px rgba(255, 255, 255, 0.3);
}

/* Close button (red) — shows × on hover */
.close { 
  background-color: #ff5f57; 
}

.close:hover {
  background-color: #ff4444;
}

.close:hover::after {
  content: "×";
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 10px;
  font-weight: bold;
  color: #800000;
  line-height: 1;
}

/* Minimize button (yellow) — shows − on hover */
.minimize { 
  background-color: #ffbd30; 
}

.minimize:hover {
  background-color: #ffaa00;
}

.minimize:hover::after {
  content: "−";
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 12px;
  font-weight: bold;
  color: #996600;
  line-height: 1;
}

/* Maximize button (green) — shows □ on hover */
.maximize { 
  background-color: #28c940; 
}

.maximize:hover {
  background-color: #22aa33;
}

.maximize:hover::after {
  content: "□";
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 8px;
  font-weight: bold;
  color: #004400;
  line-height: 1;
}

/* ---------- Window states ---------- */

/* Minimized — shrinks down and out of view */
.window.minimized {
  transform: scale(0.05) translateY(100vh);
  opacity: 0;
  pointer-events: none;
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Maximized — fills entire viewport below panel */
.window.maximized {
  width: 100vw !important;
  height: calc(100vh - 28px) !important;
  left: 0 !important;
  top: 28px !important;
  border-radius: 0;
  transition: all 0.3s ease;
}

/* ---------- Taskbar dock (minimized restore) ---------- */
/* Appears at bottom-center when window is minimized */
.taskbar-dock {
  position: fixed;
  bottom: 10px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(34, 34, 34, 0.95);
  border: 1px solid #00ff00;
  padding: 8px 20px;
  border-radius: 6px;
  color: #33ff33;
  font-family: 'Courier New', monospace;
  font-size: 0.85rem;
  cursor: pointer;
  display: none;
  z-index: 10000;
  box-shadow: 0 0 15px rgba(0, 255, 0, 0.3);
  animation: taskbar-pulse 2s ease-in-out infinite;
}

.taskbar-dock:hover {
  background: rgba(0, 255, 0, 0.15);
  box-shadow: 0 0 25px rgba(0, 255, 0, 0.5);
}

@keyframes taskbar-pulse {
  0%, 100% { box-shadow: 0 0 15px rgba(0, 255, 0, 0.3); }
  50% { box-shadow: 0 0 25px rgba(0, 255, 0, 0.6); }
}

/* ---------- Resize handle (bottom-right corner) ---------- */
.resize-handle {
  position: absolute;
  bottom: 0;
  right: 0;
  width: 16px;
  height: 16px;
  cursor: nwse-resize;
  z-index: 10;
}

.resize-handle::after {
  content: "";
  position: absolute;
  bottom: 3px;
  right: 3px;
  width: 8px;
  height: 8px;
  border-right: 2px solid #555;
  border-bottom: 2px solid #555;
}
