/*
  Ryan Louden Portfolio Website - style.css
  Built by Ryan Louden, © 2025

  Portions of this project incorporate code or design patterns from:
  - https://github.com/cyrixninja/Windows-98-Javascript
  - https://github.com/jdan/98.css
  Used under their respective licenses.
*/

/* reset / base */
* {
  padding: 0;
  margin: 0;
  box-sizing: border-box;
  font-family: helvetica;
}

/* JQuery ui icon removal */ 
.ui-icon {
  background-image: url("") !important;
}

/* ---------- Desktop Background ---------- */
.desktop {
  height: 100vh;
  width: 100vw;
  background-color: #007d7b;
  background-image: url('');
  background-size: contain;
  background-repeat: no-repeat;
  background-position: center;
  overflow: hidden;
  position: fixed;
  z-index: -999;
}

/* desktop icons layout */
.desktop-icons {
  position: fixed;
  top: 0;
  left: 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(90px, 1fr));
  grid-auto-rows: 90px;
  justify-items: center;
  align-items: start;
  gap: 25px 20px; /* row gap / column gap */
  padding: 30px;
  width: 100%;
  height: calc(100vh - 38px); /* leave space for the taskbar */
  box-sizing: border-box;
  z-index: 0; /* ✅ below windows, above wallpaper */
}

.desktop-icon {
  width: 90px;
  text-align: center;
  color: white;
  text-shadow: 1px 1px 2px #000;
  cursor: default;
  user-select: none;
  border-radius: 4px;
  padding: 6px;
  transition: background 0.15s, transform 0.1s;
}

.desktop-icon img {
  width: 36px;
  height: 36px;
  margin-bottom: 4px;
}

.desktop-icon span {
  display: block;
  font-size: clamp(14px, 1.6vw, 17px); /* ✅ larger, still mobile-adaptive */
  font-weight: 500;
  line-height: 1.2;
  word-wrap: break-word;
}

/* selected look */
.desktop-icon.selected {
  background: rgba(0, 0, 128, 0.4);
  border: 1px solid #ffffff80;
}

/* tap/press feedback */
.desktop-icon:active {
  transform: scale(0.96);
  filter: brightness(0.9);
}

/* optional hover effect (desktop only) */
@media (hover: hover) {
  .desktop-icon:hover {
    background: rgba(255, 255, 255, 0.15);
    border: 1px solid rgba(255, 255, 255, 0.25);
  }
}

/* ---------- Start Menu ---------- */
.startbar {
  position: fixed;
  bottom: 0;
  left: 0;
  display: block;
  height: 38px;
  width: 100vw;
  background-color: #bdbebd;
  border-top: 2px solid white;
  padding: 3px;
  z-index: 9999;
  /* iPhone safe area */
  padding-bottom: env(safe-area-inset-bottom, 0);
}

#startbutton {
  float: left;
  text-decoration: none;
  color: black;
  width: 70px;
  height: 29px;
  text-align: right;
  font-family: sans-serif;
  padding: 4px;
  background-image: url("./ico/start.ico");
  background-size: auto 70%;
  background-position: 5% 50%;
  background-repeat: no-repeat;
}

.startbutton-off {
  border-top: 2px solid white;
  border-left: 2px solid white;
  border-right: 2px solid black;
  border-bottom: 2px solid black;
}

.startbutton-on {
  border-top: 2px solid black;
  border-left: 2px solid black;
  border-right: 2px solid white;
  border-bottom: 2px solid white;
}

.time {
  color: black;
  height: 29px;
  float: right;
  text-align: center;
  padding: 4px;
  border-top: 2px solid grey;
  border-left: 2px solid grey;
  border-bottom: 2px solid white;
  border-right: 2px solid white;
}

.program {
  float: left;
  color: black;
  display: block;
  margin-left: 5px;
  height: 29px;
  width: 200px;
  text-align: left;
  padding: 4px;
  padding-left: 30px;
  border-top: 2px solid white;
  border-left: 2px solid white;
  border-bottom: 2px solid black;
  border-right: 2px solid black;
  background-color: #BDBEBD;
  box-sizing: border-box;
  overflow: hidden;
  white-space: nowrap;
  background-size: auto 70%;
  background-position: 3px 50%;
  background-repeat: no-repeat;
}

.focused {
  border-top: 2px solid black;
  border-left: 2px solid black;
  border-bottom: 2px solid white;
  border-right: 2px solid white;
}

#menu {
  position: fixed;
  bottom: 38px;
  left: 3px;
  background-color: #bdbebd;
  z-index: 10000;
  border-left: 2px solid white;
  border-top: 2px solid white;
  border-right: 2px solid grey;
  border-bottom: 2px solid grey;
  display: none;
}

.sidebar {
  height: 100%;
  background: linear-gradient(to bottom, #000080, #1084d0);
  display: inline-block;
  width: 25px;
  bottom: 0;
  left: 0;
  position: absolute;
}

.headline {
  transform: rotate(-90deg);
  transform-origin: 0% 0%;
  width: 150%;
  padding-top: 4px;
  padding-bottom: 3px;
  padding-left: 0px;
  color: white;
  position: absolute;
  left: 0;
  bottom: 0;
  text-align: left;
  margin-bottom: -15px;
}

.item {
  color: black;
  padding-top: 12px;
  padding-bottom: 12px;
  padding-left: 40px;
  padding-right: 70px;
  font-size: 13px;
  margin-left: 25px;
  background-size: auto 80%;
  background-position: 5px 50%;
  background-repeat: no-repeat;
}

.item:hover {
  background-color: darkblue;
  color: white;
}

.more {
  position: relative;
  list-style: none;
}

.more::after {
  content: "►";
  left: 65px;
  position: relative;
  float: right;
}

.dropdown-content {
  display: none;
  position: absolute;
}

.more:hover .dropdown-content {
  display: block;
  top: -2px;
  left: 100%;
  background-color: #bdbebd;
  color: black;
  list-style: none;
  border-left: 2px solid white;
  border-top: 2px solid white;
  border-right: 2px solid grey;
  border-bottom: 2px solid grey;
  box-sizing: border-box;
  min-width: 100%;
}

.dropdown-item {
  padding-top: 6px;
  padding-bottom: 6px;
  padding-left: 40px;
  padding-right: 10px;
  font-size: 13px;
  background-size: auto 70%;
  background-position: 5% 50%;
  background-repeat: no-repeat;
  white-space: nowrap;
}

.dropdown-item:hover {
  color: white;
  background-color: darkblue;
}

.menu-break::after {
  content: "";
  border-top: 1px solid white;
  height: 1px;
  display: block;
}

/* ---------- Display Windows ---------- */
.window {
  background-color: #BDBEBD;
  border-left: 1px solid white;
  border-bottom: 1px solid black;
  border-top: 1px solid white;
  border-right: 1px solid black;
  box-shadow: 2px 2px 10px 0px rgba(0, 0, 0, 0.75);
  display: none;
}

.window-inner {
  border: 2px solid #BDBEBD;
  height: 100%;
}

.window-header {
  background: linear-gradient(to right, #000080, #1084d0);
  font-size: 15px;
  overflow: auto;
}

.window-header p {
  color: white;
  display: inline;
  position: absolute;
  vertical-align: middle;
  overflow: hidden;
  white-space: nowrap;
  width: calc(100% - 105px);
  padding-top: 3px;
  padding-left: 3px;
}

.window-header-icon {
  height: 20px;
  margin-left: 3px;
  margin-top: 3px;
  display: inline-block;
}

.window-icon {
  width: 20px;
  height: 20px;
  background-color: #BDBEBD;
  float: right;
  border-top: 1px solid white;
  border-left: 1px solid white;
  border-bottom: 1px solid black;
  border-right: 1px solid black;
  text-align: center;
  margin-top: 3px;
  margin-right: 3px;
  margin-bottom: 3px;
}

.close {
  background-image: url("./ico/close.ico");
  background-size: auto 100%;
  background-position: 50% 50%;
  background-repeat: no-repeat;
}

.maximise {
  background-image: url("./ico/maximise.ico");
  background-size: auto 100%;
  background-position: 50% 50%;
  background-repeat: no-repeat;
}

.minimise {
  background-image: url("./ico/minimise.ico");
  background-size: auto 100%;
  background-position: 50% 50%;
  background-repeat: no-repeat;
}

.window-content {
  margin-top: 2px;
  border: 2px solid #808080;
  border-bottom: 2px solid white;
  border-right: 2px solid white;
  height: calc(100% - 28px);
}

.window-content iframe {
  width: 100%;
  height: 100%;
  border: none;
  display: block;
}

.contact-panel {
  position: fixed;
  right: 16px;
  bottom: calc(38px + 12px + env(safe-area-inset-bottom, 0px));
  z-index: 0;
  pointer-events: auto;
}

.contact-panel-inner {
  background: radial-gradient(circle at top, rgba(0, 0, 0, 0.35), rgba(0, 0, 0, 0));
  padding: 12px 16px 10px;
  border-radius: 12px;
  color: #fff;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.6);
  font-family: "Segoe UI", Tahoma, Arial, sans-serif;
  backdrop-filter: blur(2px);
  font-size: clamp(12px, 1.4vw, 17px);
  line-height: 2em;
}

.cp-name {
  font-weight: 700;
  margin-bottom: 5px;
  font-size: 1.3em;
  text-align: center;
}

.cp-name img {
  display: block;
  margin: 0 auto 6px auto;
  width: 5em;
  height: 5em;
  opacity: 0.5;
}

.cp-line {
  margin: 3px 0;
  opacity: 0.95;
  white-space: nowrap;
  font-size: 1.1em;
}

.cp-line img {
  width: 1em;
  height: 1em;
  vertical-align: middle;
  margin-right: 6px;
  filter: brightness(0) invert(1);
  opacity: 0.9;
}

.cp-line a {
  color: inherit;
  text-decoration: none;
  opacity: 0.95;
  transition: opacity 0.2s ease;
}

.cp-line a:hover {
  opacity: 1;
  text-decoration: underline;
}

@media (max-width: 480px) {
  .contact-panel {
    right: 10px;
    bottom: calc(38px + 10px + env(safe-area-inset-bottom, 0px));
  }

  .contact-panel-inner {
    padding: 10px 12px 8px;
  }
}

/* ---------- MOBILE WINDOW TWEAKS ---------- */
@media (max-width: 900px) {
  .window.mobile-window .window-header {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 6px;
    height: 42px;
  }

  .window.mobile-window .window-header-icon {
    width: 20px;
    height: 20px;
    margin: 0 4px;
    flex: 0 0 auto;
  }

  .window.mobile-window .window-header p {
    position: static;
    flex: 1 1 auto;
    margin: 0;
    font-size: 14px;
    line-height: 1.2;
    width: auto;
  }

  .window.mobile-window .window-icon {
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 4px;
    float: none;
  }

  .window.mobile-window .window-icon + .window-icon {
    margin-left: 8px;
  }
}