/**
 * Everything - Windows XP Theme
 * Nostalgic recreation of the classic Windows XP aesthetic
 */

.theme-windows-xp {
  --color-bg: #3a6ea5;
  --color-bg-alt: #ece9d8;
  --color-text: #000000;
  --color-text-muted: #555555;
  --color-primary: #0078d7;
  --color-secondary: #316ac5;
  --color-accent: #ffcc00;

  --font-family-body: 'Tahoma', 'Segoe UI', sans-serif;
  --font-family-heading: 'Tahoma', 'Segoe UI', sans-serif;

  --xp-blue-gradient: linear-gradient(180deg, #0a246a 0%, #a6caf0 8%, #0a246a 100%);
  --xp-green-start: linear-gradient(180deg, #3c8d2d 0%, #58b448 15%, #3c8d2d 85%, #2d6d21 100%);
  --xp-title-bar: linear-gradient(180deg, #0058ee 0%, #3593ff 4%, #0058ee 94%);
}

.theme-windows-xp body {
  background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1 1"><rect fill="%233a6ea5"/></svg>');
  background-color: #3a6ea5;
  font-family: var(--font-family-body);
  font-size: 11px;
}

/* Desktop icons grid */
.xp-desktop {
  min-height: 100vh;
  padding: 20px;
  padding-bottom: 50px;
  background:
    linear-gradient(135deg,
      #245edb 0%,
      #3178c6 25%,
      #4a90d9 50%,
      #5ba0e0 75%,
      #69b2e8 100%
    );
  position: relative;
}

/* Bliss background option */
.xp-desktop--bliss {
  background:
    linear-gradient(to bottom, #7ec0ee 0%, #7ec0ee 60%, #98d977 60%, #7bc043 100%);
  background-size: cover;
}

/* Desktop icon */
.xp-icon {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  width: 75px;
  padding: 5px;
  margin: 5px;
  cursor: pointer;
  border: 1px solid transparent;
  vertical-align: top;
}

.xp-icon:hover {
  background: rgba(0, 0, 255, 0.1);
  border: 1px dotted rgba(255, 255, 255, 0.5);
}

.xp-icon.selected {
  background: rgba(0, 0, 255, 0.3);
  border: 1px dotted white;
}

.xp-icon__image {
  width: 32px;
  height: 32px;
  margin-bottom: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
}

.xp-icon__label {
  color: white;
  text-align: center;
  font-size: 11px;
  text-shadow: 1px 1px 1px rgba(0, 0, 0, 0.8);
  word-wrap: break-word;
  max-width: 70px;
}

/* XP Window */
.xp-window {
  position: absolute;
  background: var(--color-bg-alt);
  border: 1px solid #0054e3;
  border-radius: 8px 8px 0 0;
  box-shadow: 2px 2px 10px rgba(0, 0, 0, 0.3);
  min-width: 300px;
}

.xp-window__titlebar {
  background: var(--xp-title-bar);
  padding: 3px 5px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-radius: 6px 6px 0 0;
  cursor: move;
}

.xp-window__title {
  color: white;
  font-weight: bold;
  font-size: 12px;
  text-shadow: 1px 1px 1px rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  gap: 5px;
}

.xp-window__controls {
  display: flex;
  gap: 2px;
}

.xp-window__btn {
  width: 21px;
  height: 21px;
  border: 1px solid;
  border-radius: 3px;
  font-size: 10px;
  font-weight: bold;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.xp-window__btn--minimize {
  background: linear-gradient(180deg, #3c8d2d 0%, #58b448 50%, #3c8d2d 100%);
  border-color: #2d6d21;
  color: white;
}

.xp-window__btn--maximize {
  background: linear-gradient(180deg, #3c8d2d 0%, #58b448 50%, #3c8d2d 100%);
  border-color: #2d6d21;
  color: white;
}

.xp-window__btn--close {
  background: linear-gradient(180deg, #c43c30 0%, #e25c4f 50%, #c43c30 100%);
  border-color: #8c2d25;
  color: white;
}

.xp-window__btn:hover {
  filter: brightness(1.1);
}

.xp-window__menubar {
  background: var(--color-bg-alt);
  padding: 2px 5px;
  border-bottom: 1px solid #aaa;
  font-size: 11px;
}

.xp-window__menubar span {
  padding: 2px 8px;
  cursor: pointer;
}

.xp-window__menubar span:hover {
  background: #316ac5;
  color: white;
}

.xp-window__content {
  padding: 10px;
  background: white;
  min-height: 200px;
}

.xp-window__statusbar {
  background: #ece9d8;
  border-top: 1px solid #aaa;
  padding: 2px 10px;
  font-size: 11px;
  color: #555;
}

/* XP Button */
.xp-button {
  background: linear-gradient(180deg, #fff 0%, #ece9d8 50%, #d4d0c8 100%);
  border: 1px solid #003c74;
  border-radius: 3px;
  padding: 4px 16px;
  font-size: 11px;
  cursor: pointer;
  box-shadow: 1px 1px 0 white inset, -1px -1px 0 #888 inset;
}

.xp-button:hover {
  background: linear-gradient(180deg, #fff 0%, #ede8db 50%, #e0dcd4 100%);
}

.xp-button:active {
  background: linear-gradient(180deg, #d4d0c8 0%, #ece9d8 100%);
  box-shadow: -1px -1px 0 white inset, 1px 1px 0 #888 inset;
}

.xp-button--primary {
  background: linear-gradient(180deg, #5c9eff 0%, #3178c6 50%, #245edb 100%);
  color: white;
  border-color: #003c74;
}

/* XP Textbox */
.xp-input {
  background: white;
  border: 1px solid #7f9db9;
  padding: 3px 5px;
  font-size: 11px;
  font-family: var(--font-family-body);
}

.xp-input:focus {
  outline: none;
  border-color: #316ac5;
}

/* Error dialog */
.xp-error {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 1000;
}

.xp-error .xp-window__content {
  display: flex;
  align-items: flex-start;
  gap: 15px;
  padding: 20px;
}

.xp-error__icon {
  font-size: 32px;
}

.xp-error__message {
  flex: 1;
}

.xp-error__message h3 {
  margin: 0 0 10px 0;
  font-size: 12px;
}

.xp-error__message p {
  margin: 0;
  font-size: 11px;
  color: #333;
}

.xp-error__buttons {
  margin-top: 15px;
  display: flex;
  gap: 10px;
  justify-content: center;
}

/* Taskbar */
.xp-taskbar {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: 30px;
  background: linear-gradient(180deg, #245edb 0%, #3f8cf3 9%, #245edb 18%, #245edb 92%, #1941a5 100%);
  display: flex;
  align-items: center;
  padding: 2px;
  z-index: 100;
}

.xp-taskbar__start {
  background: var(--xp-green-start);
  color: white;
  font-weight: bold;
  font-size: 11px;
  padding: 2px 10px 2px 5px;
  border-radius: 0 8px 8px 0;
  border: none;
  text-shadow: 1px 1px 1px rgba(0, 0, 0, 0.5);
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 3px;
  height: 100%;
}

.xp-taskbar__start:hover {
  filter: brightness(1.1);
}

.xp-taskbar__items {
  flex: 1;
  display: flex;
  padding: 0 5px;
  gap: 3px;
}

.xp-taskbar__item {
  background: linear-gradient(180deg, #3c8cf3 0%, #2570d4 50%, #1a5ab8 100%);
  color: white;
  font-size: 11px;
  padding: 2px 10px;
  border: 1px solid #0a3c8c;
  border-radius: 3px;
  max-width: 150px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  cursor: pointer;
}

.xp-taskbar__item.active {
  background: linear-gradient(180deg, #1f5cbf 0%, #1a4fa3 50%, #153d82 100%);
  box-shadow: inset 1px 1px 3px rgba(0, 0, 0, 0.3);
}

.xp-taskbar__tray {
  background: linear-gradient(180deg, #1290e9 0%, #19b1f9 9%, #1290e9 18%);
  padding: 0 10px;
  height: 100%;
  display: flex;
  align-items: center;
  font-size: 11px;
  color: white;
  border-left: 1px solid #1666c0;
}

/* Start menu */
.xp-start-menu {
  position: fixed;
  bottom: 32px;
  left: 0;
  width: 380px;
  background: white;
  border: 2px solid #0054e3;
  border-radius: 8px 8px 0 0;
  box-shadow: 3px 3px 10px rgba(0, 0, 0, 0.4);
  z-index: 1001;
  display: none;
}

.xp-start-menu.open {
  display: block;
}

.xp-start-menu__header {
  background: linear-gradient(180deg, #0058ee 0%, #3593ff 4%, #0058ee 94%);
  color: white;
  padding: 10px;
  display: flex;
  align-items: center;
  gap: 10px;
  border-radius: 6px 6px 0 0;
}

.xp-start-menu__avatar {
  width: 48px;
  height: 48px;
  background: #fff;
  border: 2px solid #fff;
  border-radius: 3px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
}

.xp-start-menu__username {
  font-size: 14px;
  font-weight: bold;
  text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.5);
}

.xp-start-menu__body {
  display: flex;
}

.xp-start-menu__left {
  flex: 1;
  background: white;
  padding: 5px 0;
}

.xp-start-menu__right {
  width: 190px;
  background: #d3e5fa;
  padding: 5px 0;
}

.xp-start-menu__item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 5px 10px;
  cursor: pointer;
  font-size: 11px;
  color: #000;
  text-decoration: none;
}

.xp-start-menu__item:hover {
  background: #316ac5;
  color: white;
}

.xp-start-menu__item-icon {
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
}

.xp-start-menu__divider {
  height: 1px;
  background: #aaa;
  margin: 5px 10px;
}

.xp-start-menu__footer {
  background: linear-gradient(180deg, #4089d8 0%, #2f6cc5 100%);
  padding: 5px 10px;
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

.xp-start-menu__footer button {
  background: linear-gradient(180deg, #f8b56c 0%, #e87d0d 50%, #cf6e09 100%);
  color: white;
  border: 1px solid #8c4e05;
  border-radius: 3px;
  padding: 3px 15px;
  font-size: 11px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 5px;
}

/* Loading cursor */
.xp-loading {
  cursor: wait !important;
}

/* Selection rectangle */
.xp-selection {
  position: absolute;
  border: 1px dashed rgba(255, 255, 255, 0.8);
  background: rgba(0, 0, 255, 0.1);
  pointer-events: none;
}
