/* ============================================
   WINDOWS 98 PORTFOLIO
   ============================================ */
@import url('https://fonts.googleapis.com/css2?family=VT323&display=swap');

:root {
  --win-bg: #c0c0c0;
  --win-title: linear-gradient(90deg, #000080, #1084d0);
  --win-title-inactive: linear-gradient(90deg, #808080, #b0b0b0);
  --desktop: #008080;
  --btn-face: #c0c0c0;
  --btn-highlight: #ffffff;
  --btn-shadow: #808080;
  --btn-dark: #000000;
  --text: #000000;
  --link: #0000ff;
  --selection-bg: #000080;
  --selection-fg: #ffffff;
  --font: 'Tahoma', 'MS Sans Serif', 'Arial', sans-serif;
  --font-pixel: 'VT323', monospace;
}

*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }
html, body { height: 100%; overflow: hidden; }
body { font-family: var(--font); font-size: 11px; color: var(--text); background: var(--desktop); cursor: default; }
::selection { background: var(--selection-bg); color: var(--selection-fg); }

/* Win98 raised border */
.raised {
  border-top: 2px solid var(--btn-highlight);
  border-left: 2px solid var(--btn-highlight);
  border-right: 2px solid var(--btn-dark);
  border-bottom: 2px solid var(--btn-dark);
  box-shadow: inset 1px 1px 0 #dfdfdf, inset -1px -1px 0 var(--btn-shadow);
}
/* Win98 sunken border */
.sunken {
  border-top: 2px solid var(--btn-shadow);
  border-left: 2px solid var(--btn-shadow);
  border-right: 2px solid var(--btn-highlight);
  border-bottom: 2px solid var(--btn-highlight);
  box-shadow: inset 1px 1px 0 var(--btn-dark), inset -1px -1px 0 #dfdfdf;
}

/* === DESKTOP === */
.desktop {
  width: 100vw; height: calc(100vh - 30px);
  position: relative; overflow: hidden;
  background: var(--desktop);
}

/* === DESKTOP ICONS === */
.desktop-icons {
  display: flex; flex-direction: column; gap: 8px;
  padding: 12px; position: absolute; top: 0; left: 0;
}
.desktop-icon {
  display: flex; flex-direction: column; align-items: center;
  gap: 4px; width: 70px; padding: 4px;
  cursor: pointer; text-align: center;
  border: 1px solid transparent; border-radius: 0;
}
.desktop-icon:hover { background: rgba(0,0,128,0.2); }
.desktop-icon:active { background: rgba(0,0,128,0.4); }
.desktop-icon__img {
  width: 32px; height: 32px; display: flex;
  align-items: center; justify-content: center; font-size: 24px;
  image-rendering: pixelated;
}
.desktop-icon__img img { width: 32px; height: 32px; image-rendering: pixelated; }
.desktop-icon__label {
  color: #fff; font-size: 11px; text-shadow: 1px 1px 1px #000;
  word-wrap: break-word; line-height: 1.2;
}

/* === WINDOW === */
.window {
  position: absolute; background: var(--win-bg);
  border-top: 2px solid var(--btn-highlight);
  border-left: 2px solid var(--btn-highlight);
  border-right: 2px solid var(--btn-dark);
  border-bottom: 2px solid var(--btn-dark);
  box-shadow: 1px 1px 0 var(--btn-dark);
  display: none; min-width: 250px; min-height: 150px;
}
.window.open { display: block; }
.window.minimized { display: none; }

/* Title bar */
.window__titlebar {
  background: var(--win-title);
  padding: 2px 3px; display: flex; align-items: center;
  gap: 4px; cursor: move; user-select: none;
  height: 20px;
}
.window.inactive .window__titlebar { background: var(--win-title-inactive); }
.window__title-icon { width: 16px; height: 16px; font-size: 12px; display: flex; align-items: center; justify-content: center; }
.window__title-icon img { width: 16px; height: 16px; image-rendering: pixelated; }
.start-menu__item-icon img { width: 16px; height: 16px; image-rendering: pixelated; }
.window__title-text {
  flex: 1; color: #fff; font-size: 11px; font-weight: 700;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.window__controls { display: flex; gap: 2px; }
.window__btn {
  width: 16px; height: 14px; background: var(--btn-face);
  border-top: 1px solid var(--btn-highlight);
  border-left: 1px solid var(--btn-highlight);
  border-right: 1px solid var(--btn-dark);
  border-bottom: 1px solid var(--btn-dark);
  display: flex; align-items: center; justify-content: center;
  font-size: 9px; font-weight: 700; cursor: pointer;
  font-family: 'Marlett', var(--font); line-height: 1; padding: 0;
  color: var(--text);
}
.window__btn:active {
  border-top: 1px solid var(--btn-dark);
  border-left: 1px solid var(--btn-dark);
  border-right: 1px solid var(--btn-highlight);
  border-bottom: 1px solid var(--btn-highlight);
}

/* Menu bar */
.window__menubar {
  padding: 1px 0; display: flex; gap: 0;
  border-bottom: 1px solid var(--btn-shadow);
}
.window__menu-item {
  padding: 2px 8px; cursor: pointer; font-size: 11px;
}
.window__menu-item:hover { background: var(--selection-bg); color: var(--selection-fg); }

/* Window body */
.window__body {
  background: #fff; margin: 4px;
  border-top: 1px solid var(--btn-shadow);
  border-left: 1px solid var(--btn-shadow);
  border-right: 1px solid var(--btn-highlight);
  border-bottom: 1px solid var(--btn-highlight);
  padding: 8px; overflow-y: auto; font-size: 11px;
  max-height: calc(100% - 56px);
}
.window__body--gray { background: var(--win-bg); }

/* Status bar */
.window__statusbar {
  display: flex; padding: 2px 4px; gap: 4px;
  border-top: 1px solid var(--btn-shadow);
}
.window__status-section {
  padding: 1px 6px; font-size: 10px;
  border-top: 1px solid var(--btn-shadow);
  border-left: 1px solid var(--btn-shadow);
  border-right: 1px solid var(--btn-highlight);
  border-bottom: 1px solid var(--btn-highlight);
}

/* === TASKBAR === */
.taskbar {
  position: fixed; bottom: 0; left: 0; width: 100%;
  height: 30px; background: var(--btn-face);
  border-top: 2px solid var(--btn-highlight);
  display: flex; align-items: center;
  padding: 2px 4px; gap: 4px; z-index: 9999;
}
.start-btn {
  height: 22px; padding: 0 6px;
  display: flex; align-items: center; gap: 4px;
  font-weight: 700; font-size: 11px; cursor: pointer;
  background: var(--btn-face);
  border-top: 2px solid var(--btn-highlight);
  border-left: 2px solid var(--btn-highlight);
  border-right: 2px solid var(--btn-dark);
  border-bottom: 2px solid var(--btn-dark);
}
.start-btn:active, .start-btn.active {
  border-top: 2px solid var(--btn-dark);
  border-left: 2px solid var(--btn-dark);
  border-right: 2px solid var(--btn-highlight);
  border-bottom: 2px solid var(--btn-highlight);
  padding: 1px 5px 0 7px;
}
.start-btn__flag { font-size: 14px; }

.taskbar__divider {
  width: 2px; height: 20px; margin: 0 2px;
  border-left: 1px solid var(--btn-shadow);
  border-right: 1px solid var(--btn-highlight);
}
.taskbar__windows { display: flex; gap: 2px; flex: 1; overflow: hidden; }
.taskbar__win-btn {
  height: 22px; padding: 0 8px; max-width: 160px;
  font-size: 11px; cursor: pointer; white-space: nowrap;
  overflow: hidden; text-overflow: ellipsis;
  display: flex; align-items: center; gap: 4px;
  background: var(--btn-face);
  border-top: 2px solid var(--btn-highlight);
  border-left: 2px solid var(--btn-highlight);
  border-right: 2px solid var(--btn-dark);
  border-bottom: 2px solid var(--btn-dark);
}
.taskbar__win-btn.active {
  border-top: 2px solid var(--btn-dark);
  border-left: 2px solid var(--btn-dark);
  border-right: 2px solid var(--btn-highlight);
  border-bottom: 2px solid var(--btn-highlight);
  font-weight: 700; background: #d4d0c8;
}

.system-tray {
  display: flex; align-items: center; gap: 6px;
  padding: 0 6px; height: 20px;
  border-top: 1px solid var(--btn-shadow);
  border-left: 1px solid var(--btn-shadow);
  border-right: 1px solid var(--btn-highlight);
  border-bottom: 1px solid var(--btn-highlight);
}
.system-tray__clock { font-size: 11px; }

/* === START MENU === */
.start-menu {
  position: fixed; bottom: 30px; left: 0;
  width: 180px; background: var(--btn-face);
  border-top: 2px solid var(--btn-highlight);
  border-left: 2px solid var(--btn-highlight);
  border-right: 2px solid var(--btn-dark);
  border-bottom: 2px solid var(--btn-dark);
  z-index: 10000; display: none;
}
.start-menu.open { display: block; }
.start-menu__sidebar {
  position: absolute; left: 0; top: 0; bottom: 0;
  width: 22px; background: linear-gradient(to top, #000080, #1084d0);
  display: flex; align-items: flex-end; padding: 4px 2px;
}
.start-menu__sidebar-text {
  writing-mode: vertical-rl; transform: rotate(180deg);
  color: #c0c0c0; font-size: 16px; font-weight: 700;
  letter-spacing: 2px; font-family: var(--font);
}
.start-menu__items { margin-left: 22px; padding: 2px 0; }
.start-menu__item {
  display: flex; align-items: center; gap: 8px;
  padding: 6px 12px; cursor: pointer; font-size: 11px;
}
.start-menu__item:hover { background: var(--selection-bg); color: var(--selection-fg); }
.start-menu__item-icon { width: 20px; text-align: center; font-size: 16px; }
.start-menu__divider {
  height: 0; margin: 2px 22px 2px 30px;
  border-top: 1px solid var(--btn-shadow);
  border-bottom: 1px solid var(--btn-highlight);
}

/* === NOTIFICATION POPUP === */
.notification {
  position: fixed; bottom: 40px; right: 12px;
  background: #ffffcc; border: 1px solid #000;
  padding: 8px 12px; font-size: 11px;
  max-width: 250px; z-index: 10001;
  box-shadow: 2px 2px 0 rgba(0,0,0,0.3);
  display: none;
}
.notification.show { display: block; }
.notification__title { font-weight: 700; margin-bottom: 4px; }
.notification__close {
  position: absolute; top: 2px; right: 4px;
  cursor: pointer; font-size: 12px; font-weight: 700;
}

/* === CONTENT STYLES (inside windows) === */
.win-content h2 {
  font-size: 14px; font-weight: 700; margin: 0 0 8px;
  padding-bottom: 4px; border-bottom: 1px solid #ccc;
}
.win-content h3 { font-size: 12px; font-weight: 700; margin: 8px 0 2px; }
.win-content p { margin: 4px 0; line-height: 1.5; }
.win-content a { color: var(--link); text-decoration: underline; }
.win-content img { image-rendering: auto; }
.win-content hr {
  border: none; height: 0; margin: 8px 0;
  border-top: 1px solid var(--btn-shadow);
  border-bottom: 1px solid var(--btn-highlight);
}
.win-content ul { margin: 4px 0 4px 18px; }
.win-content li { margin: 2px 0; }
.win-content .highlight { background: #ffff00; padding: 0 2px; }
.win-content .stat-row {
  display: flex; gap: 16px; margin: 8px 0;
}
.win-content .stat { text-align: center; }
.win-content .stat-num { font-size: 20px; font-weight: 700; color: #000080; font-family: var(--font-pixel); }
.win-content .stat-label { font-size: 10px; color: #666; }
.win-content .tag-list { display: flex; flex-wrap: wrap; gap: 4px; margin: 4px 0; }
.win-content .tag {
  background: var(--btn-face); padding: 1px 6px;
  border: 1px outset var(--btn-face); font-size: 10px;
}

/* Photo */
.win-photo { width: 100px; float: left; margin: 0 10px 6px 0; border: 1px solid #808080; }

/* Win98 scrollbar */
.window__body::-webkit-scrollbar { width: 16px; }
.window__body::-webkit-scrollbar-track {
  background: #c0c0c0;
  border-left: 1px solid #808080;
}
.window__body::-webkit-scrollbar-thumb {
  background: var(--btn-face);
  border-top: 2px solid var(--btn-highlight);
  border-left: 2px solid var(--btn-highlight);
  border-right: 2px solid var(--btn-dark);
  border-bottom: 2px solid var(--btn-dark);
}
.window__body::-webkit-scrollbar-button { display: block; height: 16px; background: var(--btn-face); }

/* === PHOTO GALLERY === */
.photo-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
  gap: 6px;
}
.photo-thumb {
  width: 100%; aspect-ratio: 1;
  overflow: hidden; cursor: pointer;
  border-top: 2px solid var(--btn-shadow);
  border-left: 2px solid var(--btn-shadow);
  border-right: 2px solid var(--btn-highlight);
  border-bottom: 2px solid var(--btn-highlight);
  background: #000;
  position: relative;
  transition: transform 0.15s;
}
.photo-thumb:hover {
  transform: scale(1.05);
  z-index: 2;
  box-shadow: 0 0 0 2px #000080;
}
.photo-thumb:active { transform: scale(0.97); }
.photo-thumb img {
  width: 100%; height: 100%;
  object-fit: cover;
  display: block;
  image-rendering: auto;
}

/* PDF thumbnails */
.photo-thumb--pdf {
  background: var(--btn-face);
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  gap: 4px;
}
.photo-thumb--pdf img {
  width: 32px; height: 32px;
  object-fit: contain;
  image-rendering: pixelated;
}
.pdf-label {
  font-size: 9px; color: var(--text);
  text-align: center; line-height: 1.1;
  word-break: break-all;
  padding: 0 2px;
}

/* === LIGHTBOX === */
.lightbox-overlay {
  position: fixed; inset: 0;
  background: rgba(0, 0, 0, 0.85);
  z-index: 20000;
  display: none;
  flex-direction: column;
}
.lightbox-overlay.open { display: flex; }

.lightbox-titlebar {
  background: var(--win-title);
  padding: 2px 3px; display: flex; align-items: center;
  gap: 4px; height: 22px;
  border-bottom: 2px solid var(--btn-dark);
}
.lightbox-titlebar .window__title-text {
  flex: 1; color: #fff; font-size: 11px; font-weight: 700;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

.lightbox-content {
  flex: 1; display: flex;
  align-items: center; justify-content: center;
  position: relative; overflow: hidden;
  padding: 12px;
}
.lightbox-content img {
  max-width: calc(100% - 80px);
  max-height: calc(100vh - 80px);
  object-fit: contain;
  border: 3px solid var(--btn-face);
  box-shadow: 2px 2px 8px rgba(0,0,0,0.5);
  background: #000;
}

.lightbox-nav {
  position: absolute; top: 50%; transform: translateY(-50%);
  width: 36px; height: 36px;
  background: var(--btn-face); cursor: pointer;
  font-size: 14px; font-weight: 700;
  border-top: 2px solid var(--btn-highlight);
  border-left: 2px solid var(--btn-highlight);
  border-right: 2px solid var(--btn-dark);
  border-bottom: 2px solid var(--btn-dark);
  color: var(--text);
  display: flex; align-items: center; justify-content: center;
  z-index: 2;
}
.lightbox-nav:active {
  border-top: 2px solid var(--btn-dark);
  border-left: 2px solid var(--btn-dark);
  border-right: 2px solid var(--btn-highlight);
  border-bottom: 2px solid var(--btn-highlight);
}
.lightbox-prev { left: 12px; }
.lightbox-next { right: 12px; }

.lightbox-statusbar {
  background: var(--btn-face);
  padding: 2px 8px; font-size: 10px;
  border-top: 1px solid var(--btn-shadow);
  text-align: center;
  height: 20px;
  display: flex; align-items: center; justify-content: center;
}

@media (max-width: 768px) {
  .window { width: calc(100vw - 8px) !important; left: 2px !important; }
  .desktop-icons { flex-direction: row; flex-wrap: wrap; }
  .photo-grid { grid-template-columns: repeat(auto-fill, minmax(80px, 1fr)); }
  .lightbox-content img { max-width: calc(100% - 50px); }
  .lightbox-nav { width: 28px; height: 28px; font-size: 12px; }
  .lightbox-prev { left: 4px; }
  .lightbox-next { right: 4px; }
}
