/* Reset & basic styling */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html, body {
  width: 100%;
  height: 100%;
  font-family: "Segoe UI", sans-serif;
}

/* Desktop background mimicking Windows 11 wallpaper */
#desktop {
  position: relative;
  width: 100%;
  height: 100%;
  background: url("https://news-cdn.softpedia.com/images/news2/download-the-official-windows-11-wallpaper-533232-2.jpg") no-repeat center center;
  background-size: cover;
  overflow: hidden;
}

/* Taskbar styles */
#taskbar {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 48px;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  padding: 0 10px;
  justify-content: flex-start;
}

/* Start button styling */
#start-button {
  width: 92px;
  height: 92px;
  display: flex;
  justify-content: center;
  align-items: center;
  cursor: pointer;
  transition: background 0.3s ease;
}

#start-button:hover {
  background: transparent;
}

/* Taskbar pinned items */
#taskbar-items {
  display: flex;
  gap: 10px;
  margin-left: auto;
}

.taskbar-item {
  width: 40px;
  height: 40px;
  background: rgba(255, 255, 255, 0.2);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 0.3s ease, transform 0.3s ease;
}

.taskbar-item:hover {
  background: rgba(255, 255, 255, 0.3);
  transform: scale(1.1);
}

/* Start Menu Overlay styling */
#start-menu {
  position: absolute;
  bottom: 100px;
  left: 10px;
  width: 300px;
  background: rgba(0, 0, 0, 0.5); 
  backdrop-filter: blur(8px);
  border-radius: 12px;
  box-shadow: 0 8px 16px rgba(0,0,0,0.3);
  padding: 20px;
  animation: fadeInUp 0.3s ease-out;
}

/* Title within Start Menu */
#start-menu h2 {
  margin-bottom: 10px;
  color: white;
}

/* Grid layout for menu items */
.menu-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 15px;
}

.menu-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  cursor: pointer;
  transition: transform 0.2s ease;
}

.menu-item:hover {
  transform: scale(1.05);
}

.menu-item span {
  margin-top: 8px;
  font-size: 0.9em;
  color: white;
}

/* Fade In Up animation */
@keyframes fadeInUp {
  from {
    transform: translateY(20px);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

/* Utility class to hide elements */
.hidden {
  display: none;
}

/* Start button image styling */
#start-button img {
  width: 80%;
  height: 80%;
  object-fit: cover;
}

/* Style for menu icons */
.menu-icon {
  width: 48px;
  height: 48px;
  object-fit: contain; 
}

/* Virus Maker App Window styles */
.app-window {
  position: absolute;
  width: 405px;
  height: 304px;
  background-color: darkgray;
  border: 2px solid #333;
  border-radius: 12px;
  box-shadow: 0 8px 16px rgba(0, 0, 0, 0.3);
  top: 100px;
  left: 100px;
  z-index: 100;
}

.app-header {
  background: #0078D7;
  color: white;
  padding: 8px;
  cursor: move;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-top-left-radius: 6px;
  border-top-right-radius: 6px;
}

.app-header .app-icon {
  width: 24px;
  height: 24px;
  margin-right: 8px;
}

.app-header span {
  flex: 1;
}

.app-header .close-btn {
  background: none;
  border: none;
  color: white;
  font-size: 16px;
  cursor: pointer;
}

.app-content {
  padding: 15px;
  height: calc(100% - 40px);
  overflow: auto;
  display: flex;
  flex-direction: column;
  gap: 15px;
}

.virus-box {
  width: 100%;
  height: 150px;
  background: rgba(0, 0, 0, 0.2);
  border: 2px dashed #333;
  border-radius: 8px;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(70px, 1fr));
  gap: 10px;
  padding: 15px;
  justify-items: center;
  font-style: normal;
  color: #666;
  margin-bottom: 10px;
}

.virus-item {
  width: 70px;
  height: 80px;
  background: #ff4444;
  border-radius: 8px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: white;
  font-size: 11px;
  text-align: center;
  padding: 5px;
  transition: transform 0.2s, background-color 0.2s;
}

.virus-item:hover {
  transform: scale(1.05);
  background: #ff6666;
}

.virus-item.selected {
  background: #cc0000;
  transform: scale(0.95);
}

.virus-item img {
  width: 32px;
  height: 32px;
  margin-bottom: 5px;
  pointer-events: none;
}

.test-button {
  padding: 8px 16px;
  background: #ff4444;
  color: white;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  font-weight: bold;
  transition: background 0.3s ease;
}

.test-button:hover {
  background: #ff6666;
}

.clear-button {
  padding: 8px 16px;
  background: #666;
  color: white;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  font-weight: bold;
  transition: background 0.3s ease;
  margin-right: 10px;
}

.clear-button:hover {
  background: #888;
}

.button-container {
  display: flex;
  justify-content: center;
  gap: 10px;
}

.bluescreen {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: #0078d7;
  color: white;
  display: none;
  flex-direction: column;
  justify-content: flex-start;
  align-items: flex-start;
  z-index: 9999;
  font-family: "Segoe UI Light", "Segoe UI", sans-serif;
  padding: 8% 5%;
  text-align: left;
  animation: bsodFadeIn 1s ease-in-out;
}

.bluescreen.red-screen {
  background: #d70000;
}

.bluescreen.green-screen {
  background: #007d1b;
}

.bluescreen.yellow-screen {
  background: #c7c700;
}

.bluescreen.black-screen {
  background: #000000;
}

.bluescreen h1 {
  font-size: 120px;
  margin-bottom: 20px;
  font-weight: 300;
}

.bluescreen p {
  font-size: 24px;
  margin: 10px 0;
  font-weight: 300;
  max-width: 80%;
  line-height: 1.4;
}

.bluescreen .error-code {
  margin-top: 40px;
  font-size: 16px;
  opacity: 0.8;
}

.bluescreen .qr-placeholder {
  position: absolute;
  bottom: 8%;
  right: 5%;
  width: 120px;
  height: 120px;
  border: 4px solid white;
}

@keyframes bsodFadeIn {
  0% {
    opacity: 0;
  }
  100% {
    opacity: 1;
  }
}

.hidden-background {
  background-image: none !important;
  background-color: #000 !important;
}

/* Error Message Window styles */
.error-window {
  position: fixed;
  background: #f0f0f0;
  border: 1px solid #999;
  border-radius: 8px;
  padding: 20px;
  width: 300px;
  box-shadow: 0 4px 8px rgba(0,0,0,0.2);
  z-index: 1000;
  animation: popIn 0.3s ease-out;
}

.error-window h3 {
  color: #ff0000;
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.error-window h3 img {
  width: 24px;
  height: 24px;
}

.error-window p {
  margin: 10px 0;
}

.error-window button {
  background: #e1e1e1;
  border: 1px solid #999;
  padding: 5px 15px;
  border-radius: 4px;
  cursor: pointer;
  float: right;
}

.error-window button:hover {
  background: #d1d1d1;
}

@keyframes popIn {
  from {
    transform: scale(0.3);
    opacity: 0;
  }
  to {
    transform: scale(1);
    opacity: 1;
  }
}

/* Add color picker styles */
.virus-settings {
  background: rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  padding: 10px;
  margin-top: 10px;
}

.settings-title {
  color: white;
  font-size: 14px;
  margin-bottom: 8px;
}

.color-options {
  display: flex;
  gap: 8px;
  margin-bottom: 10px;
}

.color-option {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  cursor: pointer;
  border: 2px solid transparent;
  transition: transform 0.2s;
}

.color-option:hover {
  transform: scale(1.1);
}

.color-option.selected {
  border-color: white;
}

.face-options {
  display: flex;
  gap: 8px;
}

.face-option {
  background: rgba(255, 255, 255, 0.2);
  padding: 4px 12px;
  border-radius: 4px;
  color: white;
  cursor: pointer;
  transition: background 0.2s;
}

.face-option:hover {
  background: rgba(255, 255, 255, 0.3);
}

.face-option.selected {
  background: rgba(255, 255, 255, 0.4);
}

/* Add styles for error message settings */
.virus-settings.error-settings {
  display: none;
}

.virus-settings.error-settings.active,
.virus-settings.bluescreen-settings.active,
.virus-settings.bgchanger-settings.active {
  display: block;
}

.virus-settings.bgchanger-settings {
  display: none;
}

.virus-settings input[type="text"],
.virus-settings input[type="number"] {
  width: 100%;
  padding: 6px;
  border-radius: 4px;
  border: 1px solid rgba(255, 255, 255, 0.3);
  background: rgba(255, 255, 255, 0.1);
  color: white;
  margin-bottom: 8px;
}

.virus-settings input[type="number"] {
  width: 80px;
}

.virus-settings label {
  color: white;
  font-size: 12px;
  display: block;
  margin-bottom: 4px;
}

.setting-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
}

.reset-settings {
  background: rgba(255, 255, 255, 0.2);
  border: none;
  color: white;
  padding: 4px 8px;
  border-radius: 4px;
  cursor: pointer;
  font-size: 12px;
}

.reset-settings:hover {
  background: rgba(255, 255, 255, 0.3);
}

.bg-options {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-bottom: 15px;
}

.bg-option {
  cursor: pointer;
  border: 2px solid transparent;
  border-radius: 8px;
  overflow: hidden;
  transition: transform 0.2s;
}

.bg-option:hover {
  transform: scale(1.05);
}

.bg-option.selected {
  border-color: white;
}

.bg-preview {
  width: 100%;
  height: 60px;
  background-size: cover;
  background-position: center;
  border-radius: 6px;
}

.bg-option span {
  display: block;
  text-align: center;
  color: white;
  font-size: 12px;
  padding: 4px;
}

.custom-bg {
  margin-top: 10px;
}

.custom-bg label {
  display: block;
  color: white;
  margin-bottom: 5px;
}

.custom-bg input[type="file"] {
  width: 100%;
  color: white;
}

/* Rename existing virus-settings to be more specific */
.virus-settings.bluescreen-settings {
  display: none;
}

/* AI Virus Creator styles */
.virus-settings.ai-virus-settings {
  margin-top: 20px;
  padding: 15px;
  background: rgba(128, 0, 128, 0.2);
  border-radius: 8px;
}

#virus-prompt {
  width: 100%;
  height: 80px;
  padding: 10px;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.3);
  background: rgba(255, 255, 255, 0.1);
  color: white;
  resize: none;
  font-family: inherit;
}

.generate-button {
  background: #800080;
  color: white;
  border: none;
  padding: 8px 16px;
  border-radius: 20px;
  cursor: pointer;
  font-weight: bold;
  transition: background 0.3s ease;
  margin-top: 10px;
}

.generate-button:hover {
  background: #a000a0;
}

.generate-button:disabled {
  background: #666;
  cursor: not-allowed;
}

#generated-virus-display {
  margin-top: 15px;
  padding: 10px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 8px;
}

#generated-virus-display .virus-item {
  width: 100%;
  height: auto;
  padding: 10px;
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  gap: 10px;
  background: rgba(128, 0, 128, 0.3);
}

.virus-description {
  color: white;
  font-size: 0.9em;
  padding: 10px;
  background: rgba(0, 0, 0, 0.2);
  border-radius: 8px;
  margin-top: 10px;
}

.loading-indicator {
  display: flex;
  gap: 4px;
  justify-content: center;
  margin: 10px 0;
}

.loading-indicator span {
  width: 8px;
  height: 8px;
  background: #800080;
  border-radius: 50%;
  animation: pulse 1s infinite ease-in-out;
}

.loading-indicator span:nth-child(2) { animation-delay: 0.2s; }
.loading-indicator span:nth-child(3) { animation-delay: 0.4s; }

@keyframes pulse {
  0%, 100% { transform: scale(1); opacity: 0.5; }
  50% { transform: scale(1.2); opacity: 1; }
}

/* My PC Window styles */
.mypc-window {
  position: absolute;
  width: 500px;
  height: 400px;
  background-color: darkgray;
  border: 2px solid #333;
  border-radius: 12px;
  box-shadow: 0 8px 16px rgba(0, 0, 0, 0.3);
  top: 50px;
  left: 50px;
  z-index: 100;
}

.drive-list {
  padding: 15px;
  height: calc(100% - 40px);
  overflow: auto;
}

.drive-item {
  display: flex;
  align-items: center;
  padding: 10px;
  background: rgba(255, 255, 255, 0.1);
  margin-bottom: 10px;
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.2s;
}

.drive-item:hover {
  background: rgba(255, 255, 255, 0.2);
}

.drive-icon {
  width: 48px;
  height: 48px;
  margin-right: 15px;
}

.drive-info {
  flex: 1;
}

.drive-name {
  font-weight: bold;
  color: white;
  margin-bottom: 5px;
}

.drive-details {
  font-size: 0.9em;
  color: #eee;
}

.progress-bar {
  height: 6px;
  background: rgba(0, 0, 0, 0.2);
  border-radius: 3px;
  margin-top: 5px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  background: #0078D7;
  width: 0%;
}

/* AI Chat Window specific styles */
#ai-chat-window {
  width: 400px;
  height: 500px;
}

.chat-content {
  display: flex;
  flex-direction: column;
  height: calc(100% - 40px);
  background: #1e1e1e;
}

#chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 15px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.chat-message {
  max-width: 80%;
  padding: 10px 15px;
  border-radius: 15px;
  margin: 5px 0;
  animation: fadeIn 0.3s ease;
}

.user-message {
  background: #0078D7;
  color: white;
  align-self: flex-end;
  border-bottom-right-radius: 5px;
}

.ai-message {
  background: #2D2D2D;
  color: white;
  align-self: flex-start;
  border-bottom-left-radius: 5px;
}

.chat-input-area {
  display: flex;
  padding: 15px;
  gap: 10px;
  background: #2D2D2D;
  border-bottom-left-radius: 10px;
  border-bottom-right-radius: 10px;
}

#chat-input {
  flex: 1;
  padding: 10px;
  border: none;
  border-radius: 20px;
  background: #3D3D3D;
  color: white;
}

#chat-input:focus {
  outline: none;
  background: #4D4D4D;
}

#send-chat {
  padding: 8px 20px;
  border: none;
  border-radius: 20px;
  background: #0078D7;
  color: white;
  cursor: pointer;
  transition: background 0.2s;
}

#send-chat:hover {
  background: #0086F0;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.typing-indicator {
  display: flex;
  gap: 4px;
  padding: 10px;
  background: #2D2D2D;
  border-radius: 15px;
  align-self: flex-start;
  margin: 5px 0;
}

.typing-dot {
  width: 8px;
  height: 8px;
  background: #ffffff;
  border-radius: 50%;
  animation: typingBounce 1s infinite;
}

.typing-dot:nth-child(2) {
  animation-delay: 0.2s;
}

.typing-dot:nth-child(3) {
  animation-delay: 0.4s;
}

@keyframes typingBounce {
  0%, 60%, 100% {
    transform: translateY(0);
  }
  30% {
    transform: translateY(-4px);
  }
}