/* Windows XP Authentic Styling */
* {
  box-sizing: border-box;
}

body {
  font-family: 'Tahoma', sans-serif;
  font-size: 11px;
  margin: 0;
  padding: 0;
  overflow: hidden;
  user-select: none;
  -webkit-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
}

/* Windows XP Button Styles */
.xp-button {
  background: linear-gradient(to bottom, #f0f0f0, #d0d0d0);
  border: 1px solid #808080;
  border-right-color: #404040;
  border-bottom-color: #404040;
  border-left-color: #c0c0c0;
  border-top-color: #c0c0c0;
  padding: 2px 8px;
  font-family: 'Tahoma', sans-serif;
  font-size: 11px;
  cursor: pointer;
}

.xp-button:hover {
  background: linear-gradient(to bottom, #f8f8f8, #d8d8d8);
}

.xp-button:active {
  background: linear-gradient(to bottom, #d0d0d0, #f0f0f0);
  border-left-color: #404040;
  border-top-color: #404040;
  border-right-color: #c0c0c0;
  border-bottom-color: #c0c0c0;
}

/* Windows XP Window Styles */
.xp-window {
  border: 2px solid;
  border-color: #0054e3 #0054e3 #0054e3 #0054e3;
  box-shadow: 2px 2px 8px rgba(0, 0, 0, 0.3);
}

.xp-window.inactive {
  border-color: #808080 #808080 #808080 #808080;
}

.xp-titlebar {
  background: linear-gradient(to bottom, #4a90e2, #2b5ce6);
  height: 24px;
  padding: 0 8px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: white;
  font-weight: bold;
  cursor: move;
}

.xp-titlebar.inactive {
  background: linear-gradient(to bottom, #888888, #666666);
}

/* Windows XP Taskbar */
.xp-taskbar {
  background: linear-gradient(to bottom, #245edc, #3f7ce8);
  border-top: 1px solid #4a90e2;
  height: 30px;
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 1000;
}

.xp-start-button {
  background: linear-gradient(to bottom, #3b6bf0, #2654d1);
  border: 1px solid rgba(255, 255, 255, 0.3);
  color: white;
  font-weight: bold;
  padding: 4px 16px;
  margin: 2px;
  border-radius: 2px;
  cursor: pointer;
  display: flex;
  align-items: center;
}

.xp-start-button:hover {
  background: linear-gradient(to bottom, #4a7cf2, #3565d3);
}

.xp-start-button:active, .xp-start-button.active {
  background: linear-gradient(to bottom, #2b5ce6, #1e4fb8);
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.3);
}

/* Desktop Icons */
.desktop-icon {
  position: absolute;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 8px;
  border-radius: 4px;
  cursor: pointer;
  user-select: none;
  width: 64px;
  text-align: center;
}

.desktop-icon:hover {
  background: rgba(0, 84, 227, 0.3);
}

.desktop-icon:active, .desktop-icon.selected {
  background: rgba(0, 84, 227, 0.5);
}

.desktop-icon .icon {
  font-size: 32px;
  margin-bottom: 4px;
  filter: drop-shadow(1px 1px 2px rgba(0, 0, 0, 0.8));
}

.desktop-icon .label {
  color: white;
  font-size: 11px;
  font-weight: bold;
  text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.8);
  line-height: 1.2;
  word-wrap: break-word;
}

/* Start Menu */
.start-menu {
  position: absolute;
  bottom: 30px;
  left: 0;
  width: 384px;
  background: white;
  border: 2px solid #4a90e2;
  border-radius: 0 8px 0 0;
  box-shadow: 4px 4px 12px rgba(0, 0, 0, 0.4);
  z-index: 1001;
}

.start-menu-header {
  background: linear-gradient(to right, #1e4fb8 0%, #1e4fb8 60px, #f0f0f0 60px);
  height: 48px;
  display: flex;
  align-items: center;
  padding: 0 16px;
}

.start-menu-item {
  padding: 8px 60px 8px 16px;
  display: flex;
  align-items: center;
  cursor: pointer;
  font-size: 11px;
}

.start-menu-item:hover {
  background: #e1eafc;
}

.start-menu-item .icon {
  margin-right: 12px;
  font-size: 16px;
}

/* Context Menu */
.context-menu {
  position: absolute;
  background: white;
  border: 1px solid #808080;
  box-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
  z-index: 1002;
  min-width: 120px;
}

.context-menu-item {
  padding: 4px 12px;
  font-size: 11px;
  cursor: pointer;
  border: none;
  background: none;
  text-align: left;
  width: 100%;
}

.context-menu-item:hover {
  background: #316ac5;
  color: white;
}

/* Scrollbars */
::-webkit-scrollbar {
  width: 16px;
  height: 16px;
}

::-webkit-scrollbar-track {
  background: #f0f0f0;
  border: 1px solid #d0d0d0;
}

::-webkit-scrollbar-thumb {
  background: linear-gradient(to bottom, #e0e0e0, #c0c0c0);
  border: 1px solid #a0a0a0;
}

::-webkit-scrollbar-thumb:hover {
  background: linear-gradient(to bottom, #d0d0d0, #b0b0b0);
}

::-webkit-scrollbar-corner {
  background: #f0f0f0;
}

/* Animations */
.window-minimize {
  animation: minimizeToTaskbar 0.3s ease-in-out;
}

@keyframes minimizeToTaskbar {
  0% {
    transform: scale(1);
    opacity: 1;
  }
  100% {
    transform: scale(0.1) translateY(80vh);
    opacity: 0;
  }
}

.window-restore {
  animation: restoreFromTaskbar 0.3s ease-in-out;
}

@keyframes restoreFromTaskbar {
  0% {
    transform: scale(0.1) translateY(80vh);
    opacity: 0;
  }
  100% {
    transform: scale(1);
    opacity: 1;
  }
}

/* Loading animations */
.loading-spinner {
  animation: spin 1s linear infinite;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

/* Responsive adjustments */
@media (max-width: 768px) {
  .desktop-icon {
    width: 56px;
  }
  
  .desktop-icon .icon {
    font-size: 28px;
  }
  
  .desktop-icon .label {
    font-size: 10px;
  }
  
  .start-menu {
    width: 100vw;
    max-width: 320px;
  }
}

@media (max-width: 480px) {
  .xp-taskbar {
    height: 40px;
  }
  
  .desktop-icon {
    width: 48px;
  }
  
  .desktop-icon .icon {
    font-size: 24px;
  }
  
  .desktop-icon .label {
    font-size: 9px;
  }
}