/* ============================================
   BF_OS — Portfolio 1: Operating System Theme
   ============================================ */

:root {
  --bg-primary: #0a0a12;
  --bg-secondary: #0e0e1a;
  --bg-window: #111122;
  --bg-titlebar: #1a1a2e;
  --border: #2a2a4e;
  --border-active: #00e5ff;
  --text-primary: #e0e0e0;
  --text-secondary: #888899;
  --accent: #00e5ff;
  --accent-glow: rgba(0, 229, 255, 0.4);
  --accent-dim: rgba(0, 229, 255, 0.15);
  --success: #28ca42;
  --warning: #ffbd2e;
  --danger: #ff5f57;
  --font-mono: 'SF Mono', 'Fira Code', 'Cascadia Code', 'Consolas', monospace;
  --font-sans: 'Inter', 'Segoe UI', system-ui, sans-serif;
}

*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html, body {
  height: 100%;
  overflow: hidden;
}

body {
  background: var(--bg-primary);
  color: var(--text-primary);
  font-family: var(--font-sans);
  -webkit-font-smoothing: antialiased;
}

::selection {
  background: var(--accent);
  color: var(--bg-primary);
}

/* ============================================
   BOOT SCREEN
   ============================================ */

.boot-screen {
  position: fixed;
  inset: 0;
  background: linear-gradient(180deg, #0a0a12 0%, #0f1724 50%, #0a0a12 100%);
  z-index: 9999;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  transition: opacity 0.8s ease;
}

.boot-screen.hidden {
  opacity: 0;
  pointer-events: none;
}

/* BIOS text styling */
.bios-text {
  font-family: var(--font-mono);
  font-size: 0.9rem;
  color: #00ff00;
  white-space: pre-wrap;
  line-height: 1.6;
  max-width: 800px;
  padding: 2rem;
  align-self: flex-start;
  text-shadow: 0 0 5px rgba(0, 255, 0, 0.5);
}

.bios-text.fade-out {
  opacity: 0;
  transition: opacity 0.5s ease;
}

.boot-splash {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
  opacity: 0;
  transform: scale(0.9);
  animation: splashFadeIn 1s ease-out 0.3s forwards;
}

@keyframes splashFadeIn {
  to {
    opacity: 1;
    transform: scale(1);
  }
}

.splash-logo {
  display: flex;
  align-items: baseline;
  gap: 8px;
  filter: drop-shadow(0 0 30px rgba(0, 229, 255, 0.5));
}

.splash-bf {
  font-family: 'Segoe UI', sans-serif;
  font-size: 120px;
  font-weight: 700;
  background: linear-gradient(180deg, #00e5ff 0%, #0088ff 50%, #005599 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  line-height: 1;
  letter-spacing: -5px;
}

.splash-os {
  font-family: 'Segoe UI', sans-serif;
  font-size: 80px;
  font-weight: 300;
  color: rgba(255, 255, 255, 0.9);
  line-height: 1;
}

.splash-year {
  font-family: var(--font-mono);
  font-size: 14px;
  color: rgba(255, 255, 255, 0.4);
  letter-spacing: 3px;
  margin-top: -10px;
}

.splash-loader {
  margin-top: 40px;
}

.block-loader {
  display: flex;
  gap: 4px;
}

.block-loader .block {
  width: 20px;
  height: 20px;
  background: rgba(0, 229, 255, 0.2);
  border: 1px solid rgba(0, 229, 255, 0.3);
  transition: background 0.2s, box-shadow 0.2s;
}

.block-loader .block.active {
  background: linear-gradient(180deg, #00e5ff 0%, #0088ff 100%);
  box-shadow: 0 0 15px rgba(0, 229, 255, 0.6);
}

.block-loader .block.pulse {
  animation: blockPulse 0.3s ease-out;
}

@keyframes blockPulse {
  0% { transform: scale(1); }
  50% { transform: scale(1.2); }
  100% { transform: scale(1); }
}

.splash-tagline {
  font-family: 'Segoe UI', sans-serif;
  font-size: 12px;
  color: rgba(255, 255, 255, 0.3);
  letter-spacing: 4px;
  text-transform: uppercase;
  margin-top: 30px;
}

@media (max-width: 600px) {
  .splash-bf {
    font-size: 70px;
  }
  .splash-os {
    font-size: 45px;
  }
  .block-loader .block {
    width: 14px;
    height: 14px;
  }
}

/* ============================================
   DESKTOP
   ============================================ */

.desktop {
  position: fixed;
  inset: 0;
  bottom: 40px;
  opacity: 0;
  transition: opacity 0.5s ease;
}

.desktop.visible {
  opacity: 1;
}

.desktop-bg {
  position: absolute;
  inset: 0;
  z-index: 0;
}

/* Desktop Watermark */
.desktop-watermark {
  position: absolute;
  bottom: 60px;
  right: 30px;
  z-index: 1;
  text-align: right;
  font-family: var(--font-mono);
  user-select: none;
}

.watermark-name {
  font-size: 2.5rem;
  font-weight: 700;
  letter-spacing: 2px;
  color: var(--accent);
  text-transform: uppercase;
  line-height: 1.1;
  opacity: 0.08;
  pointer-events: none;
}

.watermark-email {
  font-size: 0.9rem;
  letter-spacing: 3px;
  color: var(--text-secondary);
  margin-top: 4px;
  opacity: 0.4;
  cursor: pointer;
  transition: all 0.2s ease;
  padding: 4px 8px;
  border-radius: 4px;
  display: inline-block;
}

.watermark-email:hover {
  opacity: 0.8;
  color: var(--accent);
  background: var(--accent-dim);
}

.watermark-email:active {
  transform: scale(0.98);
}

.watermark-email.copied {
  color: var(--success);
}

.watermark-email.copied::after {
  content: ' ✓ Copied!';
  font-size: 0.75rem;
}

/* ============================================
   DESKTOP ICONS
   ============================================ */

.desktop-icons {
  position: absolute;
  top: 20px;
  left: 20px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  z-index: 1;
}

.desktop-icon {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100px;
  padding: 10px 5px;
  border-radius: 6px;
  cursor: pointer;
  transition: background 0.15s;
  user-select: none;
}

.desktop-icon:hover {
  background: var(--accent-dim);
}

.desktop-icon:active {
  background: rgba(0, 229, 255, 0.25);
}

.icon-img {
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-window);
  border: 1px solid var(--border);
  border-radius: 8px;
  margin-bottom: 6px;
}

.icon-img svg {
  width: 28px;
  height: 28px;
  color: var(--accent);
}

.icon-label {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: var(--text-primary);
  text-align: center;
  text-shadow: 0 1px 3px rgba(0,0,0,0.8);
  word-break: break-word;
  min-height: 2em;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* ============================================
   WINDOWS
   ============================================ */

.windows-container {
  position: absolute;
  inset: 0;
  z-index: 10;
  pointer-events: none;
}

.window {
  position: absolute;
  background: var(--bg-window);
  border: 1px solid var(--border);
  border-radius: 8px;
  box-shadow: 0 10px 40px rgba(0,0,0,0.5), 0 0 1px var(--border);
  min-width: 320px;
  min-height: 200px;
  display: flex;
  flex-direction: column;
  pointer-events: auto;
  opacity: 0;
  transform: scale(0.95);
  transition: opacity 0.15s, transform 0.15s, box-shadow 0.2s;
}

.window.visible {
  opacity: 1;
  transform: scale(1);
}

.window.active {
  border-color: var(--accent);
  box-shadow: 0 10px 40px rgba(0,0,0,0.6), 0 0 20px var(--accent-dim);
}

.window.minimized {
  opacity: 0;
  transform: scale(0.8) translateY(100px);
  pointer-events: none;
}

.window-titlebar {
  display: flex;
  align-items: center;
  padding: 0 12px;
  height: 36px;
  background: var(--bg-titlebar);
  border-bottom: 1px solid var(--border);
  border-radius: 8px 8px 0 0;
  cursor: grab;
  user-select: none;
}

.window-titlebar:active {
  cursor: grabbing;
}

.window-controls {
  display: flex;
  gap: 8px;
  margin-right: 12px;
  padding: 6px;
  position: relative;
  z-index: 10;
}

.window-btn {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  border: none;
  cursor: pointer;
  transition: transform 0.1s, filter 0.1s;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0;
  line-height: 1;
  color: transparent;
  position: relative;
  padding: 0;
  /* Expand clickable area without changing visual size */
  box-shadow: 0 0 0 4px transparent;
}

.window-btn::before {
  content: '';
  position: absolute;
  top: -6px;
  left: -6px;
  right: -6px;
  bottom: -6px;
}

.window-btn::after {
  position: absolute;
  font-size: 9px;
  font-weight: 700;
  color: rgba(0, 0, 0, 0);
  transition: color 0.1s;
  font-family: Arial, sans-serif;
}

.window-controls:hover .window-btn::after {
  color: rgba(0, 0, 0, 0.7);
}

.window-btn.close::after { content: '×'; font-size: 11px; }
.window-btn.minimize::after { content: '−'; }
.window-btn.maximize::after { content: '+'; }

.window-btn:hover {
  transform: scale(1.15);
  filter: brightness(1.2);
}

.window-btn.close { background: var(--danger); }
.window-btn.minimize { background: var(--warning); }
.window-btn.maximize { background: var(--success); }

.window-title {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--text-secondary);
  flex: 1;
  text-align: center;
  letter-spacing: 1px;
}

.window-share-btn {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 0.8rem;
  padding: 2px 6px;
  opacity: 0.4;
  transition: opacity 0.15s;
  line-height: 1;
}

.window-share-btn:hover {
  opacity: 1;
}

.window-content {
  flex: 1;
  padding: 1.5rem;
  overflow-y: auto;
}

.window-content::-webkit-scrollbar { width: 6px; }
.window-content::-webkit-scrollbar-track { background: var(--bg-primary); }
.window-content::-webkit-scrollbar-thumb { background: var(--accent); border-radius: 3px; }

/* Window Resize Handles */
.resize-handle {
  position: absolute;
  z-index: 10;
}

.resize-n, .resize-s {
  left: 8px;
  right: 8px;
  height: 6px;
}

.resize-e, .resize-w {
  top: 8px;
  bottom: 8px;
  width: 6px;
}

.resize-n { top: -3px; cursor: ns-resize; }
.resize-s { bottom: -3px; cursor: ns-resize; }
.resize-e { right: -3px; cursor: ew-resize; }
.resize-w { left: -3px; cursor: ew-resize; }

.resize-ne, .resize-nw, .resize-se, .resize-sw {
  width: 12px;
  height: 12px;
}

.resize-ne { top: -3px; right: -3px; cursor: nesw-resize; }
.resize-nw { top: -3px; left: -3px; cursor: nwse-resize; }
.resize-se { bottom: -3px; right: -3px; cursor: nwse-resize; }
.resize-sw { bottom: -3px; left: -3px; cursor: nesw-resize; }

/* ============================================
   TASKBAR
   ============================================ */

.taskbar {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: 40px;
  background: rgba(10, 10, 18, 0.95);
  backdrop-filter: blur(10px);
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  padding: 0 8px;
  z-index: 1000;
  opacity: 0;
  transform: translateY(100%);
  transition: opacity 0.3s, transform 0.3s;
}

.taskbar.visible {
  opacity: 1;
  transform: translateY(0);
}

.start-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px;
  background: var(--bg-window);
  border: 1px solid var(--border);
  border-radius: 4px;
  color: var(--text-primary);
  font-family: var(--font-mono);
  font-size: 0.8rem;
  cursor: pointer;
  transition: all 0.15s;
}

.start-btn:hover {
  background: var(--bg-titlebar);
  border-color: var(--accent);
}

.start-btn.active {
  background: var(--accent-dim);
  border-color: var(--accent);
}

.start-icon {
  font-weight: 700;
  color: var(--accent);
  text-shadow: 0 0 10px var(--accent-glow);
}

.taskbar-apps {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 0 12px;
  overflow-x: auto;
}

.taskbar-app {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 4px 12px;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: 4px;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.15s;
  white-space: nowrap;
}

.taskbar-app:hover {
  background: var(--bg-window);
}

.taskbar-app.active {
  background: var(--accent-dim);
  border-color: var(--accent);
  color: var(--accent);
}

.taskbar-app.minimized {
  opacity: 0.5;
}

.taskbar-tray {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 0 12px;
  font-family: var(--font-mono);
  font-size: 0.75rem;
}

.taskbar-app-icon {
  display: none;
}

.tray-weather {
  display: flex;
  align-items: center;
  gap: 4px;
  cursor: pointer;
  padding: 2px 6px;
  border-radius: 4px;
  transition: background 0.15s;
}

.tray-weather:hover {
  background: rgba(0, 229, 255, 0.1);
}

.weather-icon {
  font-size: 14px;
  line-height: 1;
}

.weather-temp {
  color: var(--text-secondary);
}

.weather-tab-btn.active {
  background: var(--accent) !important;
  color: var(--bg-primary) !important;
  border-color: var(--accent) !important;
}

.weather-scroll {
  max-height: 260px;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: rgba(0, 229, 255, 0.3) rgba(255, 255, 255, 0.03);
}

.weather-scroll::-webkit-scrollbar {
  width: 6px;
}

.weather-scroll::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.03);
  border-radius: 3px;
}

.weather-scroll::-webkit-scrollbar-thumb {
  background: rgba(0, 229, 255, 0.3);
  border-radius: 3px;
}

.weather-scroll::-webkit-scrollbar-thumb:hover {
  background: rgba(0, 229, 255, 0.5);
}

.tray-clock {
  color: var(--text-secondary);
}

/* ============================================
   START MENU
   ============================================ */

.start-menu {
  position: fixed;
  bottom: 48px;
  left: 8px;
  width: 280px;
  background: rgba(17, 17, 34, 0.98);
  backdrop-filter: blur(20px);
  border: 1px solid var(--border);
  border-radius: 8px;
  box-shadow: 0 10px 40px rgba(0,0,0,0.5);
  z-index: 1001;
  opacity: 0;
  transform: translateY(20px) scale(0.95);
  pointer-events: none;
  transition: all 0.2s ease;
}

.start-menu.visible {
  opacity: 1;
  transform: translateY(0) scale(1);
  pointer-events: auto;
}

.start-menu-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem;
  border-bottom: 1px solid var(--border);
}

.start-menu-title {
  font-family: var(--font-mono);
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--accent);
  text-shadow: 0 0 15px var(--accent-glow);
}

.start-menu-version {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: var(--text-secondary);
}

.start-menu-items {
  padding: 0.5rem 0;
}

.start-menu-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0.75rem 1rem;
  font-family: var(--font-mono);
  font-size: 0.85rem;
  color: var(--text-primary);
  cursor: pointer;
  transition: all 0.15s;
}

.start-menu-item:hover {
  background: var(--accent-dim);
  color: var(--accent);
}

.menu-icon {
  font-size: 1.2rem;
}

.start-menu-divider {
  height: 1px;
  background: var(--border);
  margin: 0.25rem 1rem;
}

.start-menu-item.has-submenu {
  position: relative;
}

.menu-label {
  flex: 1;
}

.submenu-arrow {
  margin-left: auto;
  font-size: 0.7rem;
  color: var(--text-secondary);
}

.start-submenu {
  display: none;
  position: absolute;
  left: 100%;
  top: 0;
  width: 220px;
  background: rgba(17, 17, 34, 0.98);
  backdrop-filter: blur(20px);
  border: 1px solid var(--border);
  border-radius: 6px;
  box-shadow: 0 10px 40px rgba(0,0,0,0.5);
  max-height: 400px;
  overflow-y: auto;
  z-index: 10;
  padding: 0.25rem 0;
  scrollbar-width: thin;
  scrollbar-color: rgba(0,229,255,0.3) rgba(255,255,255,0.03);
}

@media (hover: hover) {
  .start-menu-item.has-submenu:hover > .start-submenu {
    display: block;
  }
}

.start-menu-item.has-submenu.submenu-open > .start-submenu {
  display: block;
}

.start-submenu-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0.5rem 1rem;
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--text-primary);
  cursor: pointer;
  transition: all 0.15s;
  white-space: nowrap;
}

.start-submenu-item:hover {
  background: var(--accent-dim);
  color: var(--accent);
}

.start-submenu-icon {
  font-size: 1rem;
  width: 1.2em;
  text-align: center;
}

.start-menu-footer {
  padding: 0.75rem 1rem;
  border-top: 1px solid var(--border);
  font-family: var(--font-mono);
  font-size: 0.65rem;
  color: var(--text-secondary);
  text-align: center;
}

/* ============================================
   SCREENSAVER (Windows 98 Style)
   ============================================ */

.screensaver {
  position: fixed;
  inset: 0;
  background: #000;
  z-index: 10000;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.5s ease;
  cursor: none;
}

.screensaver.active {
  opacity: 1;
  pointer-events: auto;
}

.screensaver-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.screensaver-logo {
  position: absolute;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  font-family: 'MS Sans Serif', 'Segoe UI', Tahoma, sans-serif;
  user-select: none;
  text-shadow:
    2px 2px 0 rgba(0, 0, 0, 0.8),
    4px 4px 8px rgba(0, 0, 0, 0.5);
  transition: color 0.1s;
}

.screensaver-logo-text {
  font-size: 72px;
  font-weight: 700;
  line-height: 1;
  letter-spacing: -2px;
}

.screensaver-logo-sub {
  font-size: 24px;
  font-weight: 400;
  letter-spacing: 12px;
  margin-top: 4px;
  opacity: 0.9;
}

/* Retro CRT scanline effect */
.screensaver::after {
  content: '';
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(
    0deg,
    transparent,
    transparent 2px,
    rgba(0, 0, 0, 0.1) 2px,
    rgba(0, 0, 0, 0.1) 4px
  );
  pointer-events: none;
}

/* ============================================
   RESPONSIVE
   ============================================ */

@media (max-width: 768px) {
  .desktop-icons {
    flex-direction: row;
    flex-wrap: wrap;
    top: 10px;
    left: 10px;
    right: 10px;
  }

  .desktop-icon {
    width: 90px;
  }

  .window {
    width: 100% !important;
    height: calc(100% - 40px) !important;
    left: 0 !important;
    top: 0 !important;
    border-radius: 0;
    border-left: none;
    border-right: none;
    border-top: none;
  }

  .window-titlebar {
    border-radius: 0;
    height: 44px;
    padding: 0 14px;
  }

  .window-controls {
    gap: 14px;
  }

  .window-btn {
    width: 20px;
    height: 20px;
  }

  .window-btn::after {
    font-size: 13px;
  }

  .window-btn.close::after { font-size: 15px; }

  .taskbar-app-icon {
    display: inline;
  }

  .taskbar-app-title {
    display: none;
  }

  .taskbar-app {
    padding: 4px 8px;
    font-size: 1rem;
  }

  .start-menu {
    width: calc(100% - 16px);
    left: 8px;
    right: 8px;
  }

  .start-submenu {
    position: static;
    width: 100%;
    border: none;
    border-top: 1px solid var(--border);
    border-radius: 0;
    box-shadow: none;
    background: rgba(0, 0, 0, 0.2);
    max-height: 200px;
  }

  .projects-content {
    grid-template-columns: 1fr;
  }
}