/* Scene 2: FurkanOS Desktop & Windows - Clean In-Screen Fit */
.laptop-os-screen {
  position: fixed;
  top: 50.9%;
  left: 50%;
  width: 117.2vh;
  height: 74.2vh;
  max-width: 96vw;
  max-height: 90vh;
  min-width: 300px;
  min-height: 200px;
  transform: translate(-50%, -50%) perspective(1250px) rotateX(5.2deg) scale(1);
  transform-origin: center center;
  z-index: 100;
  background: #000000 url('../../assets/images/wallpaper.jpg?v=3.1') center center / cover no-repeat;
  border-radius: 20px;
  box-shadow: none;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  opacity: 0;
  pointer-events: none;
  clip-path: circle(0px at calc(100% - 26px) calc(100% - 19px));
  -webkit-clip-path: circle(0px at calc(100% - 26px) calc(100% - 19px));
}

.laptop-os-screen.is-active {
  opacity: 1;
  pointer-events: auto;
}

.os-topbar {
  height: 32px;
  background: var(--c-os-panel);
  backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--c-os-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 12px;
  font-size: 0.74rem;
  z-index: 1000;
}

.topbar-left, .topbar-right {
  display: flex;
  align-items: center;
  gap: 12px;
}

.os-logo {
  font-family: var(--font-display);
  font-weight: 800;
  color: var(--c-accent);
  letter-spacing: 0.05em;
}

.topbar-btn {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--c-os-border);
  color: #fff;
  font-family: var(--font-mono);
  font-size: 0.68rem;
  padding: 3px 8px;
  border-radius: 5px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.topbar-btn:hover {
  background: var(--c-accent);
  color: #000;
  border-color: var(--c-accent);
}

.os-desktop-area {
  flex: 1;
  position: relative;
  overflow: hidden;
  padding: 14px;
  display: grid;
  grid-template-columns: repeat(auto-fill, 78px);
  grid-auto-rows: 82px;
  gap: 12px;
  align-content: start;
}

.desktop-icon-btn {
  background: transparent;
  border: none;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  cursor: pointer;
  padding: 6px;
  border-radius: 8px;
  transition: background 0.15s ease, transform 0.15s ease;
}

.desktop-icon-btn:hover {
  background: rgba(255, 255, 255, 0.08);
  transform: translateY(-2px);
}

.icon-box {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  background: var(--c-os-card);
  border: 1px solid var(--c-os-border);
  display: grid;
  place-items: center;
  font-size: 1.25rem;
  box-shadow: 0 6px 14px rgba(0, 0, 0, 0.3);
}

.icon-label {
  font-size: 0.68rem;
  color: var(--c-os-text);
  text-shadow: 0 2px 4px rgba(0,0,0,0.8);
}

/* Floating Window Chrome */
.os-window {
  position: absolute;
  min-width: 280px;
  min-height: 180px;
  max-width: 100%;
  max-height: calc(100% - 38px);
  height: 350px;
  background: var(--c-os-panel);
  backdrop-filter: blur(28px);
  border: 1px solid var(--c-os-border);
  border-radius: 10px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.6);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-sizing: border-box;
  z-index: 200;
  animation: win-open 0.25s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.os-window.is-hidden {
  display: none !important;
}

.os-window.is-minimized {
  display: none !important;
}

.os-window.is-maximized {
  top: 0px !important;
  left: 0px !important;
  width: 100% !important;
  height: calc(100% - 38px) !important;
  max-width: 100% !important;
  max-height: calc(100% - 38px) !important;
  border-radius: 0 !important;
  border: none !important;
  border-bottom: 1px solid var(--c-os-border) !important;
  box-shadow: none !important;
  animation: none !important;
}

@keyframes win-open {
  from {
    opacity: 0;
    transform: scale(0.92);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

.window-titlebar {
  height: 32px;
  background: rgba(255, 255, 255, 0.03);
  border-bottom: 1px solid var(--c-os-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 12px;
  cursor: grab;
  user-select: none;
  flex-shrink: 0;
}

.window-titlebar:active {
  cursor: grabbing;
}

.win-controls {
  display: flex;
  gap: 6px;
  align-items: center;
}

.win-dot {
  width: 11px;
  height: 11px;
  border-radius: 50%;
  cursor: pointer;
  transition: transform 0.15s ease, filter 0.15s ease;
}

.win-dot:hover {
  transform: scale(1.2);
  filter: brightness(1.25);
}

.win-close { background: #ff5f56; }
.win-max { background: #ffbd2e; } /* Yellow: Maximize */
.win-min { background: #27c93f; } /* Green: Minimize */

/* 8-Direction Resize Handles */
.win-resize-handle {
  position: absolute;
  z-index: 150;
  user-select: none;
}
.win-resize-handle.handle-e { right: 0; top: 0; bottom: 0; width: 7px; cursor: e-resize; }
.win-resize-handle.handle-w { left: 0; top: 0; bottom: 0; width: 7px; cursor: w-resize; }
.win-resize-handle.handle-s { bottom: 0; left: 0; right: 0; height: 7px; cursor: s-resize; }
.win-resize-handle.handle-n { top: 0; left: 0; right: 0; height: 7px; cursor: n-resize; }
.win-resize-handle.handle-se { right: 0; bottom: 0; width: 14px; height: 14px; cursor: se-resize; }
.win-resize-handle.handle-sw { left: 0; bottom: 0; width: 14px; height: 14px; cursor: sw-resize; }
.win-resize-handle.handle-ne { right: 0; top: 0; width: 14px; height: 14px; cursor: ne-resize; }
.win-resize-handle.handle-nw { left: 0; top: 0; width: 14px; height: 14px; cursor: nw-resize; }

.win-title {
  font-family: var(--font-display);
  font-size: 0.74rem;
  font-weight: 700;
  color: var(--c-os-text);
  display: flex;
  align-items: center;
  gap: 5px;
}

.window-body {
  flex: 1 1 0;
  min-height: 0;
  padding: 12px;
  overflow-y: auto;
  overflow-x: hidden;
  display: flex;
  flex-direction: column;
  color: var(--c-os-text);
  font-size: 0.8rem;
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.2) transparent;
}

.window-body::-webkit-scrollbar {
  width: 5px;
}

.window-body::-webkit-scrollbar-track {
  background: transparent;
}

.window-body::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.2);
  border-radius: 4px;
}

/* App: Terminal */
.term-container {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  font-family: var(--font-mono);
  font-size: 0.76rem;
}

.term-output {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 4px;
}

.term-line {
  line-height: 1.45;
}

.term-line.cmd { color: var(--c-accent); font-weight: 700; }
.term-line.sys { color: var(--c-os-dim); }
.term-line.res { color: var(--c-os-text); }

.term-input-box {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 4px;
  padding-bottom: 8px;
}

.term-prompt-tag {
  color: #10b981;
  font-weight: 700;
}

.term-input-field {
  flex: 1;
  background: transparent;
  border: none;
  outline: none;
  font-family: var(--font-mono);
  font-size: 0.76rem;
  color: #fff;
}

/* App: Notes */
#win-notes .window-body {
  display: flex;
  flex-direction: column;
  flex: 1 1 0;
  min-height: 0;
  padding-bottom: 12px;
}

.notes-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
  font-size: 0.68rem;
  color: var(--c-os-dim);
  flex-shrink: 0;
}

.notes-textarea {
  width: 100%;
  flex: 1 1 0;
  min-height: 0;
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid var(--c-os-border);
  border-radius: 6px;
  padding: 10px;
  color: #fff;
  font-family: var(--font-mono);
  font-size: 0.76rem;
  line-height: 1.45;
  resize: none;
  outline: none;
  box-sizing: border-box;
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.2) transparent;
}

.notes-textarea::-webkit-scrollbar {
  width: 5px;
}

.notes-textarea::-webkit-scrollbar-track {
  background: transparent;
}

.notes-textarea::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.2);
  border-radius: 4px;
}

/* App: Pac-Man Game */
.pacman-app-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}

.pacman-header {
  width: 100%;
  display: flex;
  justify-content: space-between;
  font-family: var(--font-display);
  font-size: 0.78rem;
  color: var(--c-gold);
}

#pacman-canvas {
  background: #000;
  border: 2px solid #2121ff;
  border-radius: 6px;
  box-shadow: 0 0 16px rgba(33, 33, 255, 0.3);
}

.pacman-controls-tip {
  font-size: 0.65rem;
  color: var(--c-os-dim);
}

/* Project Cards */
.proj-item-card {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--c-os-border);
  padding: 10px;
  border-radius: 6px;
  margin-bottom: 8px;
}

.proj-item-card strong {
  color: #fff;
  font-size: 0.78rem;
}

.proj-item-card p {
  font-size: 0.7rem;
  margin-top: 3px;
  color: var(--c-os-dim);
}

.proj-link-row {
  display: flex;
  gap: 8px;
  margin-top: 5px;
}

.proj-link-btn {
  font-family: var(--font-mono);
  font-size: 0.66rem;
  font-weight: 700;
  color: var(--c-accent);
  text-decoration: none;
}

/* Dock & Taskbar */
.os-dock {
  height: 38px;
  background: rgba(215, 230, 248, 0.18);
  backdrop-filter: blur(28px) saturate(160%);
  -webkit-backdrop-filter: blur(28px) saturate(160%);
  border-top: 1px solid rgba(255, 255, 255, 0.22);
  box-shadow: 0 -4px 20px rgba(200, 225, 255, 0.08);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 14px;
  position: relative;
  z-index: 1000;
  user-select: none;
}

.dock-apps-container {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.dock-tray-right {
  position: absolute;
  right: 14px;
  top: 50%;
  transform: translateY(-50%);
  display: flex;
  align-items: center;
  gap: 10px;
}

#os-clock {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 600;
  color: #ffffff;
  letter-spacing: 0.04em;
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.6);
}

.os-power-btn {
  width: 24px;
  height: 24px;
  border-radius: 5px;
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.22);
  color: #fff;
  display: grid;
  place-items: center;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  padding: 0;
}

.os-power-btn:hover {
  background: rgba(239, 68, 68, 0.35);
  border-color: #ef4444;
  color: #fff;
  box-shadow: 0 0 14px rgba(239, 68, 68, 0.5);
  transform: scale(1.08);
}

.dock-app-btn {
  width: 24px;
  height: 24px;
  border-radius: 5px;
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: #fff;
  display: grid;
  place-items: center;
  font-size: 0.96rem;
  line-height: 1;
  cursor: pointer;
  transition: all 0.15s ease;
  position: relative;
}

.dock-app-btn:hover {
  transform: translateY(-2px) scale(1.15);
  background: rgba(255, 255, 255, 0.24);
  border-color: rgba(255, 255, 255, 0.5);
  box-shadow: 0 4px 12px rgba(200, 225, 255, 0.3);
}

.dock-dot {
  position: absolute;
  bottom: -2px;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--c-accent);
}

/* App: Snake Game */
.snake-app-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

.snake-header {
  width: 100%;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-family: var(--font-mono);
  font-size: 0.76rem;
  color: var(--c-os-dim);
  padding: 0 4px;
}

.snake-ctrl-btn {
  background: rgba(56, 189, 248, 0.15);
  border: 1px solid var(--c-accent);
  color: var(--c-accent);
  font-family: var(--font-mono);
  font-size: 0.7rem;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.snake-ctrl-btn:hover {
  background: var(--c-accent);
  color: #0b0d13;
}

#snake-canvas {
  background: #0a0e17;
  border: 1px solid var(--c-os-border);
  border-radius: 6px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.5);
  image-rendering: pixelated;
}

.snake-controls-tip {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  color: var(--c-os-dim);
  text-align: center;
}

.snake-controls-tip b {
  color: #fff;
}
