/* ==========================================================================
   HYUN2CLOUD KIOSK — WINDOWS XP OPEN SOURCE DESKTOP & FOLDER EXPLORER
   ========================================================================== */

:root {
  --kiosk-bg: #ffffff;
  --kiosk-ink: #000000;
  --kiosk-header-bg: #ffffff;
  color-scheme: light;
}

* {
  box-sizing: border-box;
}

html, body {
  margin: 0;
  padding: 0;
  min-height: 100vh;
  background-color: var(--kiosk-bg);
  color: var(--kiosk-ink);
  font-family: Arial, "Apple SD Gothic Neo", "Noto Sans KR", sans-serif;
  font-size: 1rem;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Page Outer Wrapper */
.kiosk-page-body {
  margin: 0;
  padding: 0;
  min-height: 100vh;
  background-color: var(--kiosk-bg);
}

/* Site Navigation (Top) — Exact shared site design */
.kiosk-header {
  display: flex;
  flex: none;
  align-items: center;
  min-height: 0;
  padding: 20px;
  background: var(--kiosk-header-bg);
}

.kiosk-nav {
  display: flex;
  align-items: center;
  gap: 28px;
  font-size: 20px;
  line-height: 25px;
}

.kiosk-nav a {
  color: var(--kiosk-ink);
  text-decoration: none;
}

.kiosk-nav a[aria-current="page"] {
  text-decoration-line: underline;
  text-decoration-style: solid;
  text-decoration-thickness: 1.5px;
  text-underline-offset: 5px;
}

.visually-hidden {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

/* Desktop Canvas Stage */
.kiosk-desktop-stage {
  position: relative;
  width: 100%;
  min-height: calc(100vh - 70px);
  min-height: calc(100dvh - 70px);
  padding: 20px;
  background-color: var(--kiosk-bg);
  overflow: hidden;
  user-select: none;
}

/* Windows XP Desktop Icons (Draggable & Selectable) */
.xp-desktop-icon {
  position: absolute;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 90px;
  padding: 4px 2px;
  cursor: default;
  text-align: center;
  border: none;
  background: transparent;
  user-select: none;
  touch-action: none;
  z-index: 10;
  outline: none;
  transition: transform 120ms ease;
}

#icon-glow-jam {
  left: calc(50% - 150px);
  top: calc(50% - 40px);
}

#icon-bookbookbook {
  left: calc(50% - 40px);
  top: calc(50% - 40px);
}

#icon-diy-nas {
  left: calc(50% + 70px);
  top: calc(50% - 40px);
}

/* No transparent box around icon! */
.xp-desktop-icon:hover,
.xp-desktop-icon:focus-visible,
.xp-desktop-icon.is-selected {
  background: transparent;
  border: none;
  box-shadow: none;
}

.xp-icon-img-wrap {
  position: relative;
  width: 52px;
  height: 46px;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  overflow: visible;
}

.xp-icon-img {
  display: block;
  max-width: 46px;
  max-height: 42px;
  width: auto;
  height: auto;
  object-fit: contain;
  image-rendering: pixelated;
  image-rendering: -webkit-optimize-contrast;
  transition: transform 120ms ease;
  pointer-events: none;
}

.xp-icon-label {
  display: inline-block;
  font-family: Tahoma, "Apple SD Gothic Neo", "Segoe UI", sans-serif;
  font-size: 12px;
  line-height: 1.25;
  color: var(--kiosk-ink);
  margin-top: 4px;
  padding: 1px 4px;
  border-radius: 0;
  white-space: nowrap;
  user-select: none;
  pointer-events: none;
}

/* Pure Blue Selection on Label Only (No border/glow on icon graphic!) */
.xp-desktop-icon.is-selected .xp-icon-label {
  background-color: #0b61ff;
  color: #ffffff;
  outline: 1px dotted #ffffff;
  outline-offset: -1px;
}

.xp-desktop-icon.is-selected .xp-icon-img {
  filter: none;
}

/* Windows Container Layer */
.xp-windows-container {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

/* Windows XP Classic Window Frame */
@keyframes xp-window-zoom {
  0% {
    transform: scale(0.92);
  }
  100% {
    transform: scale(1);
  }
}

.xp-window {
  position: absolute;
  width: 520px;
  min-width: 320px;
  min-height: 220px;
  max-width: calc(100vw - 24px);
  max-height: calc(100vh - 70px);
  resize: both;
  background: #ffffff;
  border-top-left-radius: 8px;
  border-top-right-radius: 8px;
  border-bottom-left-radius: 0;
  border-bottom-right-radius: 0;
  border: 3px solid #0055ea;
  border-bottom: 3px solid #0044bc;
  box-shadow: 2px 6px 24px rgba(0, 0, 0, 0.35);
  pointer-events: auto;
  display: flex;
  flex-direction: column;
  z-index: 100;
  user-select: none;
  font-family: Tahoma, Arial, "Apple SD Gothic Neo", "Segoe UI", sans-serif;
  animation: xp-window-zoom 150ms cubic-bezier(0.12, 0.9, 0.32, 1) both;
  transform-origin: center center;
  overflow: hidden;
}

.xp-window.is-active {
  z-index: 200;
}

.xp-window:not(.is-active) {
  border-color: #7697c7;
  border-bottom-color: #5a719c;
}

/* XP Blue Gradient Title Bar (Active) */
.xp-title-bar {
  height: 30px;
  background: linear-gradient(
    to bottom,
    #0058ee 0%,
    #3593ff 4%,
    #288eff 6%,
    #1279fd 8%,
    #0b68e3 14%,
    #0860dc 16%,
    #0348c8 42%,
    #0240be 44%,
    #0034b5 86%,
    #002eab 100%
  );
  border-top-left-radius: 5px;
  border-top-right-radius: 5px;
  padding: 0 6px 0 8px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: move;
}

/* XP Inactive Title Bar */
.xp-window:not(.is-active) .xp-title-bar {
  background: linear-gradient(
    to bottom,
    #7697c7 0%,
    #8ea7ce 6%,
    #799ad0 14%,
    #6c88b7 42%,
    #627ba8 86%,
    #5a719c 100%
  );
}

.xp-title-text {
  display: flex;
  align-items: center;
  gap: 6px;
  color: #ffffff;
  font-size: 12px;
  font-weight: bold;
  letter-spacing: -0.01em;
  text-shadow: 1px 1px 1px #001e66;
}

.xp-window:not(.is-active) .xp-title-text {
  color: #dce6f5;
  text-shadow: none;
}

.xp-title-icon {
  width: 16px;
  height: 16px;
  display: block;
}

.xp-title-controls {
  display: flex;
  align-items: center;
  gap: 2px;
  margin-right: 2px;
}

.xp-win-btn {
  width: 21px;
  height: 21px;
  border-radius: 3px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  border: 1px solid rgba(255, 255, 255, 0.7);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.35), 0 1px 2px rgba(0, 0, 0, 0.25);
  background: linear-gradient(180deg, #448cfc 0%, #2062e4 45%, #0540c4 55%, #185bd8 100%);
  color: #ffffff;
  padding: 0;
  outline: none;
  transition: filter 100ms ease;
}

.xp-win-btn svg {
  display: block;
  pointer-events: none;
  filter: drop-shadow(0 1px 1px rgba(0, 0, 0, 0.3));
}

.xp-win-btn:hover {
  background: linear-gradient(180deg, #6ba5ff 0%, #3e79ed 45%, #1757db 55%, #2a6fe0 100%);
}

.xp-win-btn:active {
  background: linear-gradient(180deg, #1d4ed8 0%, #1e40af 50%, #172554 100%);
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.4);
}

.xp-win-btn.btn-close {
  background: linear-gradient(180deg, #ea7966 0%, #dc4229 45%, #be2711 55%, #d43b23 100%);
  border-color: rgba(255, 255, 255, 0.75);
}

.xp-win-btn.btn-close:hover {
  background: linear-gradient(180deg, #f79685 0%, #eb553c 45%, #ce321a 55%, #e24e36 100%);
}

.xp-win-btn.btn-close:active {
  background: linear-gradient(180deg, #dc2626 0%, #b91c1c 50%, #7f1d1d 100%);
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.5);
}

.xp-window:not(.is-active) .xp-win-btn {
  opacity: 0.85;
}

/* Address Bar (Sleek XP style with folder icon matching Image 4) */
.xp-address-bar {
  background: #ece9d8;
  border-bottom: 1px solid #d0ccb8;
  padding: 4px 8px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.xp-address-label {
  font-family: Tahoma, Arial, sans-serif;
  font-size: 11px;
  color: #444444;
  user-select: none;
}

.xp-address-box {
  display: flex;
  align-items: center;
  background: #ffffff;
  border: 1px solid #7f9db9;
  box-shadow: inset 1px 1px 1px rgba(0, 0, 0, 0.12);
  padding: 2px 6px;
  flex: 1;
  gap: 6px;
}

.xp-address-icon {
  width: 14px;
  height: 14px;
  object-fit: contain;
  pointer-events: none;
}

.xp-address-input {
  background: transparent;
  border: none;
  font-family: Tahoma, Arial, sans-serif;
  font-size: 11px;
  color: #000000;
  flex: 1;
  outline: none;
  padding: 0;
}

/* Folder Content Canvas */
.xp-folder-body {
  background: #ffffff;
  min-height: 220px;
  padding: 24px;
  display: flex;
  flex-wrap: wrap;
  gap: 24px;
  align-content: flex-start;
  overflow-y: auto;
}

/* File item inside folder */
.xp-file-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100px;
  padding: 6px 4px;
  cursor: default;
  text-align: center;
  border: none;
  background: transparent;
  text-decoration: none;
  color: inherit;
  outline: none;
  user-select: none;
}

.xp-file-item:hover,
.xp-file-item:focus-visible,
.xp-file-item.is-selected {
  background: transparent;
  border: none;
  box-shadow: none;
}

.xp-file-icon-wrap {
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  overflow: visible;
}

.xp-file-icon {
  max-width: 42px;
  max-height: 42px;
  width: auto;
  height: auto;
  object-fit: contain;
  image-rendering: pixelated;
  image-rendering: -webkit-optimize-contrast;
  pointer-events: none;
}

.xp-file-name {
  font-family: Tahoma, Arial, sans-serif;
  font-size: 11.5px;
  line-height: 1.25;
  margin-top: 4px;
  padding: 1px 4px;
  border-radius: 0;
  white-space: nowrap;
  color: #000000;
  user-select: none;
  pointer-events: none;
}

/* Pure Blue Selection on Label Only (No border/glow on icon graphic!) */
.xp-file-item.is-selected .xp-file-name {
  background-color: #0b61ff;
  color: #ffffff;
  outline: 1px dotted #ffffff;
  outline-offset: -1px;
}

.xp-file-item.is-selected .xp-file-icon {
  filter: none;
}

/* Maximized Window State */
.xp-window.is-maximized {
  left: 8px !important;
  top: 60px !important;
  width: calc(100vw - 16px) !important;
  height: calc(100vh - 76px) !important;
  max-width: none !important;
  max-height: none !important;
  resize: none !important;
}

.xp-window.is-maximized .xp-folder-body,
.xp-window.is-maximized .xp-notepad-body {
  flex: 1;
  max-height: none;
}

/* Authentic Windows Notepad Styling (Matching Images 2 & 3: line-by-line document, menu, flat status bar) */
.xp-notepad-window {
  width: 520px;
  height: 480px;
  min-width: 340px;
  min-height: 240px;
  max-width: calc(100vw - 24px);
}

.xp-notepad-menu {
  background: #fbfbfb;
  border-bottom: 1px solid #ececec;
  height: 26px;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 0 10px;
  font-family: Tahoma, "Apple SD Gothic Neo", "Segoe UI", sans-serif;
  font-size: 11.5px;
  color: #333333;
  user-select: none;
}

.xp-notepad-menu .xp-menu-item {
  padding: 2px 5px;
  cursor: default;
  border-radius: 2px;
  transition: background 100ms ease;
}

.xp-notepad-menu .xp-menu-item:hover {
  background: #e5f1fb;
}

.xp-notepad-body {
  background: #ffffff;
  padding: 22px 26px;
  min-height: 180px;
  overflow-y: auto;
  user-select: text;
  flex: 1;
}

.xp-notepad-text {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Tahoma, "Apple SD Gothic Neo", sans-serif;
  color: #1a1a1a;
  word-break: break-word;
}

/* Markdown README Typographic Hierarchy */
.xp-md-h1 {
  font-size: 20px;
  font-weight: 700;
  line-height: 1.3;
  color: #111111;
  margin: 0 0 14px 0;
  letter-spacing: -0.02em;
}

.xp-md-h2 {
  font-size: 14.5px;
  font-weight: 700;
  line-height: 1.35;
  color: #222222;
  margin: 20px 0 8px 0;
  letter-spacing: -0.01em;
}

.xp-md-h3 {
  font-size: 13.5px;
  font-weight: 600;
  line-height: 1.35;
  color: #333333;
  margin: 16px 0 6px 0;
}

.xp-md-p {
  font-size: 13px;
  line-height: 1.65;
  color: #2c2c2c;
  margin: 0 0 10px 0;
}

.xp-md-ul {
  margin: 0 0 14px 0;
  padding-left: 18px;
  list-style-type: disc;
}

.xp-md-li {
  font-size: 13px;
  line-height: 1.6;
  color: #333333;
  margin-bottom: 4px;
}

.xp-notepad-link {
  color: #0b61ff;
  text-decoration: underline;
  text-underline-offset: 3px;
  cursor: pointer;
  word-break: break-all;
}

.xp-notepad-link:hover {
  color: #003db3;
}

/* Markdown README Embedded Images */
.xp-md-img-wrap {
  margin: 16px 0 18px 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  background: transparent;
  border: none;
  border-radius: 0;
  box-shadow: none;
  overflow: visible;
}

.xp-md-img {
  display: block;
  width: auto;
  max-width: 100%;
  height: auto;
  max-height: 320px;
  object-fit: contain;
  background: transparent;
  border: none;
}

.xp-md-img-caption {
  font-family: Tahoma, "Apple SD Gothic Neo", -apple-system, sans-serif;
  font-size: 11.5px;
  color: #777777;
  padding: 8px 0 0 0;
  text-align: center;
  background: transparent;
  width: 100%;
  border: none;
  box-sizing: border-box;
}

.xp-notepad-status {
  background: #f3f3f3;
  border-top: 1px solid #e0e0e0;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  padding: 0 14px;
  gap: 18px;
  font-family: Tahoma, "Apple SD Gothic Neo", "Segoe UI", sans-serif;
  font-size: 11px;
  color: #555555;
  user-select: none;
}

.xp-notepad-status .xp-status-item {
  display: inline-block;
  white-space: nowrap;
}

.xp-notepad-status .xp-status-pos {
  margin-right: auto;
}

/* Responsive adjustments */
@media only screen and (max-width: 768px) {
  .kiosk-header {
    padding: 15px;
  }

  .kiosk-nav {
    gap: 20px;
    min-width: 0;
    overflow-x: auto;
    scrollbar-width: none;
    font-size: 16px;
    line-height: 22px;
  }

  .kiosk-nav::-webkit-scrollbar {
    display: none;
  }

  #icon-glow-jam {
    left: calc(50% - 135px);
    top: 38%;
  }

  #icon-bookbookbook {
    left: calc(50% - 40px);
    top: 38%;
  }

  #icon-diy-nas {
    left: calc(50% + 55px);
    top: 38%;
  }

  .xp-window {
    width: calc(100vw - 20px);
    left: 10px !important;
    top: 60px !important;
  }

  .xp-folder-body {
    padding: 16px;
    gap: 16px;
  }
}

@media (max-width: 380px) {
  .kiosk-nav {
    gap: 12px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .xp-window {
    animation: none !important;
  }
  .xp-desktop-icon {
    transition: none !important;
  }
}
