body {
  margin: 0;
  overflow: hidden; /* to prevent scrollbars */
  background: rgb(11, 118, 195); /* background for loader */
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 100vh;
}

.start{
  position:relative;
  top:56px;
  width:max-content; 
  right:50px;
  color:white;
  font-family:sans-serif;
  font-weight:100;
  font-size:large;
}

/* loader animation*/
.loader {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translateX(-50%) translateY(-50%);
  width: 50px;
  height: 50px; 
  margin: auto;
  opacity: 1;
  transition: opacity 1s ease-out; /* for fade-out effect */
}

.loader.fade-out {
    opacity: 0;
}

.loader.hidden {
    display: none;
}

.loader .circle {
  position: absolute;
  width: 38px;
  height: 38px;
  opacity: 0;
  transform: rotate(225deg);
  animation-iteration-count: infinite;
  animation-name: orbit;
  animation-duration: 5.5s;
}
.loader .circle:after {
  content: '';
  position: absolute;
  width: 6px;
  height: 6px;
  border-radius: 5px;
  background: #fff;
  box-shadow: 0 0 9px rgba(255, 255, 255, .3);
}
.loader .circle:nth-child(2) {
  animation-delay: 240ms;
}
.loader .circle:nth-child(3) {
  animation-delay: 480ms;
}
.loader .circle:nth-child(4) {
  animation-delay: 720ms;
}
.loader .circle:nth-child(5) {
  animation-delay: 960ms;
}
.loader .circle:nth-child(6) {
  animation-delay: 1200ms;
}
.loader .circle:nth-child(7) {
  animation-delay: 1440ms;
}
.loader .bg {
  position: absolute;
  width: 70px;
  height: 70px;
  margin-left: -16px;
  margin-top: -16px;
  border-radius: 13px;
  background-color: inherit;
  animation: bgg 16087ms ease-in alternate infinite;
}

/* keyframes */
@keyframes orbit {
  0% {
    transform: rotate(225deg);
    opacity: 1;
    animation-timing-function: ease-out;
  }
  7% {
    transform: rotate(345deg);
    animation-timing-function: linear;
  }
  30% {
    transform: rotate(455deg);
    animation-timing-function: ease-in-out;
  }
  39% {
    transform: rotate(690deg);
    animation-timing-function: linear;
  }
  70% {
    transform: rotate(815deg);
    opacity: 1;
    animation-timing-function: ease-out;
  }
  75% {
    transform: rotate(945deg);
    animation-timing-function: ease-out;
  }
  76% {
    transform: rotate(945deg);
    opacity: 0;
  }
  100% {
    transform: rotate(945deg);
    opacity: 0;
  }
}

@keyframes bgg {
  from { transform: scale(1); opacity: 1; }
  to { transform: scale(1.2); opacity: 0.8; }
}

/* desktop styles */
.desktop {
    position: relative;
    width: 100vw;
    height: 100vh;
    background-color: #0078D4;
    background-image: url('./assets/desktop_img.png'); 
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    color: white;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    opacity: 1;
    transition: opacity 1s ease-in;
}

.desktop.hidden {
    display: none;
    opacity: 0;
}

/* desktop icons */
.desktop-icons-container {
    position: absolute;
    top: 20px;
    left: 20px;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 15px;
}

/* each icon group */
.desktop-icon {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 80px; /* fixed width for icon area */
    text-align: center;
    cursor: pointer;
    padding: 5px;
    border-radius: 5px;
    font-size: 0.8em;
    user-select: none; /* prevent text selection */
}

.desktop-icon:hover {
  background-color: rgba(255, 255, 255, 0.15);
}

/* icon image */
.desktop-icon img {
    width: 32px; /* standard icon size */
    height: 32px;
    margin-bottom: 5px;
}

/* icon label text */
.desktop-icon span {
  margin-left: 6px;
  line-height: 1.1;
}

/* taskbar */
.taskbar {
    display: none; /* start hidden */
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 48px;
    background-color: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    display: flex;
    align-items: center;
    padding: 0 5px;
    box-sizing: border-box;
    z-index: 200;
    opacity: 0;
    transition: opacity 0.5s ease; /* smooth fade-in */
}

.taskbar.show {
    display: flex; /* make visible */
    opacity: 1;    /* fade in */
}

.start-button {
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
    margin-right: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    height: 40px; /* slightly smaller than taskbar height */
    width: 40px;
    border-radius: 2px;
    transition: background-color 0.2s ease;
}

.start-button:hover {
  background-color: rgba(255, 255, 255, 0.1);
}

.start-button img {
  width: 24px;
  height: 24px;
}

.taskbar-apps {
  display: flex;
  gap: 5px;
  flex-grow: 1; /*takes up available space*/
}

.taskbar-icon {
  background: none;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  height: 40px;
  width: 40px;
  border-radius: 2px;
  transition: background-color 0.2s ease;
}

.taskbar-icon:hover {
  background-color: rgba(255, 255, 255, 0.1);
}

.taskbar-icon img {
  width: 24px;
  height: 24px;
}

.system-tray {
  display: flex;
  align-items: center;
  padding: 0 10px;
  font-size: 0.9em;
  gap: 10px;
}

/* Match time display to desktop icon text */
#currentTime {
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  font-size: 12px;
  color: white;                           /* same as icon labels */
  text-shadow: 1px 1px 2px rgba(0,0,0,0.5); /* subtle shadow for contrast */
  letter-spacing: 0.5px;
}

/* Graph Popups */
.graph-container {
  position: absolute;
  width: 300px;
  background-color: rgba(0, 0, 0, 0.85);
  border: 1px solid #ccc;
  border-radius: 8px;
  box-shadow: 0 0 20px rgba(0,0,0,0.5);
  display: flex;
  flex-direction: column;
  z-index: 100;
  backdrop-filter: blur(10px);
}

.graph-container.hidden {
  display: none;
}

.graph-header {
  background-color: rgba(40, 40, 40, 0.9);
  color: white;
  padding: 8px 12px;
  cursor: move;
  font-family: "Segoe UI", sans-serif;
  font-size: 0.9rem;
  border-top-left-radius: 8px;
  border-top-right-radius: 8px;
  user-select: none;
}

.graph-content {
  padding: 15px;
  display: flex;
  justify-content: center;
  align-items: center;
}

.graph-content img {
  width: 100%;
  border-radius: 8px;
  box-shadow: 0 0 10px rgba(255,255,255,0.2);
  transition: transform 0.2s ease;
}

/* Responsive */
@media (max-width: 768px) {
  .desktop-icons-container {
        padding: 5px;
        align-items: center; /* center icons on smaller screens */
        flex-direction: row; /* arrange icons in a row */
        flex-wrap: wrap; /* allow icons to wrap */
        justify-content: center;
    }

  .desktop-icon {
    width: 60px;
    font-size: 0.7em;
  }

  .desktop-icon img {
    width: 28px;
    height: 28px;
  }

  .taskbar {
    height: 40px;
    padding: 0 2px;
  }

  .start-button, .taskbar-icon {
    height: 36px;
    width: 36px;
  }

  .start-button img, .taskbar-icon img {
    width: 20px;
    height: 20px;
  }

  .system-tray {
    font-size: 0.8em;
    padding: 0 5px;
  }
}

@media (max-width: 480px) {
  .desktop-icons-container {
    gap: 10px;
  }

  .desktop-icon {
    width: 50px;
    font-size: 0.65em;
  }

  .desktop-icon img {
    width: 24px;
    height: 24px;
  }

  .taskbar {
    height: 36px;
  }

  .start-button, .taskbar-icon {
    height: 32px;
    width: 32px;
  }

  .start-button img, .taskbar-icon img {
    width: 18px;
    height: 18px;
  }

  .system-tray {
    font-size: 0.75em;
    padding: 0 3px;
    gap: 5px;
  }
}


/* photo app pop up styling */
.photos-popup {
  position: absolute;
  top: 120px;
  left: 150px;
  width: 700px;
  height: 500px;
  background: #f9f9f9;
  border: 2px solid #c8c8c8;
  border-radius: 10px;
  box-shadow: 0 4px 15px rgba(0,0,0,0.2);
  display: flex;
  flex-direction: column;
  font-family: 'Segoe UI', sans-serif;
  z-index: 20;
}

.hidden {
  display: none;
}

/* header */
.photos-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: #ececec;
  padding: 8px 12px;
  border-bottom: 1px solid #d0d0d0;
  border-radius: 10px 10px 0 0;
  cursor: move;
}

.photos-title {
  font-weight: bold;
  color: #333;
}

.photos-window-controls {
  display: flex;
  gap: 6px;
}

.window-btn {
  border: none;
  background: transparent;
  cursor: pointer;
  font-size: 16px;
  color: #555;
}

.window-btn:hover {
  color: #000;
}

/* tabs */
.photos-tabs {
  display: flex;
  border-bottom: 1px solid #d0d0d0;
}

.tab-btn {
  flex: 1;
  padding: 8px 0;
  background: transparent;
  border: none;
  cursor: pointer;
  color: #555;
  font-weight: 500;
}

.tab-btn.active {
  background: #fff;
  border-bottom: 2px solid #0078d7;
  color: #0078d7;
}

/* toolbar */
.photos-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 12px;
  background: #f4f4f4;
  border-bottom: 1px solid #d0d0d0;
}

.view-label {
  margin-right: 6px;
  font-size: 14px;
  color: #444;
}

.view-dropdown {
  padding: 4px;
  border: 1px solid #ccc;
  border-radius: 4px;
}

.toolbar-btn {
  margin-left: 8px;
  background: #fff;
  border: 1px solid #ccc;
  border-radius: 4px;
  padding: 5px 8px;
  cursor: pointer;
  font-size: 14px;
}

.toolbar-btn:hover {
  background: #e6e6e6;
}

/* gallery */
.photos-gallery {
  flex: 1;
  padding: 10px;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 10px;
  overflow-y: auto;
}

.photos-gallery img {
  width: 100%;
  height: 100px;
  object-fit: cover;
  border-radius: 6px;
  transition: transform 0.2s;
}

.photos-gallery img:hover {
  transform: scale(1.03);
}

/* substack popup */
.substack-popup {
  position: absolute;
  top: 80px;
  left: 120px;
  width: 700px;
  max-width: 90%;
  background: #fff;
  color: #222;
  border-radius: 12px;
  box-shadow: 0 0 25px rgba(0, 0, 0, 0.25);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  font-family: "Georgia", serif;
  z-index: 500;
}

.substack-popup.hidden {
  display: none;
}

.substack-header {
  background: #fafafa;
  border-bottom: 1px solid #ddd;
  padding: 10px 15px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-family: "Segoe UI", sans-serif;
  font-weight: 600;
  color: #444;
  cursor: move;
}

.substack-content {
  padding: 30px 40px;
  overflow-y: auto;
  max-height: 80vh;
  line-height: 1.7;
}

.substack-tag {
  font-size: 0.75rem;
  color: #555;
  letter-spacing: 0.05em;
  margin-bottom: 8px;
}

.substack-title {
  font-size: 1.8rem;
  font-weight: 700;
  margin: 0;
  color: #111;
}

.substack-subtitle {
  font-size: 1.1rem;
  color: #555;
  font-weight: 400;
  margin-bottom: 15px;
}

.substack-author {
  font-size: 0.85rem;
  color: #777;
  margin-bottom: 20px;
}

.substack-content a {
  color: #000;
  font-weight: 600;
  text-decoration: underline;
}

.substack-content hr {
  border: none;
  border-top: 1px solid #eee;
  margin: 20px 0;
}

.substack-content strong {
  font-weight: 600;
}

.substack-content em {
  font-style: italic;
}

.close-btn {
  background: none;
  border: none;
  font-size: 1.2rem;
  cursor: pointer;
  color: #333;
}

.placeholder {
  grid-column: 1 / -1;
  text-align: center;
  color: #777;
  margin-top: 20px;
  font-size: 1rem;
}