/* Base styles */
body {
  font-family: 'Inter', sans-serif;
  background-color: #008080; /* Teal background */
  margin: 0;
  padding: 0;
  overflow: hidden; /* Prevent scrollbars */
  color: black;
}

/* Desktop styles */
.desktop {
  width: 100vw;
  height: 100vh;
  overflow: hidden;
  position: relative; /* For absolute positioning of icons and windows */
  cursor: default; /* Default desktop cursor */
  padding-top: 10px; /* Add some space at the top */
  padding-left: 10px;
}

/* Icon styles */
.icon {
  display: inline-flex; /* Use inline-flex for better layout control if needed, or keep block */
  flex-direction: column;
  align-items: center;
  margin: 15px; /* Adjust margin */
  cursor: pointer;
  user-select: none; /* Prevent text selection */
  width: 100px; /* Give icons a fixed width for wrapping */
  vertical-align: top; /* Align icons nicely when wrapping */
  text-align: center;
}

.icon img {
  width: 48px; /* Icon size */
  height: 48px;
  margin-bottom: 8px;
}

.icon span {
  color: white;
  font-size: 0.75rem;
  text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.5); /* Add text shadow for better visibility */
  white-space: normal;      /* Allow text wrapping */
  word-wrap: break-word;    /* Break long words */
  max-width: 100%;         /* Allow text to use full icon width */
  text-align: center;
}

/* Window styles */
.window {
  background-color: #C0C0C0; /* Window background color - Changed to match Win95 better */
  border-top: 2px solid #FFFFFF;
  border-left: 2px solid #FFFFFF;
  border-right: 2px solid #000000;
  border-bottom: 2px solid #000000;
  box-shadow: 2px 2px 2px rgba(0, 0, 0, 0.4); /* More subtle shadow */
  position: absolute; /* Absolute positioning within the desktop */
  top: 50px;
  left: 100px;
  width: 450px; /* Default width */
  height: 320px; /* Default height */
  display: none; /* Initially hidden */
  flex-direction: column; /* Use flexbox for layout */
  z-index: 10; /* Ensure windows are above desktop icons */
  box-sizing: border-box; /* Include border in width/height */
}

@keyframes shake {
  10%, 90% { transform: translate3d(-1px, 0, 0); }
  20%, 80% { transform: translate3d(2px, 0, 0); }
  30%, 50%, 70% { transform: translate3d(-4px, 0, 0); }
  40%, 60% { transform: translate3d(4px, 0, 0); }
}
.window.shake {
  animation: shake 0.5s cubic-bezier(.36,.07,.19,.97) both;
}

.window.active {
  display: flex; /* Show the window when active */
  z-index: 20; /* Bring active window to the front */
}

.window.resizable {
  resize: both; /* Enable resizing in both directions */
  overflow: hidden; /* Hide overflow by default, content area will handle scroll */
  min-width: 250px;  /* Set minimum width */
  min-height: 200px; /* Set minimum height */
}

.window-titlebar {
  background-color: #000080; /* Title bar color */
  color: white;
  padding: 3px 4px; /* Adjusted padding */
  font-size: 0.8rem;
  font-weight: bold; /* Bold title */
  display: flex;
  justify-content: space-between; /* Space between title and buttons */
  align-items: center; /* Vertically center title and buttons */
  cursor: grab; /* Show a grab cursor */
  height: 22px; /* Consistent height */
  box-sizing: border-box;
}
.window-titlebar:active {
  cursor: grabbing; /* Show a grabbing cursor */
}

.window-title {
  margin-right: auto; /* Push title to the left */
  margin-left: 2px;
  white-space: nowrap;      /* Prevent text wrapping */
  overflow: hidden;        /* Hide overflowing text */
  text-overflow: ellipsis;  /* Add ellipsis (...) if title is too long */
  max-width: calc(100% - 60px); /* Adjust max-width based on button size */
}

.window-controls {
  display: flex;
  gap: 3px; /* Space between buttons */
}

.window-control-button {
  width: 16px; /* Button size */
  height: 16px;
  background-color: #C0C0C0; /* Button background */
  border-top: 1px solid #FFFFFF;
  border-left: 1px solid #FFFFFF;
  border-right: 1px solid #000000;
  border-bottom: 1px solid #000000;
  box-shadow: inset 1px 1px 0px rgba(255, 255, 255, 0.5); /* Inner highlight */
  display: flex;
  justify-content: center;
  align-items: center;
  cursor: pointer;
  font-family: "Times New Roman", serif; /* More classic font for symbols */
  font-size: 0.8rem; /* Adjust font size as needed */
  font-weight: bold;
  line-height: 0;      /* Important for vertical centering of symbols */
  padding: 0;          /* Reset padding */
  color: black;
}

.window-control-button:active {
  border-top: 1px solid #000000;
  border-left: 1px solid #000000;
  border-right: 1px solid #FFFFFF;
  border-bottom: 1px solid #FFFFFF;
  box-shadow: none; /* Remove shadow on press */
}

.window-minimize { /* Uses text symbol */ }
.window-close { /* Uses text symbol */ }


.window-content {
  padding: 2px; /* Minimal padding inside window */
  font-size: 0.9rem;
  flex-grow: 1; /* Allow content to fill remaining space */
  overflow: auto; /* Add scrollbars ONLY if content overflows */
  background-color: white; /* Standard content background */
  border: 1px inset #808080; /* Inset border for content area */
  margin: 2px; /* Margin around the content area */
  position: relative; /* Needed for absolute positioned elements inside */
  display: flex; /* Make content a flex container for easier layout */
  flex-direction: column; /* Stack children vertically */
}

/* CV Content style */
.cv-content pre {
  padding: 10px;
  font-family: 'Courier New', Courier, monospace;
  white-space: pre-wrap; /* To respect newlines and wrap text */
  font-size: 0.9rem;
  margin: 0;
  flex-grow: 1;
  width: 100%;
  box-sizing: border-box;
}

/* --- Hobby Invaders Game Styles --- */
.hobby-invaders {
    display: flex;
    width: 100%;
    height: 100%;
    background: #000;
}
.game-screen {
    position: relative;
    flex-grow: 1;
    overflow: hidden;
}
.player {
    position: absolute;
    width: 40px;
    height: 20px;
    background-color: #39FF14; /* Neon green */
    bottom: 10px;
    box-shadow: 0 0 5px #39FF14, 0 0 10px #39FF14;
}
.invader {
    position: absolute;
}
.invader img {
    width: 28px;
    height: 28px;
}
.projectile {
    position: absolute;
    width: 4px;
    height: 12px;
    background-color: #FFD700; /* Gold */
    box-shadow: 0 0 3px #FFD700;
}
.game-sidebar {
    width: 180px;
    background: #c0c0c0;
    border-left: 2px solid #000000;
    padding: 10px;
    font-size: 0.8rem;
    user-select: none;
    color: #000;
    display: flex;
    flex-direction: column;
}
.game-sidebar h4 {
    margin: 0 0 5px 0;
    font-weight: bold;
    text-decoration: underline;
}
.game-sidebar p {
    margin: 0 0 10px 0;
    word-wrap: break-word;
}
.game-over-text {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: #ff0000;
    font-size: 2.5rem;
    font-weight: bold;
    text-align: center;
    text-shadow: 2px 2px 4px #000;
    display: none; /* Initially hidden */
}
.game-pause-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    display: none; /* Hidden by default */
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    color: white;
    z-index: 100;
}
.game-pause-overlay.visible {
    display: flex;
}
.game-pause-text {
    background: rgba(40, 40, 40, 0.85);
    padding: 20px;
    border: 2px solid #FFFFFF;
    max-width: 80%;
}
.game-pause-text h3 {
    font-size: 1.2rem;
    margin: 0 0 10px 0;
    color: #ffc800; /* Gold color for title */
    font-weight: bold;
}
.game-pause-text p {
    font-size: 0.9rem;
    margin: 0 0 15px 0;
}
.game-pause-text small {
    font-size: 0.8rem;
    opacity: 0.8;
    display: block;
}

.unlocked-hobbies {
    margin-top: 15px;
    border-top: 2px solid #808080;
    padding-top: 10px;
}

.unlocked-hobbies-list {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.hobby-button {
    background-color: #C0C0C0;
    border-top: 1px solid #FFFFFF;
    border-left: 1px solid #FFFFFF;
    border-right: 1px solid #000000;
    border-bottom: 1px solid #000000;
    padding: 4px 8px;
    cursor: pointer;
    font-size: 0.75rem;
    text-align: left;
    width: 100%;
}

.hobby-button:active {
    border-top: 1px solid #000000;
    border-left: 1px solid #000000;
    border-right: 1px solid #FFFFFF;
    border-bottom: 1px solid #FFFFFF;
}

/* --- Minesweeper Menu Styles --- */
.window-menu-bar {
    background: #c0c0c0;
    padding: 2px;
    display: flex;
    user-select: none;
    font-size: 0.8rem;
    border-bottom: 1px solid #808080;
    box-shadow: 0 1px 1px rgba(0,0,0,0.1);
}
.menu {
    position: relative;
}
.menu-title {
    padding: 2px 7px;
    cursor: pointer;
}
.menu-dropdown {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    background: #c0c0c0;
    border-top: 1px solid #FFFFFF;
    border-left: 1px solid #FFFFFF;
    border-right: 1px solid #000000;
    border-bottom: 1px solid #000000;
    box-shadow: 1px 1px 2px rgba(0,0,0,0.3);
    z-index: 50; /* Above window content */
    padding: 2px;
}
.menu:hover .menu-title, .menu.active .menu-title {
    background: #000080;
    color: white;
}
.menu:hover .menu-dropdown {
    display: block;
}
.menu-item {
    padding: 3px 20px 3px 10px;
    white-space: nowrap;
    cursor: pointer;
}
.menu-item:hover {
    background: #000080;
    color: white;
}

/* --- Minesweeper Game Styles --- */
.minesweeper-game {
  display: flex;
  flex-direction: column;
  background: #c0c0c0;
  padding: 5px;
  user-select: none;
}
.game-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 5px;
  border-top: 2px solid #808080;
  border-left: 2px solid #808080;
  border-right: 2px solid #fff;
  border-bottom: 2px solid #fff;
  margin-bottom: 5px;
}
.mine-counter, .timer {
  font-family: 'Courier New', Courier, monospace;
  background: #000;
  color: #ff0000;
  padding: 2px 4px;
  font-size: 1.2rem;
  font-weight: bold;
  letter-spacing: 1px;
}
.reset-button {
  width: 26px;
  height: 26px;
  font-size: 1.2rem;
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: #C0C0C0;
  border-top: 2px solid #FFFFFF;
  border-left: 2px solid #FFFFFF;
  border-right: 2px solid #000000;
  border-bottom: 2px solid #000000;
  cursor: pointer;
  padding: 0;
}
.reset-button:active {
  border-top: 2px solid #000000;
  border-left: 2px solid #000000;
  border-right: 2px solid #FFFFFF;
  border-bottom: 2px solid #FFFFFF;
}

.grid {
  display: grid;
  border-top: 2px solid #808080;
  border-left: 2px solid #808080;
  border-right: 2px solid #fff;
  border-bottom: 2px solid #fff;
}
.cell {
  width: 20px;
  height: 20px;
  background-color: #c0c0c0;
  border-top: 2px solid #fff;
  border-left: 2px solid #fff;
  border-right: 2px solid #808080;
  border-bottom: 2px solid #808080;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: bold;
  font-size: 0.9rem;
  cursor: pointer;
}
.cell.revealed {
  background-color: #bdbdbd;
  border: 1px solid #999;
  cursor: default;
}
.cell.flag {
  content: '🚩';
  font-size: 12px;
}
.cell.mine {
  background-color: #ff0000;
}
.cell.c1 { color: #0000ff; }
.cell.c2 { color: #008000; }
.cell.c3 { color: #ff0000; }
.cell.c4 { color: #000080; }
.cell.c5 { color: #800000; }
.cell.c6 { color: #008080; }
.cell.c7 { color: #000000; }
.cell.c8 { color: #808080; }

.window-content.game-window-content {
    padding: 0;
    margin: 0;
    border: none;
    overflow: hidden; /* Ensure no scrollbars appear on the container itself */
}

/* --- Project Explorer Styles --- */
.project-explorer {
    display: flex;
    width: 100%;
    height: 100%;
    background: #c0c0c0;
}
.project-sidebar {
    width: 150px;
    border-right: 2px solid #808080;
    padding: 4px;
    user-select: none;
}
.project-folder {
    display: flex;
    align-items: center;
    gap: 5px;
    padding: 4px;
    cursor: pointer;
    font-size: 0.8rem;
}
.project-folder img { width: 16px; height: 16px; }
.project-folder.active { background-color: #000080; color: white; }

.project-main {
    flex-grow: 1;
    padding: 10px;
    background-color: white;
}
.project-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    align-content: flex-start;
}
.project-icon {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 80px;
    text-align: center;
    cursor: pointer;
}
.project-icon img { width: 32px; height: 32px; margin-bottom: 5px; }
.project-icon span { font-size: 0.75rem; word-break: break-word; }
.project-icon:hover span { background-color: #000080; color: white; }

.project-details {
  font-size: 0.9rem;
}
.project-details h3 {
  font-size: 1.2rem;
  font-weight: bold;
  margin: 0 0 10px 0;
}
.project-details p {
  margin-bottom: 15px;
}
.project-details strong {
  font-weight: bold;
}
.project-details a {
  color: #0000FF;
  text-decoration: underline;
}
.project-back-button {
  background-color: #C0C0C0;
  border-top: 1px solid #FFFFFF;
  border-left: 1px solid #FFFFFF;
  border-right: 1px solid #000000;
  border-bottom: 1px solid #000000;
  padding: 4px 12px;
  cursor: pointer;
  font-size: 0.8rem;
  margin-top: 20px;
}
.project-back-button:active {
  border-top: 1px solid #000000;
  border-left: 1px solid #000000;
}

/* --- MSN Messenger Styles --- */
.msn-content {
    flex-direction: column;
    padding: 0;
    margin: 0;
    background-color: #C0C0C0;
    border: none;
    font-family: 'Tahoma', sans-serif;
    font-size: 0.75rem;
}
.msn-header {
    padding: 8px;
    background: linear-gradient(to bottom, #eff5fb, #e1eefb);
    border-bottom: 1px solid #a4c3e2;
}
.msn-user {
    display: flex;
    align-items: center;
}
.msn-user-avatar {
    width: 48px;
    height: 48px;
    margin-right: 8px;
}
.msn-user-info {
    display: flex;
    flex-direction: column;
}
.msn-user-name {
    font-weight: bold;
    color: #000;
}
.msn-user-email {
    color: #666;
}
.msn-contact-header {
    padding: 4px 8px;
    background: #f7f7f7;
    border-bottom: 1px solid #ccc;
    color: #555;
    border-top: 1px solid #fff;
}
.msn-contact-name {
    font-weight: bold;
}
.msn-messages {
    flex-grow: 1;
    overflow-y: auto;
    padding: 8px;
    background: #fff;
    border-left: 1px solid #808080;
    border-top: 1px solid #808080;
    border-right: 1px solid #fff;
    border-bottom: 1px solid #fff;
    margin: 2px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.msn-message {
    font-size: 0.8rem;
}
.msn-message-sender {
    color: #1A66B3;
    font-weight: bold;
}
.msn-message p {
    margin: 2px 0 0 10px;
    padding: 0;
    word-wrap: break-word;
}
.msn-nudge-alert {
    padding: 5px;
    text-align: center;
    font-style: italic;
    color: #ff4500;
    background-color: #fff8e1;
    border: 1px solid #ffdead;
    border-radius: 4px;
    margin: 5px 0;
}
.msn-typing-indicator {
    padding: 4px 8px;
    font-size: 0.75rem;
    font-style: italic;
    color: #666;
    height: 20px;
}
.msn-input-form {
    display: flex;
    flex-direction: column;
    border-top: 1px solid #fff;
}
.msn-input {
    flex-grow: 1;
    border: none;
    padding: 8px;
    font-size: 0.8rem;
    font-family: 'Tahoma', sans-serif;
    outline: none;
    resize: none;
    height: 80px;
    border-top: 1px solid #808080;
}
.msn-button-bar {
    display: flex;
    justify-content: flex-end;
    gap: 5px;
    padding: 5px;
    background: #c0c0c0;
    border-top: 1px solid #fff;
}
.msn-send-button, .msn-nudge-button {
    background-color: #C0C0C0;
    border-top: 1px solid #FFFFFF;
    border-left: 1px solid #FFFFFF;
    border-right: 1px solid #000000;
    border-bottom: 1px solid #000000;
    padding: 2px 10px;
    cursor: pointer;
    font-size: 0.75rem;
}
.msn-send-button:active, .msn-nudge-button:active {
    border-top: 1px solid #000000;
    border-left: 1px solid #000000;
    border-right: 1px solid #FFFFFF;
    border-bottom: 1px solid #FFFFFF;
}

/* --- Media Player Styles --- */
.mediaplayer-content {
    flex-direction: column;
    padding: 0;
    margin: 0;
    background-color: #C0C0C0;
    border: none;
}
.mediaplayer-video-container {
    flex-grow: 1;
    background: black;
    display: flex;
    align-items: center;
    justify-content: center;
}
.mediaplayer-video-container iframe {
    width: 100%;
    height: 100%;
    border: none;
}
.mediaplayer-placeholder {
    text-align: center;
    color: #808080;
}
.mediaplayer-placeholder img {
    width: 64px;
    height: 64px;
    opacity: 0.5;
    margin-bottom: 10px;
}

/* Start Menu styles */
.start-menu {
  background-color: #C0C0C0;
  border-top: 2px solid #FFFFFF;
  border-left: 2px solid #FFFFFF;
  border-right: 2px solid #000000;
  border-bottom: 2px solid #000000;
  box-shadow: 2px 2px 3px rgba(0, 0, 0, 0.4);
  position: absolute;
  bottom: 36px;
  left: 0;
  width: 180px;
  display: none;
  flex-direction: column;
  z-index: 50;
  padding: 2px;
}

.start-menu.active {
  display: flex;
}

.start-menu-item {
  padding: 5px 10px 5px 25px;
  font-size: 0.8rem;
  color: black;
  cursor: pointer;
  white-space: nowrap;
  position: relative;
}

.start-menu-item:hover {
  background-color: #000080;
  color: white;
}

/* Taskbar styles */
#taskbar {
  background-color: #C0C0C0;
  border-top: 2px solid #FFFFFF;
  position: fixed;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 36px;
  display: flex;
  align-items: center;
  padding: 3px;
  z-index: 40;
  box-sizing: border-box;
}

#start-button {
  background-color: #C0C0C0;
  border-top: 2px solid #FFFFFF;
  border-left: 2px solid #FFFFFF;
  border-right: 2px solid #000000;
  border-bottom: 2px solid #000000;
  padding: 2px 8px;
  margin-right: 5px;
  cursor: pointer;
  font-size: 0.8rem;
  font-weight: bold;
  display: flex;
  align-items: center;
  gap: 4px;
  height: 30px;
  box-sizing: border-box;
}

#start-button:active {
 border-top: 2px solid #000000;
 border-left: 2px solid #000000;
 border-right: 2px solid #FFFFFF;
 border-bottom: 2px solid #FFFFFF;
 padding: 3px 7px 1px 9px;
}

#start-button img {
  width: 20px;
  height: 20px;
}

#taskbar-apps {
  display: flex;
  flex-grow: 1;
  height: 100%;
  align-items: center;
  overflow: hidden;
}

.taskbar-app {
  background-color: #C0C0C0;
  border-top: 1px solid #FFFFFF;
  border-left: 1px solid #FFFFFF;
  border-right: 1px solid #000000;
  border-bottom: 1px solid #000000;
  padding: 2px 6px;
  margin: 0 2px;
  cursor: pointer;
  font-size: 0.75rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 150px;
  height: 28px;
  display: flex;
  align-items: center;
  gap: 4px;
  box-sizing: border-box;
  flex-shrink: 0;
  box-shadow: inset 1px 1px 0px rgba(255, 255, 255, 0.5);
}

.taskbar-app img {
  width: 16px;
  height: 16px;
}

.taskbar-app.active, .taskbar-app:active {
  border-top: 1px solid #000000;
  border-left: 1px solid #000000;
  border-right: 1px solid #FFFFFF;
  border-bottom: 1px solid #FFFFFF;
  background-color: #e0e0e0;
  box-shadow: none;
  padding: 3px 5px 1px 7px;
}