/* ========================================
   Windows 98 Theme
   ======================================== */

[data-theme="win98"] .site-normal { display: none; }
[data-theme="win98"] .theme-switcher { display: none; }

.site-win98 {
  display: none;
  width: 100%;
  height: 100vh;
  overflow: hidden;
  font-family: 'Tahoma', 'Microsoft Sans Serif', 'Arial', sans-serif;
  font-size: 11px;
  -webkit-font-smoothing: none;
  -moz-osx-font-smoothing: unset;
}

/* ---------- Boot Screen ---------- */
.win98-boot {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 99999;
  background: #000;
  align-items: center;
  justify-content: center;
  flex-direction: column;
}

.win98-boot-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 24px;
}

.win98-boot-flag {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px;
  width: 60px;
  height: 60px;
}

.win98-flag-block {
  border-radius: 2px;
}
.win98-flag-block.r { background: #ff0000; }
.win98-flag-block.g { background: #00a800; }
.win98-flag-block.b { background: #0000ff; }
.win98-flag-block.y { background: #ffff00; }

.win98-boot-text {
  color: #c0c0c0;
  font-family: 'Times New Roman', serif;
  font-size: 18px;
  text-align: center;
  letter-spacing: 2px;
}
.win98-boot-text span {
  display: block;
  font-size: 28px;
  font-weight: bold;
  color: #fff;
  letter-spacing: 1px;
}

.win98-boot-bar {
  width: 200px;
  height: 18px;
  background: #000;
  border: 2px solid;
  border-color: #808080 #fff #fff #808080;
  padding: 2px;
  box-sizing: border-box;
}
.win98-boot-bar-fill {
  height: 100%;
  width: 0%;
  background: repeating-linear-gradient(
    90deg,
    #000080 0px, #000080 8px,
    transparent 8px, transparent 10px
  );
  animation: win98-boot-fill 1.6s ease-out forwards;
}

@keyframes win98-boot-fill {
  0% { width: 0%; }
  100% { width: 100%; }
}

.win98-boot.done {
  animation: win98-boot-fade 0.5s ease forwards;
}
@keyframes win98-boot-fade {
  0% { opacity: 1; }
  100% { opacity: 0; }
}

/* ---------- Shutdown Screen ---------- */
.win98-shutdown {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 99999;
  background: #000;
  align-items: center;
  justify-content: center;
  flex-direction: column;
}
.win98-shutdown-text {
  color: #ff8c00;
  font-family: 'Times New Roman', serif;
  font-size: 22px;
  text-align: center;
  line-height: 1.6;
}
.win98-shutdown.off {
  animation: win98-boot-fade 0.6s ease forwards;
}

/* ---------- Desktop ---------- */
.win98-desktop {
  position: relative;
  width: 100%;
  height: calc(100vh - 36px);
  background: #008080;
  overflow: hidden;
  user-select: none;
}

/* ---------- Desktop Icons ---------- */
.win98-desktop-icons {
  position: absolute;
  top: 12px;
  left: 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  z-index: 1;
}

.win98-desktop-icon {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 72px;
  padding: 4px 2px;
  cursor: pointer;
  border: 1px solid transparent;
  border-radius: 0;
  text-align: center;
}

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

.win98-desktop-icon:focus,
.win98-desktop-icon.selected {
  background: #000080;
}
.win98-desktop-icon:focus span,
.win98-desktop-icon.selected span {
  color: #fff;
  background: #000080;
}

.win98-icon-graphic {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 26px;
  color: #fff;
  filter: drop-shadow(1px 1px 0 rgba(0,0,0,0.5));
  margin-bottom: 2px;
  image-rendering: pixelated;
}

.win98-desktop-icon span {
  font-size: 11px;
  color: #fff;
  text-shadow: 1px 1px 2px rgba(0,0,0,0.7);
  padding: 1px 3px;
  word-break: break-word;
  line-height: 1.2;
}

/* ---------- Windows ---------- */
.win98-window {
  display: none;
  position: absolute;
  flex-direction: column;
  background: #c0c0c0;
  box-shadow:
    inset -1px -1px 0 0 #0a0a0a,
    inset 1px 1px 0 0 #dfdfdf,
    inset -2px -2px 0 0 #808080,
    inset 2px 2px 0 0 #fff;
  min-width: 260px;
  min-height: 120px;
  z-index: 10;
  font-family: 'Tahoma', 'Microsoft Sans Serif', 'Arial', sans-serif;
  font-size: 11px;
}

.win98-window-active {
  z-index: 100;
}

/* ---------- Title Bar ---------- */
.win98-titlebar {
  display: flex;
  align-items: center;
  height: 22px;
  padding: 2px 3px;
  background: linear-gradient(90deg, #808080, #b0b0b0);
  cursor: default;
  flex-shrink: 0;
  gap: 3px;
  user-select: none;
}

.win98-window-active .win98-titlebar {
  background: linear-gradient(90deg, #000080, #1084d0);
}

.win98-titlebar-icon {
  width: 16px;
  height: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  color: #c0c0c0;
  flex-shrink: 0;
}
.win98-window-active .win98-titlebar-icon { color: #fff; }

.win98-titlebar-text {
  flex: 1;
  color: #c0c0c0;
  font-weight: bold;
  font-size: 11px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  padding-left: 2px;
}
.win98-window-active .win98-titlebar-text { color: #fff; }

.win98-titlebar-controls {
  display: flex;
  gap: 2px;
  flex-shrink: 0;
}

.win98-titlebar-btn {
  width: 16px;
  height: 14px;
  background: #c0c0c0;
  border: none;
  box-shadow:
    inset -1px -1px 0 0 #0a0a0a,
    inset 1px 1px 0 0 #fff,
    inset -2px -2px 0 0 #808080,
    inset 2px 2px 0 0 #dfdfdf;
  cursor: pointer;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  font-size: 0;
}
.win98-titlebar-btn:active {
  box-shadow:
    inset -1px -1px 0 0 #fff,
    inset 1px 1px 0 0 #0a0a0a,
    inset -2px -2px 0 0 #dfdfdf,
    inset 2px 2px 0 0 #808080;
}

.win98-btn-min::after {
  content: '';
  display: block;
  width: 6px;
  height: 2px;
  background: #000;
  margin-top: 6px;
}

.win98-btn-max::after {
  content: '';
  display: block;
  width: 9px;
  height: 8px;
  border: 1px solid #000;
  border-top: 2px solid #000;
  box-sizing: border-box;
}

.win98-btn-close::after {
  content: '\00d7';
  font-size: 14px;
  font-weight: bold;
  line-height: 1;
  color: #000;
}

/* ---------- Menu Bar ---------- */
.win98-menubar {
  display: flex;
  gap: 0;
  padding: 1px 2px;
  background: #c0c0c0;
  border-bottom: 1px solid #808080;
  flex-shrink: 0;
}
.win98-menubar span,
.win98-menubar a {
  padding: 2px 8px;
  cursor: pointer;
  font-size: 11px;
  color: #000;
  text-decoration: none;
}
.win98-menubar span:hover,
.win98-menubar a:hover {
  background: #000080;
  color: #fff;
}

/* ---------- Toolbar ---------- */
.win98-toolbar {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 2px 4px;
  background: #c0c0c0;
  border-bottom: 1px solid #808080;
  flex-shrink: 0;
  font-size: 11px;
}
.win98-toolbar span {
  padding: 2px 4px;
  cursor: pointer;
}
.win98-toolbar span:hover {
  box-shadow:
    inset -1px -1px 0 0 #808080,
    inset 1px 1px 0 0 #fff;
}
.win98-toolbar-separator {
  width: 2px;
  height: 20px;
  border-left: 1px solid #808080;
  border-right: 1px solid #fff;
  padding: 0 !important;
  cursor: default !important;
}
.win98-toolbar-separator:hover {
  box-shadow: none !important;
}
.win98-address-bar {
  flex: 1;
  background: #fff;
  border: none;
  box-shadow:
    inset -1px -1px 0 0 #fff,
    inset 1px 1px 0 0 #808080,
    inset -2px -2px 0 0 #dfdfdf,
    inset 2px 2px 0 0 #0a0a0a;
  padding: 2px 4px;
  font-size: 11px;
  font-family: inherit;
  cursor: default !important;
}
.win98-address-bar:hover {
  box-shadow:
    inset -1px -1px 0 0 #fff,
    inset 1px 1px 0 0 #808080,
    inset -2px -2px 0 0 #dfdfdf,
    inset 2px 2px 0 0 #0a0a0a !important;
}

/* ---------- Window Body ---------- */
.win98-window-body {
  flex: 1;
  overflow: auto;
  margin: 3px;
  padding: 8px;
  background: #c0c0c0;
  box-shadow:
    inset -1px -1px 0 0 #fff,
    inset 1px 1px 0 0 #808080,
    inset -2px -2px 0 0 #dfdfdf,
    inset 2px 2px 0 0 #0a0a0a;
}

.win98-window-body-white {
  background: #fff;
  color: #000;
}

.win98-window-body::-webkit-scrollbar { width: 16px; }
.win98-window-body::-webkit-scrollbar-track {
  background: #c0c0c0;
  border: 1px solid #808080;
}
.win98-window-body::-webkit-scrollbar-thumb {
  background: #c0c0c0;
  box-shadow:
    inset -1px -1px 0 0 #0a0a0a,
    inset 1px 1px 0 0 #fff,
    inset -2px -2px 0 0 #808080,
    inset 2px 2px 0 0 #dfdfdf;
}
.win98-window-body::-webkit-scrollbar-button {
  background: #c0c0c0;
  height: 16px;
  box-shadow:
    inset -1px -1px 0 0 #0a0a0a,
    inset 1px 1px 0 0 #fff,
    inset -2px -2px 0 0 #808080,
    inset 2px 2px 0 0 #dfdfdf;
}

/* ---------- Status Bar ---------- */
.win98-statusbar {
  display: flex;
  align-items: center;
  height: 20px;
  padding: 0 4px;
  background: #c0c0c0;
  flex-shrink: 0;
}
.win98-statusbar span {
  padding: 1px 6px;
  box-shadow:
    inset -1px -1px 0 0 #fff,
    inset 1px 1px 0 0 #808080;
  font-size: 11px;
  flex: 1;
}

/* ---------- Taskbar ---------- */
.win98-taskbar {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: 36px;
  background: #c0c0c0;
  box-shadow:
    inset 0 1px 0 0 #fff,
    inset 0 2px 0 0 #dfdfdf;
  display: flex;
  align-items: center;
  padding: 2px 4px;
  gap: 4px;
  z-index: 10000;
  font-family: 'Tahoma', 'Microsoft Sans Serif', 'Arial', sans-serif;
}

/* ---------- Start Button ---------- */
.win98-start-btn {
  height: 28px;
  padding: 2px 8px 2px 4px;
  background: #c0c0c0;
  border: none;
  box-shadow:
    inset -1px -1px 0 0 #0a0a0a,
    inset 1px 1px 0 0 #fff,
    inset -2px -2px 0 0 #808080,
    inset 2px 2px 0 0 #dfdfdf;
  font-family: 'Tahoma', 'Microsoft Sans Serif', 'Arial', sans-serif;
  font-size: 11px;
  font-weight: bold;
  display: flex;
  align-items: center;
  gap: 4px;
  cursor: pointer;
  flex-shrink: 0;
}
.win98-start-btn:active,
.win98-start-btn.active {
  box-shadow:
    inset -1px -1px 0 0 #fff,
    inset 1px 1px 0 0 #0a0a0a,
    inset -2px -2px 0 0 #dfdfdf,
    inset 2px 2px 0 0 #808080;
}

.win98-start-logo {
  display: inline-grid;
  grid-template-columns: 1fr 1fr;
  gap: 1px;
  width: 16px;
  height: 16px;
}
.win98-start-logo::before {
  content: '';
  display: block;
  grid-column: 1 / -1;
  grid-row: 1 / -1;
  width: 16px;
  height: 16px;
  background:
    linear-gradient(135deg, #ff0000 25%, transparent 25%) 0 0 / 8px 8px no-repeat,
    linear-gradient(225deg, #00a800 25%, transparent 25%) 8px 0 / 8px 8px no-repeat,
    linear-gradient(45deg, #0000ff 25%, transparent 25%) 0 8px / 8px 8px no-repeat,
    linear-gradient(315deg, #ffff00 25%, transparent 25%) 8px 8px / 8px 8px no-repeat;
  image-rendering: pixelated;
}

/* ---------- Taskbar Divider ---------- */
.win98-taskbar-divider {
  width: 2px;
  height: 24px;
  border-left: 1px solid #808080;
  border-right: 1px solid #fff;
  flex-shrink: 0;
}

/* ---------- Taskbar Window Buttons ---------- */
.win98-taskbar-windows {
  flex: 1;
  display: flex;
  gap: 2px;
  overflow: hidden;
  min-width: 0;
}

.win98-taskbar-win-btn {
  height: 24px;
  min-width: 120px;
  max-width: 180px;
  padding: 1px 6px;
  background: #c0c0c0;
  border: none;
  box-shadow:
    inset -1px -1px 0 0 #0a0a0a,
    inset 1px 1px 0 0 #fff,
    inset -2px -2px 0 0 #808080,
    inset 2px 2px 0 0 #dfdfdf;
  font-family: 'Tahoma', 'Microsoft Sans Serif', 'Arial', sans-serif;
  font-size: 11px;
  text-align: left;
  cursor: pointer;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  flex-shrink: 1;
}
.win98-taskbar-win-btn.active {
  box-shadow:
    inset -1px -1px 0 0 #fff,
    inset 1px 1px 0 0 #0a0a0a,
    inset -2px -2px 0 0 #dfdfdf,
    inset 2px 2px 0 0 #808080;
  font-weight: bold;
  background: #d4d0c8;
}

/* ---------- System Tray ---------- */
.win98-systray {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 2px 8px;
  height: 24px;
  box-shadow:
    inset -1px -1px 0 0 #fff,
    inset 1px 1px 0 0 #808080;
  flex-shrink: 0;
}

.win98-clock {
  font-size: 11px;
  color: #000;
  font-family: 'Tahoma', sans-serif;
}

/* ---------- Start Menu ---------- */
.win98-start-menu {
  display: none;
  position: fixed;
  bottom: 36px;
  left: 0;
  flex-direction: row;
  background: #c0c0c0;
  box-shadow:
    inset -1px -1px 0 0 #0a0a0a,
    inset 1px 1px 0 0 #fff,
    inset -2px -2px 0 0 #808080,
    inset 2px 2px 0 0 #dfdfdf;
  z-index: 10001;
  min-width: 200px;
  font-family: 'Tahoma', 'Microsoft Sans Serif', 'Arial', sans-serif;
}

.win98-start-menu-sidebar {
  width: 24px;
  background: linear-gradient(0deg, #000080, #1084d0);
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding: 8px 2px;
  flex-shrink: 0;
}
.win98-start-menu-sidebar span {
  writing-mode: vertical-rl;
  transform: rotate(180deg);
  color: #c0c0c0;
  font-size: 18px;
  letter-spacing: 2px;
  font-family: 'Times New Roman', serif;
}
.win98-start-menu-sidebar span b {
  color: #fff;
  font-weight: bold;
}

.win98-start-menu-items {
  display: flex;
  flex-direction: column;
  padding: 2px 0;
  flex: 1;
}

.win98-start-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 24px 6px 8px;
  cursor: pointer;
  font-size: 11px;
  color: #000;
  white-space: nowrap;
}
.win98-start-item:hover {
  background: #000080;
  color: #fff;
}
.win98-start-item i {
  width: 20px;
  text-align: center;
  font-size: 14px;
}

.win98-start-separator {
  height: 2px;
  margin: 2px 4px;
  border-top: 1px solid #808080;
  border-bottom: 1px solid #fff;
}

.win98-start-shutdown {
  color: #000;
}

/* ---------- About Window Content ---------- */
.win98-about-content {
  display: flex;
  gap: 16px;
  align-items: flex-start;
}
.win98-about-avatar {
  width: 64px;
  height: 64px;
  border-radius: 0;
  box-shadow:
    inset -1px -1px 0 0 #fff,
    inset 1px 1px 0 0 #808080;
  flex-shrink: 0;
}
.win98-about-info h2 {
  margin: 0 0 4px 0;
  font-size: 14px;
  font-weight: bold;
  color: #000;
}
.win98-about-info p {
  margin: 0 0 8px 0;
  font-size: 11px;
  color: #000;
  line-height: 1.5;
}

.win98-hr {
  border: none;
  height: 2px;
  border-top: 1px solid #808080;
  border-bottom: 1px solid #fff;
  margin: 8px 0;
}

.win98-props-table {
  font-size: 11px;
  color: #000;
  border-collapse: collapse;
}
.win98-props-table td {
  padding: 2px 8px 2px 0;
  vertical-align: top;
}
.win98-props-table td:first-child {
  font-weight: bold;
  white-space: nowrap;
  color: #404040;
}
.win98-props-table a {
  color: #000080;
  text-decoration: underline;
}
.win98-props-table a:hover {
  color: #ff0000;
}

/* ---------- Blog Window Content ---------- */
.win98-blog-posts {
  font-size: 11px;
  color: #000;
  line-height: 1.6;
}
.win98-blog-posts a {
  color: #000080;
  text-decoration: underline;
  font-weight: bold;
}
.win98-blog-posts a:hover {
  color: #ff0000;
}
.win98-blog-post {
  margin-bottom: 12px;
  padding-bottom: 12px;
  border-bottom: 1px solid #c0c0c0;
}
.win98-blog-post:last-child {
  border-bottom: none;
  margin-bottom: 0;
  padding-bottom: 0;
}
.win98-blog-meta {
  color: #808080;
  font-size: 10px;
  margin-top: 2px;
}
.win98-blog-tag {
  background: #000080;
  color: #fff;
  padding: 0 4px;
  font-size: 10px;
  margin-left: 4px;
}

/* ---------- Projects Explorer Table ---------- */
.win98-explorer-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 11px;
  color: #000;
}
.win98-explorer-table thead {
  position: sticky;
  top: 0;
}
.win98-explorer-table th {
  text-align: left;
  padding: 2px 8px;
  background: #c0c0c0;
  box-shadow:
    inset -1px -1px 0 0 #0a0a0a,
    inset 1px 1px 0 0 #fff,
    inset -2px -2px 0 0 #808080,
    inset 2px 2px 0 0 #dfdfdf;
  font-weight: bold;
  white-space: nowrap;
  font-size: 11px;
  cursor: default;
}
.win98-explorer-table td {
  padding: 2px 8px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 200px;
  border-bottom: 1px solid #f0f0f0;
}
.win98-explorer-table td:nth-child(3) {
  white-space: normal;
  max-width: 250px;
}
.win98-explorer-row {
  cursor: pointer;
}
.win98-explorer-row:hover {
  background: #000080;
  color: #fff;
}
.win98-explorer-row:hover i {
  color: #fff !important;
}

/* ---------- Resume Window Content ---------- */
.win98-resume-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 24px 16px;
  text-align: center;
}
.win98-resume-icon {
  font-size: 48px;
  color: #c00000;
}
.win98-resume-content h3 {
  margin: 0;
  font-size: 14px;
  font-weight: bold;
  color: #000;
}
.win98-resume-content p {
  margin: 0;
  font-size: 11px;
  color: #808080;
}

/* ---------- Buttons ---------- */
.win98-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  height: 23px;
  min-width: 75px;
  padding: 1px 12px;
  background: #c0c0c0;
  border: none;
  box-shadow:
    inset -1px -1px 0 0 #0a0a0a,
    inset 1px 1px 0 0 #fff,
    inset -2px -2px 0 0 #808080,
    inset 2px 2px 0 0 #dfdfdf;
  font-family: 'Tahoma', 'Microsoft Sans Serif', 'Arial', sans-serif;
  font-size: 11px;
  color: #000;
  text-decoration: none;
  cursor: pointer;
  white-space: nowrap;
}
.win98-button:active {
  box-shadow:
    inset -1px -1px 0 0 #fff,
    inset 1px 1px 0 0 #0a0a0a,
    inset -2px -2px 0 0 #dfdfdf,
    inset 2px 2px 0 0 #808080;
}
.win98-btn-action {
  margin: 4px;
}

/* ---------- Links Window ---------- */
.win98-links-list {
  font-size: 12px;
  line-height: 1.4;
}
.win98-links-list h3 {
  color: #000;
}
.win98-link-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 8px;
  color: #000080;
  text-decoration: underline;
  font-size: 12px;
  cursor: pointer;
  border-bottom: 1px solid #e0e0e0;
}
.win98-link-item:hover {
  background: #000080;
  color: #fff;
  text-decoration: none;
}
.win98-link-item i {
  width: 18px;
  text-align: center;
  font-size: 14px;
}

/* ---------- Responsive ---------- */
@media (max-width: 768px) {
  .win98-desktop-icons {
    flex-direction: row;
    flex-wrap: wrap;
    top: 8px;
    left: 8px;
    right: 8px;
    gap: 4px;
  }
  .win98-desktop-icon {
    width: 56px;
  }
  .win98-icon-graphic {
    font-size: 20px;
    width: 28px;
    height: 28px;
  }
  .win98-desktop-icon span { font-size: 9px; }

  .win98-window {
    min-width: unset;
  }

  .win98-taskbar-win-btn {
    min-width: 40px;
    max-width: 100px;
    font-size: 10px;
  }

  .win98-start-menu {
    width: calc(100vw - 8px);
    max-width: 280px;
  }

  .win98-about-content {
    flex-direction: column;
    align-items: center;
    text-align: center;
  }

  .win98-toolbar { display: none; }

  .win98-explorer-table td:nth-child(3),
  .win98-explorer-table th:nth-child(3),
  .win98-explorer-table td:nth-child(4),
  .win98-explorer-table th:nth-child(4) {
    display: none;
  }
}
