/* ===================================================================
   AlexOS - style.css
   A Windows XP-inspired portfolio landing page.

   COLOR / STYLE REFERENCE (edit these to retheme):
   - Taskbar blue gradient .... #245edb -> #3f8cf3
   - Start button green ....... #3aa33a -> #5fce5f
   - Title bar blue ........... #0a5cd6 -> #3f8cf3
   - Window interior .......... #ece9d8 (classic beige/gray)
   - Desktop wallpaper ........ green sky gradient
   =================================================================== */

/* ---------- Base / reset ---------- */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html, body {
  height: 100%;
}

body {
  /* Retro system font feel: chunky sans-serif stack. */
  font-family: Tahoma, Geneva, Verdana, "Segoe UI", sans-serif;
  font-size: 13px;
  overflow: hidden;            /* Desktop should not scroll. */
  user-select: none;           /* Feels more app-like. */
}

/* ---------- Desktop / wallpaper ---------- */
#desktop {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 36px;                /* Leave room for the taskbar. */
  /* Desktop wallpaper photo. Save your image as images/wallpaper.jpg.
     The gradient below is a fallback shown if the image is missing.
     To change the wallpaper, just replace images/wallpaper.jpg. */
  background-image:
    url("images/wallpaper.jpg"),
    linear-gradient(to bottom, #4a90d9 0%, #6db4e8 35%, #8ed16b 60%, #5ca73e 100%);
  background-size: cover, cover;
  background-position: center, center;
  background-repeat: no-repeat, no-repeat;
  overflow: hidden;
}

/* ---------- Desktop icons ---------- */
.desktop-icons {
  position: absolute;
  top: 12px;
  left: 12px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.desktop-icon {
  width: 84px;
  background: transparent;
  border: 1px solid transparent;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 6px 4px;
  color: #fff;
  font-family: inherit;
  font-size: 12px;
}

.desktop-icon:hover {
  background: rgba(255, 255, 255, 0.18);
  border: 1px dotted rgba(255, 255, 255, 0.6);
}

.desktop-icon:focus {
  outline: none;
  background: rgba(49, 106, 197, 0.45);
  border: 1px dotted rgba(255, 255, 255, 0.8);
}

.icon-glyph {
  font-size: 34px;
  line-height: 1;
  /* Subtle drop shadow so icons pop against the wallpaper. */
  filter: drop-shadow(1px 1px 1px rgba(0, 0, 0, 0.5));
}

.icon-label {
  margin-top: 4px;
  text-align: center;
  text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.8);
}

/* ===================================================================
   WINDOWS
   =================================================================== */
.window {
  position: absolute;
  /* Flexible width: 460px on big screens, but never wider than the
     viewport on small ones (prevents horizontal overflow). */
  width: min(460px, 92vw);
  min-width: 260px;
  background: #ece9d8;          /* Classic beige/light gray interior. */
  border: 1px solid #0a4bbf;
  border-radius: 8px 8px 0 0;
  box-shadow: 3px 3px 12px rgba(0, 0, 0, 0.45);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

/* Utility class toggled by JavaScript. */
.hidden {
  display: none !important;
}

/* ---------- Glossy XP-style title bar ---------- */
.window-title-bar {
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 4px 0 8px;
  cursor: move;                 /* Hints that the window is draggable. */
  border-radius: 7px 7px 0 0;
  /* Glossy blue gradient. */
  background: linear-gradient(
    to bottom,
    #3f8cf3 0%,
    #1d6ae8 8%,
    #0a5cd6 45%,
    #0a5cd6 90%,
    #2f7ef0 100%
  );
  color: #fff;
}

.window-title {
  font-weight: bold;
  font-size: 13px;
  text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.5);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

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

.win-btn {
  width: 22px;
  height: 21px;
  border: 1px solid #ffffff;
  border-radius: 4px;
  font-family: inherit;
  font-weight: bold;
  font-size: 12px;
  line-height: 1;
  color: #fff;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

.win-min {
  background: linear-gradient(to bottom, #5a9bf5, #1d6ae8);
}

.win-min:hover {
  background: linear-gradient(to bottom, #7db0f7, #3f8cf3);
}

.win-close {
  background: linear-gradient(to bottom, #f08a6c, #d6411e);
}

.win-close:hover {
  background: linear-gradient(to bottom, #f7a98f, #e85a37);
}

/* ---------- Window body ---------- */
.window-body {
  padding: 14px 16px;
  background: #ece9d8;
  overflow-y: auto;
  max-height: 60vh;
  line-height: 1.5;
  user-select: text;            /* Allow selecting/copying content. */
}

.window-body h2 {
  font-size: 15px;
  color: #0a3a8c;
  margin-bottom: 10px;
  border-bottom: 1px solid #b8b49a;
  padding-bottom: 4px;
}

.window-body h3 {
  font-size: 13px;
  color: #1d4ea0;
  margin-bottom: 3px;
}

.window-body p {
  margin-bottom: 8px;
}

.project,
.resume-section {
  margin-bottom: 12px;
}

.plain-list {
  list-style: none;
  margin-bottom: 8px;
}

.plain-list li {
  padding: 4px 0;
  border-bottom: 1px dotted #c4c0a8;
}

.coming-soon {
  display: inline-block;
  background: #ffe08a;
  border: 1px solid #c9a23a;
  border-radius: 3px;
  padding: 0 6px;
  font-size: 11px;
  color: #6b5410;
}

/* ---------- Action buttons (e.g. Download Resume) ---------- */
.action-btn {
  margin-top: 6px;
  padding: 5px 14px;
  font-family: inherit;
  font-size: 12px;
  cursor: pointer;
  background: linear-gradient(to bottom, #fdfdfd, #d4d0bc);
  border: 1px solid #8c8870;
  border-radius: 4px;
}

.action-btn:active {
  background: linear-gradient(to bottom, #d4d0bc, #fdfdfd);
}

/* ---------- Projects list (clickable project items) ---------- */
.projects-list {
  margin-top: 8px;
}

.project-item {
  display: block;
  width: 100%;
  text-align: left;
  background: #fdfcf5;
  border: 1px solid #c4c0a8;
  border-radius: 4px;
  padding: 8px 10px;
  margin-bottom: 6px;
  cursor: pointer;
  font-family: inherit;
}

.project-item:hover {
  background: #fffbe0;
  border-color: #0a5cd6;
}

.project-item-name {
  display: block;
  font-weight: bold;
  color: #1d4ea0;
  font-size: 13px;
}

.project-item-tech {
  display: block;
  font-size: 11px;
  color: #777;
  margin-top: 2px;
}

/* ---------- Project detail window ---------- */
.detail-tech {
  color: #444;
}

.detail-note {
  background: #ffe08a;
  border: 1px solid #c9a23a;
  border-radius: 3px;
  padding: 6px 8px;
  font-size: 12px;
  color: #6b5410;
}

.detail-github {
  margin-top: 10px;
}

.detail-github .action-btn {
  margin-right: 6px;
  margin-bottom: 4px;
}

.github-info {
  margin-top: 10px;
  font-size: 12px;
}

.github-info .gh-row {
  padding: 3px 0;
  border-bottom: 1px dotted #c4c0a8;
}

.gh-label {
  font-weight: bold;
  color: #1d4ea0;
}

/* ---------- Videos window ---------- */
.videos-list {
  margin-top: 8px;
}

.video-item {
  margin-bottom: 14px;
  padding-bottom: 10px;
  border-bottom: 1px dotted #c4c0a8;
}

.video-item:last-child {
  margin-bottom: 0;
  padding-bottom: 0;
  border-bottom: none;
}

.video-item h3 {
  margin-bottom: 4px;
}

.video-player {
  width: 100%;
  background: #000;
  border: 1px solid #8c8870;
  border-radius: 3px;
  display: block;
}

.video-missing {
  background: #ffe08a;
  border: 1px solid #c9a23a;
  border-radius: 3px;
  padding: 6px 8px;
  font-size: 12px;
  color: #6b5410;
}

.video-desc {
  margin-top: 4px;
  font-size: 12px;
  color: #555;
}

/* ---------- Welcome window (the auto-opening "About" style window) ---------- */
.welcome-body {
  text-align: center;
}

.welcome-body h2 {
  border-bottom: none;          /* No divider line; it's centered here. */
  margin-bottom: 2px;
}

.welcome-logo {
  font-size: 46px;
  line-height: 1;
  color: #f5c518;               /* Gold star emblem. */
  text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.3);
  margin-bottom: 4px;
}

.welcome-version {
  color: #666;
  font-size: 11px;
  margin-bottom: 12px;
}

.welcome-note {
  font-style: italic;
  color: #444;
}

/* Pressable profile icons (GitHub / LinkedIn) in the Welcome window. */
.welcome-links {
  display: flex;
  justify-content: center;
  gap: 20px;
  margin: 16px 0 8px;
}

.social-icon {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  padding: 6px;
  text-decoration: none;
  font-size: 11px;
  font-weight: bold;
  color: #1d4ea0;
  border: 1px solid transparent;
  border-radius: 6px;
}

.social-icon:hover {
  background: #fffbe0;
  border-color: #0a5cd6;
}

.social-icon svg {
  width: 46px;
  height: 46px;
  display: block;
  border-radius: 9px;
  box-shadow: 1px 1px 4px rgba(0, 0, 0, 0.35);
}

/* ===================================================================
   TERMINAL
   =================================================================== */
.terminal-body {
  background: #0b0b0b;
  color: #33ff66;
  font-family: "Courier New", Courier, monospace;
  font-size: 13px;
  padding: 8px 10px;
  max-height: 60vh;
}

.terminal-output {
  white-space: pre-wrap;
  word-break: break-word;
  margin-bottom: 4px;
}

.terminal-input-line {
  display: flex;
  align-items: center;
}

.terminal-prompt {
  margin-right: 6px;
  white-space: nowrap;
}

.terminal-input {
  flex: 1;
  background: transparent;
  border: none;
  outline: none;
  color: #33ff66;
  font-family: inherit;
  font-size: 13px;
}

/* ===================================================================
   TASKBAR
   =================================================================== */
#taskbar {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 36px;
  display: flex;
  align-items: center;
  /* Bright XP-style blue taskbar. */
  background: linear-gradient(
    to bottom,
    #3f8cf3 0%,
    #245edb 9%,
    #245edb 88%,
    #1846b3 100%
  );
  z-index: 9999;
}

/* ---------- Green Start button ---------- */
#start-button {
  height: 100%;
  padding: 0 22px 0 14px;
  font-family: inherit;
  font-size: 15px;
  font-style: italic;
  font-weight: bold;
  color: #fff;
  cursor: pointer;
  border: none;
  border-radius: 0 12px 12px 0;
  text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.5);
  /* Glossy green. */
  background: linear-gradient(
    to bottom,
    #6ed46e 0%,
    #4cbb4c 12%,
    #3aa33a 55%,
    #2c8a2c 100%
  );
}

#start-button:hover {
  background: linear-gradient(
    to bottom,
    #84e084 0%,
    #5fce5f 12%,
    #46b446 55%,
    #369936 100%
  );
}

#start-button.active {
  background: linear-gradient(
    to bottom,
    #2c8a2c 0%,
    #3aa33a 55%,
    #4cbb4c 100%
  );
}

.start-logo {
  color: #ffe14d;
  font-size: 14px;
}

/* ---------- Open-window buttons in the taskbar ---------- */
#taskbar-windows {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 0 8px;
  overflow: hidden;
}

.taskbar-window-btn {
  height: 26px;
  min-width: 130px;
  max-width: 170px;
  padding: 0 10px;
  font-family: inherit;
  font-size: 12px;
  color: #fff;
  text-align: left;
  cursor: pointer;
  border: 1px solid #1846b3;
  border-radius: 3px;
  background: linear-gradient(to bottom, #4f93f5, #2f6fe0);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.taskbar-window-btn:hover {
  background: linear-gradient(to bottom, #6ba6f7, #3f80ee);
}

/* The active/focused window's taskbar button looks pressed in. */
.taskbar-window-btn.active {
  background: linear-gradient(to bottom, #1c4fb5, #3f80ee);
  box-shadow: inset 1px 1px 3px rgba(0, 0, 0, 0.5);
}

/* ---------- Clock ---------- */
#clock {
  height: 100%;
  display: flex;
  align-items: center;
  padding: 0 14px;
  color: #fff;
  font-size: 12px;
  background: linear-gradient(to bottom, #2f7ad6, #1b59c4);
  border-left: 1px solid #5a9bf5;
}

/* ===================================================================
   START MENU
   =================================================================== */
#start-menu {
  position: absolute;
  bottom: 36px;
  left: 0;
  width: 230px;
  background: #ece9d8;
  border: 1px solid #0a4bbf;
  border-bottom: none;
  border-radius: 8px 8px 0 0;
  box-shadow: 3px -2px 12px rgba(0, 0, 0, 0.45);
  overflow: hidden;
  z-index: 10000;
}

.start-menu-header {
  padding: 12px 14px;
  font-size: 16px;
  font-weight: bold;
  font-style: italic;
  color: #fff;
  text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.5);
  background: linear-gradient(to bottom, #3f8cf3, #0a5cd6);
}

.start-menu-list {
  list-style: none;
  padding: 6px 0;
}

.start-menu-item {
  padding: 8px 14px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 10px;
}

.start-menu-item:hover {
  background: #2f6fe0;
  color: #fff;
}

.start-icon {
  font-size: 18px;
}

/* ===================================================================
   RESPONSIVE LAYOUT
   - Desktop, laptop, and large tablets use the full XP desktop above.
     Windows there are draggable and the JavaScript keeps them on
     screen; the flexible window width (min(460px, 92vw)) prevents
     any horizontal overflow at 1440px, 1024px, and 768px.
   - Phones (max-width 600px) switch to the mobile app layout below.
   =================================================================== */
@media (max-width: 600px) {

  body {
    font-size: 14px;              /* Slightly larger text for phones. */
  }

  /* ---- Desktop icons become a tappable app grid ---- */
  .desktop-icons {
    position: static;             /* Flow from the top instead of a corner. */
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(78px, 1fr));
    gap: 12px;
    padding: 16px;
    width: 100%;
  }

  .desktop-icon {
    width: auto;                  /* Fill the grid cell. */
    padding: 12px 6px;            /* Bigger tap target. */
  }

  .icon-glyph {
    font-size: 38px;
  }

  /* ---- Windows open almost full-screen and stacked ---- */
  /* !important overrides the inline left/top set by JavaScript. */
  .window {
    left: 6px !important;
    right: 6px !important;
    top: 6px !important;
    bottom: 6px !important;
    width: auto !important;       /* left + right define the width. */
    min-width: 0 !important;
    max-height: none;
  }

  /* The window body fills the remaining height and scrolls. */
  .window-body {
    max-height: none;
    flex: 1 1 auto;
    min-height: 0;                /* Lets the body scroll inside flex. */
  }

  .terminal-body {
    max-height: none;
  }

  /* Bigger title bar and control buttons for tapping. */
  .window-title-bar {
    height: 38px;
  }

  .win-btn {
    width: 34px;
    height: 30px;
    font-size: 14px;
  }

  /* ---- Start menu spans the full screen width ---- */
  #start-menu {
    width: 100%;
    border-radius: 0;
    border-left: none;
    border-right: none;
  }

  .start-menu-item {
    padding: 14px 16px;           /* Larger tap targets. */
  }

  /* ---- Taskbar stays usable at the bottom ---- */
  #start-button {
    padding: 0 16px 0 12px;
    font-size: 14px;
  }

  .taskbar-window-btn {
    min-width: 40px;              /* Allow buttons to shrink to fit. */
    max-width: none;
    flex: 1 1 auto;
    padding: 0 6px;
  }

  #clock {
    padding: 0 8px;
    font-size: 11px;
  }

  /* ---- Roomier tappable buttons and list items inside windows ---- */
  .action-btn {
    padding: 10px 16px;
    font-size: 13px;
  }

  .project-item {
    padding: 12px;
  }

  .start-icon {
    font-size: 20px;
  }
}
