@import url("https://fonts.googleapis.com/css2?family=Doto:wght@100..900&family=Google+Sans+Flex:opsz,wght@6..144,1..1000&family=Pacifico&family=Tiny5&display=swap");

/* ------------------- VARIABLES ------------------- */
:root {
  --backgroundColor: #424581;
  --backgroundColorLight: #ece0cf;
  --backgroundColorPink: #41296d;
  --backgroundColorDark: #131325;
  --fontColor: #cfd8ec;
  --imageShadowColor: #7173a0;
  --footerColor: #212133;
}

/* ------------------- GLOBAL STYLES ------------------- */
::selection {
  background: var(--backgroundColorPink);
  color: var(--backgroundColorLight);
}

h2 {
  color: var(--fontColor);
  font-weight: 400;
  font-size: 40px;
  margin: 20px;

  &.pixel {
    font-family: "tiny5", sans-serif;
    text-transform: uppercase;
  }

  &.cute {
    font-family: "Pacifico", cursive;
    text-transform: lowercase;
  }

  &.dotted {
    font-family: "Doto", sans-serif;
  }

  &.clean {
    font-family: "Google Sans Flex", cursive;
  }

  &.action:hover {
    color: var(--backgroundColorLight);
  }
}

p {
  font-family: "Google Sans Flex", cursive;
  font-size: 20px;
  color: var(--fontColor);
  margin: 5px 0 0 0;

  &.pixel {
    font-family: "tiny5", sans-serif;
    text-transform: uppercase;
  }

  &.cute {
    font-family: "Pacifico", cursive;
    text-transform: lowercase;
  }

  &.dotted {
    font-family: "Doto", sans-serif;
  }

  &.clean {
    font-family: "Google Sans Flex", cursive;
  }
}

/* ------------------- BACKGROUND / SKY ------------------- */
#sky {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  overflow: hidden;
  pointer-events: none;
  z-index: 0;
}

.star {
  position: absolute;
  color: rgba(255, 255, 255, 0.95);
  font-family: Georgia, serif;
  user-select: none;
  will-change: transform, opacity;
}

/* ------------------- EFFECTS / OVERLAYS ------------------- */
/* --- Foggy Overlay Style --- */
#foggy-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  z-index: 9999; /* Below the sidepanel but above everything else */
  pointer-events: none; /* Allows clicks to pass through when hidden */

  /* 1. The FOG EFFECT: Radial gradient to create fading edges */
  background: radial-gradient(
    circle at center,
    rgba(255, 255, 255, 0) 0%,
    rgba(255, 255, 255, 0.1) 70%,
    rgba(255, 255, 255, 0.3) 100% /* Edges are opaque white */
  );

  /* 2. OPTIONAL: Adds a subtle blur to everything behind it (great for 'heat haze') */
  backdrop-filter: blur(3px);

  /* 3. Animation Control: Hidden by default */
  opacity: 0;
  transform: scale(
    1.1
  ); /* Slightly larger than viewport for smooth animation */
  transition: opacity 2s ease-out, transform 2s ease-out;
}

/* The class JavaScript will add to trigger the effect */
#foggy-overlay.is-active {
  opacity: 1;
  transform: scale(1);
  pointer-events: auto; /* Prevent clicks on the page while fog is visible */
}

/* ------------------- HEADER ------------------- */
.header {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;

  img {
    width: 300px;
    margin-top: 20px;
  }
}

.menu-btn {
  background: none;
  border: none;
  cursor: pointer;
  position: absolute;
  top: 0;
  right: 0;
  -webkit-tap-highlight-color: transparent;
  outline: none;
  transition: transform 0.1s ease;

  .menu-icon {
    display: none;
  }
}

/* ------------------- SIDEPANEL ------------------- */
.sidepanel {
  position: fixed;
  top: 0;
  right: 0;
  width: 300px;
  height: 100vh;
  background-color: var(--backgroundColorDark);
  box-shadow: -2px 0 5px rgba(0, 0, 0, 0.5);
  overflow: hidden;
  z-index: 10000;
  display: flex;
  flex-direction: column;

  transform: translateX(100%);
  transition: transform 0.4s cubic-bezier(0.25, 1, 0.5, 1);

  .sidepanel-header {
    position: relative;
    padding: 0;
    text-align: center;
    cursor: pointer;
    overflow: hidden;
    -webkit-tap-highlight-color: transparent;
    outline: none;

    .sidebar-banner {
      width: 100%;
      height: 100%;
      object-fit: cover;
      display: block;
    }

    .close-button {
      position: absolute;
      height: 50px;
      width: 50px;
      top: 10px;
      right: 10px;
      background: none;
      border: none;
      color: var(--fontColor);
      font-size: 24px;
      cursor: pointer;
      -webkit-tap-highlight-color: transparent;
      outline: none;
    }
  }

  .nav-container {
    margin-top: -40px;
    position: relative;
    z-index: 10;
    background-color: transparent;
  }

  .nav-item {
    border: none;
    display: flex;
    gap: 5px;
    align-items: center;
    justify-content: flex-start;
    cursor: pointer;
    width: 100%;
    height: 60px;
    text-decoration: none;
    padding: 0 10px;

    img {
      width: 10%;
      margin-right: 10px;
      border-radius: 5px;
    }

    &:hover {
      background-color: color-mix(
        in srgb,
        var(--backgroundColorPink),
        transparent 50%
      );
    }

    &.disabled {
      opacity: 0.5;
      pointer-events: none;
    }
  }
}

.sidepanel.is-open {
  transform: translateX(0);
}

/* ------------------- BODY & LAYOUT ------------------- */
body {
  margin: 0;
  padding: 0;
  height: 100vh;

  background: linear-gradient(
    to top,
    var(--backgroundColorPink),
    var(--backgroundColorDark)
  );
  background-attachment: fixed;
  color: white;
  overflow-x: hidden;

  /* ------------------- IMAGE GALLERY ------------------- */
  .image-gallery {
    align-items: center;
    justify-content: center;
    display: flex;
    flex-direction: row;
  }

  .image-container {
    z-index: 2;
    box-shadow: 10px -10px 0 0 var(--imageShadowColor);
    border: 1px solid #fff;
    min-width: 250px;
    max-width: 250px;
    min-height: 280px;
    max-height: 280px;
    margin: 50px;
    display: flex;
    flex-direction: column;

    &.dark {
      background-color: var(--backgroundColorDark);
    }

    &.light {
      background-color: var(--backgroundColorLight);
    }
  }

  .window-bar {
    background-color: var(--backgroundColor);
    height: 30px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 10px;
    color: var(--fontColor);
    font-family: sans-serif;
    font-size: 14px;
  }

  .window-controls {
    display: flex;
    gap: 10px;
  }

  .control {
    cursor: pointer;
    font-size: 12px;
  }

  .image-content {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden; /* Prevent image from overflowing */
  }

  .image-content img {
    max-width: 100%;
    max-height: 100%;
    object-fit: cover; /* or contain, depending on preference */
    display: block;
  }

  /* ------------------- FOOTER ------------------- */
  footer {
    img {
      z-index: 1;
      position: fixed;
      bottom: 0;
      height: 600px;
    }

    .footer-spacer {
      z-index: 0;
      background-color: var(--footerColor);
      display: block;
      height: 60px;
      width: 100%;
      position: fixed;
      bottom: 0;
      border-top: 2px solid rgb(19, 19, 19);
    }
  }
}

/* ------------------- MEDIA QUERIES ------------------- */
@media (max-width: 768px) {
  body {
    height: auto;
    min-height: 100vh;
  }

  body .image-gallery {
    flex-direction: column;
    padding-bottom: 300px;
  }

  body .image-container {
    margin: 20px 0;
  }

  .header h2 {
    font-size: 28px;
  }

  .menu-btn {
    position: fixed;
    top: auto;
    bottom: 30px;
    right: 30px;
    z-index: 10001;
  }

  .menu-btn h2 {
    display: none;
  }

  .menu-btn .menu-icon {
    display: block;
    width: 90px;
    margin: 0;
  }

  .menu-btn:active {
    transform: scale(1.1);
  }

  .sidepanel {
    width: 100%;
  }

  .nav-container {
    margin-top: -50px;
  }

  body footer img {
    height: 300px;
    left: 50%;
    transform: translateX(-50%);
  }
}

/* ------------------- STATUS INDICATOR ------------------- */
.sidepanel .status-item {
  cursor: default;
  margin-top: auto; /* Push to bottom */
  margin-bottom: 20px;
  background: rgba(0, 0, 0, 0.2);
  pointer-events: none; /* Make unclickable */
}

.sidepanel .status-item:hover {
  transform: none;
  background: rgba(0, 0, 0, 0.2);
}

.status-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background-color: #ccc; /* Default gray */
  margin-right: 10px;
  box-shadow: 0 0 5px rgba(0, 0, 0, 0.5);
  transition: background-color 0.3s ease, box-shadow 0.3s ease;
}

.status-dot.up {
  background-color: #4caf50; /* Green */
  box-shadow: 0 0 8px #4caf50;
}

.status-dot.down {
  background-color: #f44336; /* Red */
  box-shadow: 0 0 8px #f44336;
}
