@import url("css/apps-1.css");
@import url("css/apps-2.css");
@import url("css/apps-3.css");

@font-face {
  font-family: "Piko";
  src: url("fonts/Gaegu-Light.ttf");
  font-weight: 300;
}

@font-face {
  font-family: "Piko";
  src: url("fonts/Gaegu-Regular.ttf");
  font-weight: 400;
}

@font-face {
  font-family: "Piko";
  src: url("fonts/Gaegu-Bold.ttf");
  font-weight: 700;
}

@font-face {
  font-family: "VT323";
  src: url("fonts/VT323-Regular.ttf") format("truetype");
  font-weight: 400;
  font-style: normal;
}

* {
  box-sizing: border-box;
}

:root {
  --font-primary: "Piko", sans-serif;
  --font-weight-light: 300;
  --font-weight-regular: 400;
  --font-weight-bold: 700;
  --bg: #f7efe5;
  --surface: #fff9f2;
  --surface-soft: #e8c7c5;
  --surface-hover: #f0d6d2;
  --border: #5b4650;
  --border-light: #d8c4c7;
  --text: #4e3d46;
  --text-secondary: #806b73;
  --text-muted: #a99ba0;
  --accent: #d9908f;
  --accent-soft: #f3d9d0;
  --accent-hover: #cc7f80;
  --shadow-small: 0 4px 12px rgba(78, 61, 70, 0.1);
  --shadow-medium: 0 10px 24px rgba(78, 61, 70, 0.14);
  --shadow-large: 0 20px 48px rgba(78, 61, 70, 0.18);
  --radius-small: 10px;
  --radius: 16px;
  --radius-large: 22px;
  --bg-image: url("images/wallpaper/wall0.png");
  --next-bg-image: url("images/wallpaper/wall0.png");
  --edge-gap: 16px;
}

[data-theme="pink"] {
  --bg: #fbecef;
  --surface: #fff8fa;
  --surface-soft: #f1d3dc;
  --surface-hover: #f7e0e6;
  --border: #5b4650;
  --border-light: #e0c2cb;
  --text: #503d45;
  --text-secondary: #80636d;
  --text-muted: #a9969d;
  --accent: #e58daa;
  --accent-soft: #f6d5e0;
  --accent-hover: #d97b9a;
}

[data-theme="lavender"] {
  --bg: #f3f0f8;
  --surface: #fcf9ff;
  --surface-soft: #e2d9ee;
  --surface-hover: #eae3f3;
  --border: #564b60;
  --border-light: #d3c8de;
  --text: #4d4355;
  --text-secondary: #766a80;
  --text-muted: #a49aa9;
  --accent: #d698db;
  --accent-soft: #e9e1f2;
  --accent-hover: #9883ba;
}

[data-theme="luca"] {
  --bg: #fbf3e6;
  --surface: #fff9f0;
  --surface-soft: #f0dec0;
  --surface-hover: #f5e7d0;
  --border: #5a4a43;
  --border-light: #dcc8a8;
  --text: #4f403b;
  --text-secondary: #78665b;
  --text-muted: #a49688;
  --accent: #d9aa68;
  --accent-soft: #f3e2c2;
  --accent-hover: #c99855;
}

[data-theme="mint"] {
  --bg: #eef7f2;
  --surface: #fbfff9;
  --surface-soft: #d8e9df;
  --surface-hover: #e4f1e9;
  --border: #4b5a52;
  --border-light: #c9dcd1;
  --text: #405047;
  --text-secondary: #687a70;
  --text-muted: #9eaca5;
  --accent: #8fc5a5;
  --accent-soft: #ddefe4;
  --accent-hover: #7ab592;
}

[data-theme="sky"] {
  --bg: #f0f7ff;
  --surface: #fafbff;
  --surface-soft: #d8e9f7;
  --surface-hover: #d8e8f5;
  --border: #354451;
  --border-light: #c6d6e2;
  --text: #354451;
  --text-secondary: #5c7180;
  --text-muted: #9daab3;
  --accent: #82b9e8;
  --accent-soft: #ddeeff;
  --accent-hover: #6fa9dc;
}

body {
  user-select: none;
  overflow: hidden;
  margin: 0;
  height: 100vh;
  font-family: var(--font-primary);
  font-weight: var(--font-weight-regular);
  background: var(--bg);
  color: var(--text);
  position: relative;
  isolation: isolate;
}

body::before,
body::after {
  content: "";
  position: fixed;
  inset: 0;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  pointer-events: none;
  z-index: -1;
}

body::before {
  background-image: var(--bg-image);
  opacity: 1;
}

body::after {
  background-image: var(--next-bg-image);
  opacity: 0;
}

body.wallpaper-changing::after {
  opacity: 1;
  transition: opacity 0.25s ease;
}

body.wallpaper-changing::before {
  opacity: 0;
  transition: opacity 0.25s ease;
}

.button {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 16px;
  border: none;
  border-radius: 12px;
  background: var(--accent);
  color: white;
  font-family: var(--font-primary);
  font-weight: var(--font-weight-bold);
  font-size: 14px;
  cursor: pointer;
  transition:
    transform 0.15s ease,
    background 0.15s ease;
}

.button:hover {
  background: var(--accent-hover);
  transform: translateY(-2px);
}

.button:active {
  transform: scale(0.96);
}

.button-secondary {
  background: var(--surface-soft);
  color: var(--text);
}

.button-secondary:hover {
  background: var(--surface-hover);
}

.button-danger {
  background: #ffe5e5;
  color: #d94c67;
}

.button-danger:hover {
  background: #ffd6d6;
}

.input {
  width: 100%;
  padding: 12px;
  border: 2px solid var(--border-light);
  border-radius: 12px;
  background: var(--surface);
  color: var(--text);
  font-family: var(--font-primary);
  font-weight: var(--font-weight-regular);
  outline: none;
  transition: border-color 0.15s;
}

.input:focus {
  border-color: var(--accent);
}

.textarea {
  resize: none;
  min-height: 120px;
}

.card {
  background: var(--surface);
  border: 2px solid var(--border-light);
  border-radius: 14px;
  box-shadow: var(--shadow-small);
}

.panel {
  background: var(--surface-soft);
  border: 2px solid var(--border-light);
  border-radius: 14px;
}

.badge {
  display: inline-flex;
  padding: 4px 10px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--text);
  font-size: 12px;
  font-weight: var(--font-weight-bold);
}

.icon-button {
  width: 42px;
  height: 42px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  border-radius: 12px;
  background: var(--surface-soft);
  cursor: pointer;
  transition: 0.15s;
}

.icon-button:hover {
  background: var(--surface-hover);
}

.desktop-shell {
  width: 100%;
  height: 100%;
  position: relative;
}

.menubar {
  position: fixed;
  top: var(--edge-gap);
  left: var(--edge-gap);
  right: var(--edge-gap);
  width: auto;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 18px;
  background: var(--surface);
  border: 2px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-small);
  z-index: 9999;
}

.menubar-left {
  display: flex;
  align-items: center;
  gap: 10px;
}

.pill {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 8px 14px;
  background: transparent;
  border-radius: 12px;
  color: var(--text);
  margin: 0;
}

.pill-brand {
  font-family: var(--font-primary);
  font-weight: var(--font-weight-bold);
  font-size: 15px;
  letter-spacing: 1px;
  cursor: pointer;
  transition:
    background 0.2s ease-in-out,
    transform 0.2s ease-in-out;
}

.pill-brand:hover {
  background: var(--surface-soft);
}

.menubar-status {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  font-size: 14px;
  font-weight: var(--font-weight-light);
  color: var(--text-secondary);
}

.menubar-clock {
  font-family: var(--font-primary);
  font-weight: var(--font-weight-bold);
  font-size: 13px;
  color: var(--text);
}

.desktop-widgets {
  position: fixed;
  top: 78px;
  right: 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  z-index: 5;
}

.widget {
  width: 280px;
  padding: 14px;
  background: var(--surface);
  border: 2px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-small);
  color: var(--text);
}

.widget-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
}

.widget-title-group {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.widget-month {
  font-family: var(--font-primary);
  font-weight: var(--font-weight-bold);
  font-size: 18px;
  color: var(--text);
}

.widget-year {
  font-size: 13px;
  font-weight: var(--font-weight-light);
  color: var(--text-secondary);
  opacity: 1;
}

.widget-today {
  width: 42px;
  height: 42px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 12px;
  background: var(--accent);
  color: #ffffff;
  font-family: var(--font-primary);
  font-size: 15px;
  font-weight: var(--font-weight-bold);
  line-height: 1;
}

.calendar-weekdays {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 6px;
  margin-bottom: 6px;
  text-align: center;
  font-size: 12px;
  color: var(--text-secondary);
}

.calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 6px;
}

.calendar-day {
  height: 34px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
  transition: 0.15s;
}

.calendar-day:hover {
  background: var(--surface-soft);
}

.calendar-day.today {
  background: var(--accent);
  color: white;
  font-weight: 700;
}

.calendar-day.empty {
  opacity: 0;
}

.widget-weather {
  position: relative;
  width: 280px;
  height: 120px;
  overflow: hidden;
  background: var(--accent-soft);
}

.weather-content {
  position: relative;
  z-index: 1;
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.weather-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
}

.weather-location {
  font-family: var(--font-primary);
  font-weight: var(--font-weight-bold);
  font-size: 18px;
  color: var(--text);
}

.weather-time {
  font-weight: var(--font-weight-light);
  color: var(--text-secondary);
}

.weather-temp {
  font-size: 46px;
  color: var(--text);
  font-weight: var(--font-weight-light);
}

.weather-footer {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
}

.weather-condition {
  font-weight: var(--font-weight-light);
  color: var(--text-secondary);
}

.weather-highlow {
  font-weight: var(--font-weight-light);
  color: var(--text-secondary);
}

.widget-todo {
  width: 280px;
  min-height: 180px;
  padding: 16px;
  box-sizing: border-box;
}

.todo-widget-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
  color: var(--text);
  font-weight: var(--font-weight-bold);
}

.todo-widget-add {
  width: 28px;
  height: 28px;
  border: 2px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
  color: var(--text);
  font-family: var(--font-primary);
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
}

.todo-widget-add:hover {
  background: var(--surface-hover);
}

.todo-widget-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.todo-widget-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px;
  border-radius: 10px;
  background: var(--surface-soft);
  color: var(--text);
}

.todo-widget-empty {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px 8px;
  border-radius: 10px;
  background: var(--surface-soft);
  color: var(--text-secondary);
  font-weight: var(--font-weight-regular);
}

.todo-done .todo-text {
  text-decoration: line-through;
  opacity: 0.55;
}

.window {
  position: absolute;
  background: var(--surface);
  border: 2px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-large);
  overflow: hidden;
  resize: both;
  min-width: 200px;
  min-height: 150px;
  opacity: 0;
  transform: scale(0.96);
  transition:
    opacity 0.2s ease,
    transform 0.2s ease;
}

.window.is-open {
  opacity: 1;
  transform: scale(1);
}

.window.is-closing {
  opacity: 0;
  transform: scale(0.96);
}

.window.maximized {
  top: 72px !important;
  left: 16px !important;
  right: 16px;
  bottom: 108px !important;
  width: calc(100% - 32px) !important;
  height: calc(100% - 180px) !important;
}

.windowheader {
  height: 42px;
  padding: 0 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--surface-soft);
  border-bottom: 2px solid var(--border);
  border-radius: var(--radius) var(--radius) 0 0;
  margin: 0;
}

.window-controls {
  display: flex;
  align-items: center;
  gap: 8px;
}

.control-button {
  width: 12px;
  height: 12px;
  border-radius: 4px;
  display: inline-block;
  cursor: default;
  transition:
    transform 0.1s ease,
    filter 0.1s ease;
  border: 1px solid rgba(0, 0, 0, 0.08);
}

.control-button:hover {
  transform: scale(1.15);
  filter: brightness(1.1);
}

.control-button.close {
  background: #ff93b2;
}

.control-button.minimize {
  background: #ffd7a8;
}

.control-button.zoom {
  background: #a9e8c1;
}

.window-title {
  flex: 1;
  text-align: center;
  font-family: var(--font-primary);
  font-weight: var(--font-weight-bold);
  color: var(--text);
  font-size: 14px;
  letter-spacing: 0.5px;
  margin-right: 44px;
}

.dock {
  position: fixed;
  left: 50%;
  bottom: var(--edge-gap);
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 18px;
  background: var(--surface);
  border: 2px solid var(--border);
  border-radius: var(--radius-large);
  box-shadow: var(--shadow-medium);
  z-index: 9998;
}

.dock-item {
  position: relative;
  width: 56px;
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 16px;
  cursor: pointer;
  transition:
    transform 0.18s ease,
    background 0.18s ease;
}

.dock-item:hover {
  background: var(--surface-soft);
  transform: translateY(-6px);
}

.dock-iconImage {
  width: 42px;
  height: 42px;
  image-rendering: auto;
  transition: transform 0.18s ease;
}

.dock-item:active {
  transform: translateY(-2px) scale(0.94);
}

.dock-item::after {
  content: attr(data-label);
  position: absolute;
  bottom: 72px;
  left: 50%;
  transform: translateX(-50%);
  padding: 6px 10px;
  background: var(--border);
  color: #ffffff;
  border-radius: 10px;
  font-family: var(--font-primary);
  font-weight: var(--font-weight-bold);
  font-size: 10px;
  letter-spacing: 0.5px;
  opacity: 0;
  pointer-events: none;
  transition: 0.15s;
  white-space: nowrap;
}

.dock-item:hover::after {
  opacity: 1;
}

.dock-item.active {
  background: var(--surface-hover);
}

.dock-item.active::before {
  content: "";
  position: absolute;
  bottom: -8px;
  width: 20px;
  height: 4px;
  border-radius: 999px;
  background: var(--accent);
}

#desktopContextMenu {
  position: fixed;
  display: none;
  min-width: 190px;
  margin: 0;
  padding: 8px;
  list-style: none;
  background: var(--surface-soft);
  border: 2px solid var(--text);
  border-radius: 12px;
  box-shadow: 0 12px 24px rgba(0, 0, 0, 0.18);
  z-index: 10000;

  transform-origin: top left;
  animation: contextMenuIn 0.15s ease-out;
}

@keyframes contextMenuIn {
  from {
    opacity: 0;
    transform: scale(0.94) translateY(-4px);
  }

  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

#desktopContextMenu li {
  display: flex;
  align-items: center;
  padding: 10px 12px;
  border-radius: 8px;
  cursor: pointer;
  color: var(--text);
  font-size: 14px;
  transition: background 0.15s ease;
}

#desktopContextMenu li:hover {
  background: var(--surface-hover);
  color: var(--text);
}

.context-divider {
  height: 1px;
  padding: 0 !important;
  margin: 6px 0;
  background: var(--border-light);
  cursor: default !important;
}

.context-divider:hover {
  background: var(--border-light) !important;
}

#notificationContainer {
  position: fixed;
  top: 76px;
  right: 24px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  width: 300px;
  z-index: 9999;
  pointer-events: none;
}

.notification {
  padding: 14px 16px;
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--border-light);
  border-radius: 14px;
  box-shadow: 0 10px 30px rgba(78, 61, 70, 0.12);
  transform: translateX(120%);
  opacity: 0;
  transition:
    transform 0.35s ease,
    opacity 0.35s ease;
}

.notification.show {
  transform: translateX(0);
  opacity: 1;
}

.notification-title {
  font-weight: var(--font-weight-bold);
  margin-bottom: 4px;
}

.notification-message {
  font-size: 13px;
  color: var(--text-secondary);
}

.window-terminal {
  width: 680px;
  height: 460px;
  min-width: 520px;
  min-height: 340px;
  background: #111111;
  border-color: #292929;
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.45);
}

.window-terminal .windowheader {
  background: #181818;
  border-bottom-color: #292929;
}

.window-terminal .window-title {
  color: #d6d6d6;
}

.window-terminal .control-button {
  opacity: 0.9;
}

.terminal-body {
  height: calc(100% - 42px);
  display: flex;
  flex-direction: column;
  padding: 16px 18px;
  background: #111111;
  color: #d6d6d6;
  overflow: hidden;
}

.terminal-output {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 2px 0 14px;
  font-family: "VT323", monospace;
  font-size: 14px;
  line-height: 1.6;
  white-space: pre-wrap;
  word-break: break-word;
  user-select: text;
  scrollbar-width: thin;
  scrollbar-color: #3a3a3a transparent;
}

.terminal-output::-webkit-scrollbar {
  width: 6px;
}

.terminal-output::-webkit-scrollbar-track {
  background: transparent;
}

.terminal-output::-webkit-scrollbar-thumb {
  background: #3a3a3a;
  border-radius: 10px;
}

.terminal-line {
  min-height: 22px;
}

.terminal-command {
  color: #eeeeee;
}

.terminal-response {
  color: #a8a8a8;
}

.terminal-error {
  color: #ff7777;
}

.terminal-input-row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
  padding-top: 10px;
  border-top: 1px solid #292929;
}

.terminal-prompt {
  flex-shrink: 0;
  color: #7ee787;
  font-family: "VT323", monospace;
  font-size: 14px;
  font-weight: 600;
}

.terminal-input {
  flex: 1;
  min-width: 0;
  padding: 3px 0;
  border: none;
  outline: none;
  background: transparent;
  color: #eeeeee;
  font-family: "VT323", monospace;
  font-size: 14px;
  user-select: text;
  caret-color: #7ee787;
}

.terminal-input::selection {
  background: #3a3a3a;
}
