/* =====================================================================
   Windows 셸: Windows 11 규격. html[data-shell="windows"] 일 때 기본 CSS 위에 덮어쓴다.
   치수 기준:
     작업 표시줄 48px, 아이콘 가운데 정렬, 단추 40px(아이콘 24px), 실행 표시 알약 모양
     창 모서리 8px, 제목 표시줄 32px, 창 단추 46x32px, 닫기 hover #c42b1c
     시작 메뉴 가운데 560px, 모서리 8px · 알림 364px, 모서리 8px, 밝은 배경
     글꼴 Segoe UI Variable 12px · 강조색 #0067c0
   ===================================================================== */

html[data-shell="windows"] {
  --taskbar-h: 48px;
  --win-accent: #0067c0;
  --win-accent-hover: #005fb8;
  --ui-font: "Segoe UI Variable", "Segoe UI", "Malgun Gothic", "맑은 고딕", "Apple SD Gothic Neo", sans-serif;
}

/* ===== 바탕화면 (Windows 11 기본 벽지 느낌의 파란 띠) ===== */
html[data-shell="windows"] .desktop {
  background:
    radial-gradient(ellipse at 50% 60%, rgba(120, 190, 255, 0.35), transparent 55%),
    radial-gradient(ellipse at 30% 30%, rgba(255, 255, 255, 0.1), transparent 50%),
    linear-gradient(160deg, #0a3d7a 0%, #0f5fb5 45%, #1f8be0 75%, #4fb3f0 100%);
}

html[data-shell="windows"] .desktop-icon {
  border-radius: 4px;
}

/* ===== 작업 표시줄: 밝은 반투명, 가운데 정렬 ===== */
html[data-shell="windows"] .taskbar {
  justify-content: center;
  background: rgba(243, 243, 243, 0.88);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border-top: 1px solid rgba(0, 0, 0, 0.08);
  color: #1b1b1b;
}

html[data-shell="windows"] .tb-start {
  width: 40px;
  height: 40px;
  margin: 4px 2px;
  border-radius: 4px;
  color: #0078d4;
}

html[data-shell="windows"] .tb-start svg {
  width: 20px;
  height: 20px;
}

html[data-shell="windows"] .tb-start:hover,
html[data-shell="windows"] .tb-start.is-open {
  background: rgba(0, 0, 0, 0.06);
}

html[data-shell="windows"] .tb-pinned {
  align-items: center;
  gap: 4px;
}

html[data-shell="windows"] .tb-pin {
  width: 40px;
  height: 40px;
  border-radius: 4px;
  position: relative;
}

/* 고정 앱이 실행 중이면 아래 알약, 활성이면 넓은 강조색 알약, 창이 여럿이면 두 토막 */
html[data-shell="windows"] .tb-pin.is-running::after {
  content: "";
  position: absolute;
  bottom: 2px;
  left: 50%;
  width: 6px;
  height: 3px;
  margin-left: -3px;
  border-radius: 2px;
  background: #8a8a8a;
  transition: width 120ms ease, margin-left 120ms ease;
}
html[data-shell="windows"] .tb-pin.is-active { background: rgba(0, 0, 0, 0.08); }
html[data-shell="windows"] .tb-pin.is-active::after { width: 16px; margin-left: -8px; background: var(--win-accent); }
html[data-shell="windows"] .tb-pin.is-minimized::after { background: #b0b0b0; }
html[data-shell="windows"] .tb-pin.is-multi::after,
html[data-shell="windows"] .tb-task.is-multi::after { box-shadow: 10px 0 0 0 currentColor; color: #8a8a8a; }
html[data-shell="windows"] .tb-pin.is-multi.is-active::after,
html[data-shell="windows"] .tb-task.is-multi.is-active::after { color: var(--win-accent); }

html[data-shell="windows"] .tb-pin svg,
html[data-shell="windows"] .tb-task svg {
  width: 24px;
  height: 24px;
}

html[data-shell="windows"] .tb-pin:hover {
  background: rgba(0, 0, 0, 0.06);
}

html[data-shell="windows"] .tb-badge {
  top: 3px;
  right: 3px;
}

html[data-shell="windows"] .tb-tasks {
  flex: 0 1 auto;
  align-items: center;
  gap: 4px;
  margin-left: 4px;
  overflow: visible;
}

/* 실행 중인 창: 아이콘만, 아래 알약 표시 */
html[data-shell="windows"] .tb-task {
  flex: 0 0 auto;
  width: 40px;
  height: 40px;
  min-width: 0;
  padding: 0;
  justify-content: center;
  position: relative;
  border: none;
  border-radius: 4px;
  color: #1b1b1b;
}

html[data-shell="windows"] .tb-task:hover {
  background: rgba(0, 0, 0, 0.06);
}

html[data-shell="windows"] .tb-task.is-active {
  background: rgba(0, 0, 0, 0.08);
}

html[data-shell="windows"] .tb-task-title {
  display: none;
}

html[data-shell="windows"] .tb-task-icon,
html[data-shell="windows"] .tb-task-icon svg {
  width: 24px;
  height: 24px;
}

html[data-shell="windows"] .tb-task::after {
  content: "";
  position: absolute;
  bottom: 2px;
  left: 50%;
  width: 6px;
  height: 3px;
  margin-left: -3px;
  border-radius: 2px;
  background: #8a8a8a;
  transition: width 120ms ease, margin-left 120ms ease;
}

html[data-shell="windows"] .tb-task.is-active::after {
  width: 16px;
  margin-left: -8px;
  background: var(--win-accent);
}

html[data-shell="windows"] .tb-task.is-minimized::after {
  background: #b0b0b0;
}

/* 시계는 오른쪽 끝에 고정 */
html[data-shell="windows"] .tb-tray {
  position: absolute;
  right: 0;
  top: 0;
  height: 100%;
  padding: 0 8px;
}

html[data-shell="windows"] .tb-clock {
  font-size: 12px;
  border-radius: 4px;
  padding: 0 8px;
  height: 40px;
  margin: 4px 0;
  align-items: flex-end;
  color: #1b1b1b;
}

html[data-shell="windows"] .tb-clock:hover {
  background: rgba(0, 0, 0, 0.06);
}

/* ===== 시작 메뉴: 가운데, 둥근 패널, 아이콘 격자 ===== */
html[data-shell="windows"] .start-menu {
  left: 50%;
  bottom: calc(var(--taskbar-h) + 12px);
  width: 560px;
  max-width: calc(100vw - 24px);
  max-height: calc(100vh - var(--taskbar-h) - 24px);
  transform: translateX(-50%);
  padding: 0;
  border-radius: 8px;
  background: rgba(243, 243, 243, 0.94);
  backdrop-filter: blur(30px);
  -webkit-backdrop-filter: blur(30px);
  border: 1px solid rgba(0, 0, 0, 0.1);
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.28);
  color: #1b1b1b;
}

html[data-shell="windows"] .sm-user {
  order: 2;
  flex: 0 0 auto;
  padding: 12px 40px;
  background: rgba(0, 0, 0, 0.04);
  border-top: 1px solid rgba(0, 0, 0, 0.08);
  border-bottom: none;
  border-radius: 0 0 8px 8px;
}

html[data-shell="windows"] .sm-avatar {
  width: 32px;
  height: 32px;
}

html[data-shell="windows"] .start-menu {
  display: flex;
  flex-direction: column;
}

html[data-shell="windows"] .start-menu[hidden] {
  display: none;
}

html[data-shell="windows"] .sm-items {
  order: 1;
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  display: grid;
  /* minmax(0, ..): 긴 이름이 칸을 밀어 메뉴 밖으로 나가지 않게 */
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 4px;
  padding: 36px 32px 20px;
  position: relative;
}

html[data-shell="windows"] .sm-items::before {
  content: "고정됨";
  position: absolute;
  top: 14px;
  left: 40px;
  font-size: 13px;
  font-weight: 600;
  color: #1b1b1b;
}

html[data-shell="windows"] .sm-item {
  flex-direction: column;
  justify-content: flex-start;
  gap: 8px;
  width: auto;
  min-height: 80px;
  padding: 10px 4px 6px;
  border-radius: 4px;
  color: #1b1b1b;
  font-size: 12px;
  text-align: center;
}

html[data-shell="windows"] .sm-item:hover {
  background: rgba(0, 0, 0, 0.06);
}

html[data-shell="windows"] .sm-item-icon,
html[data-shell="windows"] .sm-item-icon svg {
  width: 32px;
  height: 32px;
}

html[data-shell="windows"] .sm-item-label {
  line-height: 1.25;
  white-space: normal;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  flex: none;
  overflow: hidden;
  max-width: 100%;
}

html[data-shell="windows"] .sm-divider {
  grid-column: 1 / -1;
  height: 1px;
  margin: 6px 8px;
  background: rgba(0, 0, 0, 0.08);
}

@media (max-width: 720px) {
  html[data-shell="windows"] .sm-items { grid-template-columns: repeat(3, minmax(0, 1fr)); padding: 36px 16px 16px; }
  html[data-shell="windows"] .sm-user { padding: 12px 24px; }
}

/* ===== 창 ===== */
html[data-shell="windows"] .win {
  border: 1px solid rgba(0, 0, 0, 0.18);
  border-radius: 8px;
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.28);
}

html[data-shell="windows"] .win.is-active {
  border-color: rgba(0, 0, 0, 0.26);
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.42);
}

html[data-shell="windows"] .win.is-maximized {
  border-radius: 0;
}

html[data-shell="windows"] .win-titlebar {
  height: 32px;
  font-size: 12px;
}

html[data-shell="windows"] .win-ctrl {
  width: 46px;
  font-size: 11px;
  transition: background 80ms ease;
}

html[data-shell="windows"] .win-ctrl:hover {
  background: rgba(0, 0, 0, 0.06);
}

html[data-shell="windows"] .win-ctrl-close:hover {
  background: #c42b1c;
  color: #fff;
}

html[data-shell="windows"] .win--excel .win-ctrl:hover,
html[data-shell="windows"] .win--messenger .win-ctrl:hover,
html[data-shell="windows"] .win--erp .win-ctrl:hover,
html[data-shell="windows"] .win--imageviewer .win-ctrl:hover {
  background: rgba(255, 255, 255, 0.14);
}

html[data-shell="windows"] .win--excel .win-ctrl-close:hover,
html[data-shell="windows"] .win--messenger .win-ctrl-close:hover,
html[data-shell="windows"] .win--erp .win-ctrl-close:hover,
html[data-shell="windows"] .win--imageviewer .win-ctrl-close:hover {
  background: #c42b1c;
}

/* ===== 대화상자 ===== */
html[data-shell="windows"] .win--dialog {
  border-radius: 8px;
}

html[data-shell="windows"] .dlg-input {
  border-radius: 4px;
  border-color: #c8c8c8;
  border-bottom: 2px solid #8a8a8a;
}

html[data-shell="windows"] .dlg-input:focus {
  border-color: #c8c8c8;
  border-bottom-color: var(--win-accent);
}

html[data-shell="windows"] .dlg-btn {
  border-radius: 4px;
}

html[data-shell="windows"] .dlg-btn-primary {
  background: var(--win-accent);
  border-color: var(--win-accent);
  color: #fff;
  box-shadow: none;
}

html[data-shell="windows"] .dlg-btn-primary:hover {
  background: var(--win-accent-hover);
  border-color: var(--win-accent-hover);
}

/* ===== 알림: 밝은 카드 ===== */
html[data-shell="windows"] .toast-stack {
  right: 12px;
  bottom: calc(var(--taskbar-h) + 12px);
}

html[data-shell="windows"] .toast {
  width: 364px;
  padding: 14px 16px;
  border-radius: 8px;
  background: rgba(249, 249, 249, 0.96);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  color: #1b1b1b;
  border: 1px solid rgba(0, 0, 0, 0.08);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
}

html[data-shell="windows"] .toast-text {
  color: rgba(0, 0, 0, 0.62);
}

html[data-shell="windows"] .toast-close {
  color: rgba(0, 0, 0, 0.5);
}

html[data-shell="windows"] .toast-close:hover {
  color: #000;
}

/* ===== 할 일 위젯: 밝은 아크릴 카드 ===== */
html[data-shell="windows"] .todo-widget {
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid rgba(255, 255, 255, 0.6);
  color: #1b1b1b;
}

html[data-shell="windows"] .todo-head {
  border-bottom-color: rgba(0, 0, 0, 0.08);
}

html[data-shell="windows"] .todo-head-sub,
html[data-shell="windows"] .todo-foot {
  color: rgba(0, 0, 0, 0.55);
}

html[data-shell="windows"] .todo-toggle {
  color: rgba(0, 0, 0, 0.6);
}

html[data-shell="windows"] .todo-toggle:hover {
  background: rgba(0, 0, 0, 0.06);
}

html[data-shell="windows"] .todo-progress {
  background: rgba(0, 0, 0, 0.1);
}

html[data-shell="windows"] .todo-progress-bar {
  background: var(--win-accent);
}

html[data-shell="windows"] .todo-item:hover {
  background: rgba(0, 0, 0, 0.04);
}

html[data-shell="windows"] .todo-check {
  border-color: rgba(0, 0, 0, 0.55);
  border-radius: 4px;
  color: #fff;
}

html[data-shell="windows"] .todo-item.is-done .todo-check {
  background: var(--win-accent);
  border-color: var(--win-accent);
}

html[data-shell="windows"] .todo-item.is-done .todo-text,
html[data-shell="windows"] .todo-item.is-done .todo-due {
  color: rgba(0, 0, 0, 0.4);
}

html[data-shell="windows"] .todo-due {
  color: #b35a00;
}

/* ===== 파일 탐색기 (Windows 11) ===== */
html[data-shell="windows"] .ex-toolbar {
  height: 44px;
  background: #fff;
  border-bottom: 1px solid #ededed;
}

html[data-shell="windows"] .ex-nav-btn {
  width: 32px;
  height: 32px;
  border-radius: 4px;
  font-size: 14px;
}

html[data-shell="windows"] .ex-address {
  height: 32px;
  border-radius: 4px;
  background: #fbfbfb;
  border: 1px solid #e5e5e5;
  border-bottom-color: #cfcfcf;
}

html[data-shell="windows"] .ex-sidebar {
  background: #fff;
  border-right-color: #ededed;
  padding: 8px 6px;
}

html[data-shell="windows"] .ex-side-item {
  border-radius: 4px;
  padding: 6px 10px 6px 18px;
  margin: 1px 0;
}

html[data-shell="windows"] .ex-side-item:hover {
  background: #f0f0f0;
}

html[data-shell="windows"] .ex-side-item.is-active {
  background: #eaeaea;
  box-shadow: inset 3px 0 0 var(--win-accent);
}

html[data-shell="windows"] .ex-row:hover td {
  background: #f3f3f3;
}

html[data-shell="windows"] .ex-row.is-selected td {
  background: #e1ecf7;
}

html[data-shell="windows"] .ex-statusbar {
  border-top-color: #ededed;
}

/* ===== 잠금 화면 ===== */
html[data-shell="windows"] .lk-bg {
  background:
    radial-gradient(ellipse at 50% 60%, rgba(120, 190, 255, 0.35), transparent 55%),
    radial-gradient(ellipse at 30% 30%, rgba(255, 255, 255, 0.1), transparent 50%),
    linear-gradient(160deg, #0a3d7a 0%, #0f5fb5 45%, #1f8be0 75%, #4fb3f0 100%);
}

html[data-shell="windows"] .lk-time {
  font-weight: 300;
}

html[data-shell="windows"] .lk-input {
  border-radius: 4px 0 0 4px;
  border: 1px solid rgba(255, 255, 255, 0.5);
  border-right: none;
}

html[data-shell="windows"] .lk-submit {
  border-radius: 0 4px 4px 0;
  border: 1px solid rgba(255, 255, 255, 0.5);
  border-left: none;
  background: var(--win-accent);
}

html[data-shell="windows"] .lk-submit:hover {
  background: var(--win-accent-hover);
}
