/* ========== WINDOWS 95 DESKTOP STYLE ========== */
@font-face {
  font-family: "Web437_ToshibaTxL1_8x16";
  src: url("./media/fonts/Web437_ToshibaTxL1_8x16.woff") format("woff");
  font-weight: 400;
  font-style: normal;
  font-display: swap; /* Shows fallback font while custom font loads */
}


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

body {
  font-family: "DejaVu Sans Mono", "Liberation Mono", "Consolas", "Courier New", monospace;
  overflow: hidden;
  width: 100vw;
  height: 100vh;
}

/* Desktop background */
#desktop {
  width: 100%;
  height: 100vh; /* Full height (taskbar hidden) */
  background: #000000; /* Classic teal background */
  background-image: url('./media/images/backgrounds/tree.png');
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  position: relative;
  overflow: hidden;
}

/* Desktop Icon */
.desktop-icon {
  position: absolute;
  top: 20px;
  left: 20px;
  width: 80px;
  display: flex;
  flex-direction: column;
  align-items: center;
  cursor: grab;
  padding: 8px;
  user-select: none;
  background: transparent;
}

.desktop-icon:active {
  cursor: grabbing;
}

.desktop-icon.selected {
  background: rgba(0, 0, 128, 0.3);
  outline: 1px dotted white;
}

.icon-image {
  width: 100%;
  height: 48px;
  margin-bottom: 4px;
  /* Placeholder for folder icon - using emoji as fallback */
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 32px;
}

.desktop-icon img {
  pointer-events: none;
  user-select: none;
  -webkit-user-drag: none;
  -moz-user-drag: none;
  -ms-user-drag: none;
}

.icon-image::before {
  content: '📁';
}

.icon-label {
  color: white;
  font-size: 11px;
  text-align: center;
  text-shadow: 1px 1px 2px black;
  word-wrap: break-word;
  max-width: 70px;
}

/* Taskbar */
.taskbar {
  position: fixed;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 40px;
  background: #c0c0c0;
  border-top: 2px solid white;
  display: none;                      /* Hide taskbar */
  align-items: center;
  justify-content: space-between;
  padding: 2px;
  box-shadow: inset 0 2px 0 white, inset 0 -2px 0 #808080;
}

.start-button {
  height: 32px;
  padding: 2px 8px;
  background: #ffffff;
  border: 2px outset #ffffff;
  font-weight: bold;
  font-size: 14px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 4px;
}

.start-button:active {
  border-style: inset;
  padding: 3px 7px 1px 9px;
}

.start-logo {
  width: 20px;
  height: 20px;
  /* Windows logo placeholder */
  background: linear-gradient(45deg, #ff0000 25%, #00ff00 25%, #00ff00 50%, #0000ff 50%, #0000ff 75%, #ffff00 75%);
}

.start-logo::before {
  content: '⊞';
  font-size: 20px;
  color: black;
}

.taskbar-time {
  height: 32px;
  padding: 0 8px;
  background: #ffffff;
  border: 2px inset hsl(0, 0%, 100%);
  display: flex;
  align-items: center;
  font-size: 12px;
  margin-right: 4px;
  min-width: 60px;
  justify-content: center;
}

/* Window */
.window {
  position: fixed;
  top: 5vh;
  left: 5vw;
  transform: none;
  width: 90vw;
  height: 90vh;
  background: #ffffff;
  border: 2px solid #ffffff;
  box-shadow: 6px 6px 0px rgba(255, 255, 255, 1);
  display: flex;
  flex-direction: column;
  z-index: 1000;
}

.window.hidden {
  display: none;
}

/* Title Bar */
.title-bar {
  background: #000000;
  color: white;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 2px 4px 2px 8px;
  font-size: 12px;
  font-weight: bold;
  user-select: none;
  cursor: default;
  border-bottom: 1px solid #ffffff;
}

.title-text {
  flex-grow: 1;
}

.title-buttons {
  display: flex;
  gap: 2px;
}

.title-button {
  width: 18px;
  height: 18px;
  background: #000000;
  border: 1px solid #ffffff;
  color: #ffffff;
  font-size: 12px;
  line-height: 1;
  cursor: pointer;
  font-weight: bold;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background-color 0.2s, color 0.2s;
}

.title-button:hover {
  background: #ffffff;
  color: #000000;
}

.title-button:active {
  border-style: inset;
}

.title-button.close {
  font-size: 16px;
}

/* Window Content */
.window-content {
  flex-grow: 1;
  background: white;
  overflow: hidden;
}

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

/* Resize Handles */
.resize-handle {
  position: absolute;
  background: transparent;
  z-index: 10;
}

.resize-right {
  right: 0;
  top: 0;
  width: 6px;
  height: 100%;
  cursor: ew-resize;
}

.resize-bottom {
  bottom: 0;
  left: 0;
  width: 100%;
  height: 6px;
  cursor: ns-resize;
}

.resize-corner {
  right: 0;
  bottom: 0;
  width: 12px;
  height: 12px;
  cursor: nwse-resize;
  background: #c0c0c0;
  border-left: 2px solid #808080;
  border-top: 2px solid #808080;
}

/* ========== RESPONSIVE ========== */
@media (max-width: 768px) {
  .window {
    width: 95vw;
    height: 85vh;
  }
  
  .desktop-icon {
    width: 70px;
  }
  
  .icon-image {
    width: 40px;
    height: 40px;
  }
}

/* ========== MUSIC PLAYER STYLES ========== */
#music-window {
  width: 700px;
  height: 500px;
}

#files-window {
  width: 800px;  /* Change this to adjust About window width */
  height: 600px; /* Change this to adjust About window height */
}

.music-content {
  padding: 0;
  background: #000000;
}

.music-layout {
  display: flex;
  height: 100%;
  width: 100%;
}

.music-list {
  width: 200px;
  background: rgb(0, 0, 0);
  color: white;
  overflow-y: auto;
  flex-shrink: 0;
  border-right: 1px solid #ffffff;
}

.list-header {
  background: #ffffff;
  color: rgb(0, 0, 0);
  padding: 8px;
  font-weight: bold;
  font-size: 12px;
}

.audio-item {
  padding: 8px 12px;
  cursor: pointer;
  font-size: 11px;
  user-select: none;
}

.audio-item:hover {
  background: #ffffff;
  color: #000000;
}

.audio-item.active {
  background: #ffffff;
  color: rgb(0, 0, 0);
}

.music-player-container {
  flex-grow: 1;
  display: flex;
  flex-direction: column;
  background: #000000;
  min-height: 0;
}

.audio-description-box {
  margin-top: 8px;
  padding: 10px;
  background: #000000;
  border-top: 1px solid #ffffff;
  flex-shrink: 0;
  min-height: 80px;
}

.player-placeholder {
  flex-grow: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  color: #000000;
  font-size: 14px;
}

.music-player {
  flex-grow: 1;
  width: 100%;
  max-width: 600px;
  background: rgb(0, 0, 0);
  padding: 20px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-height: 0;
}

.now-playing {
  font-size: 12px;
  font-weight: bold;
  margin-bottom: 15px;
  color: #ffffff;
  flex-shrink: 0;
}

.timeline-container {
  width: 100%;
  margin-bottom: 20px;
  flex-grow: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.time-display {
  display: flex;
  justify-content: space-between;
  font-size: 11px;
  color: #ffffff;
  margin-bottom: 8px;
  font-family: monospace;
  flex-shrink: 0;
}

.waveform-wrapper {
  display: flex;
  align-items: stretch;
  gap: 15px;
  flex-grow: 1;
  min-height: 200px;
}

.waveform-container {
  flex: 1;
  background: rgb(0, 0, 0);
  position: relative;
  cursor: pointer;
  user-select: none;
  overflow: hidden;
}

#waveform-canvas {
  width: 100%;
  height: 100%;
  display: block;
}

.playhead {
  position: absolute;
  top: 0;
  left: 0%;
  width: 2px;
  height: 100%;
  background: #ff0000;
  pointer-events: none;
  z-index: 10;
  box-shadow: 0 0 3px rgba(255, 0, 0, 0.5);
}

.volume-control-vertical {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100px;
}

.volume-slider-vertical {
  -webkit-appearance: slider-vertical;
  appearance: slider-vertical;
  width: 4px;
  height: 100px;
  background: #ffffff;
  outline: none;
  cursor: pointer;
  writing-mode: bt-lr; /* IE */
  -webkit-appearance: slider-vertical; /* Webkit */
}

.volume-slider-vertical::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 12px;
  height: 12px;
  background: #ffffff;
  cursor: pointer;
  border: 1px solid #808080;
}

.volume-slider-vertical::-moz-range-thumb {
  width: 12px;
  height: 12px;
  background: #ffffff;
  cursor: pointer;
  border: 1px solid #808080;
  border-radius: 0;
}

.player-controls {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 20px;
  margin-top: 15px;
  flex-shrink: 0;
}

.control-button {
  width: 50px;
  height: 50px;
  border: 1px solid #ffffff;
  color: white;
  background-color: black;
  font-size: 20px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  user-select: none;
  transition: none;
}

.control-button:hover {
  background: #151515;
}

.control-button:active {
  border-style: inset;
  padding-top: 2px;
  padding-left: 2px;
}

.music-player audio {
  width: 100%;
  margin-top: 10px;
}

.music-player.hidden {
  display: none;
}

.player-placeholder.hidden {
  display: none;
}

/* ========== VIDEO PLAYER STYLES ========== */
#video-window {
  width: 700px;
  height: 500px;
}

.video-layout {
  display: flex;
  height: 100%;
  width: 100%;
  flex-direction: column;
}

.video-layout {
  flex-direction: row;
}

.video-list {
  width: 200px;
  background: rgb(0, 0, 0);
  color: white;
  overflow-y: auto;
  flex-shrink: 0;
  border-right: 1px solid #ffffff;
  display: flex;
  flex-direction: column;
}

.video-item {
  padding: 8px 12px;
  cursor: pointer;
  font-size: 11px;
  user-select: none;
  display: flex;
  align-items: center;
  gap: 8px;
}

.video-item:hover {
  background: #ffffff;
  color: #000000;
}

.video-item.active {
  background: #ffffff;
  color: rgb(0, 0, 0);
}

.video-number {
  font-weight: bold;
  min-width: 20px;
}

.video-title {
  flex: 1;
}

.video-player-container {
  flex-grow: 1;
  display: flex;
  flex-direction: column;
  background: #000000;
  min-height: 0;
}

#video-player {
  flex-grow: 1;
  flex-shrink: 1;
  width: 100%;
  min-height: 0;
  object-fit: contain;
}

.video-controls {
  padding: 10px;
  background: #000000;
  border-bottom: 1px solid #ffffff;
  display: flex;
  align-items: center;
  color: #ffffff;
  font-size: 12px;
  flex-shrink: 0;
}

.video-controls button {
  background: #000000;
  border: 1px solid #ffffff;
  color: #ffffff;
  padding: 5px 10px;
  cursor: pointer;
  font-family: inherit;
}

.video-controls button:hover {
  background: #ffffff;
  color: #000000;
}

.video-description-box {
  padding: 10px;
  background: #000000;
  border-top: 1px solid #ffffff;
  flex-shrink: 0;
  min-height: 60px;
  max-height: 120px;
  overflow-y: auto;
}

/* ========== PHOTO VIEWER STYLES ========== */
#photo-window {
  width: 700px;
  height: 500px;
}

.photo-layout {
  display: flex;
  height: 100%;
  width: 100%;
}

.photo-list {
  width: 200px;
  background: rgb(0, 0, 0);
  color: white;
  overflow-y: auto;
  flex-shrink: 0;
  border-right: 1px solid #ffffff;
  display: flex;
  flex-direction: column;
}

.photo-item {
  padding: 8px 12px;
  cursor: pointer;
  font-size: 11px;
  user-select: none;
  display: flex;
  align-items: center;
  gap: 8px;
}

.photo-item:hover {
  background: #ffffff;
  color: #000000;
}

.photo-item.active {
  background: #ffffff;
  color: rgb(0, 0, 0);
}

.photo-number {
  font-weight: bold;
  min-width: 20px;
}

.photo-title {
  flex: 1;
}

.photo-viewer-container {
  flex-grow: 1;
  display: flex;
  flex-direction: column;
  background: #000000;
  min-height: 0;
}

#photo-viewer {
  flex-grow: 1;
  height: auto !important;
  min-height: 350px;
}

.photo-description-box {
  margin-top: 8px;
  padding: 10px;
  background: #000000;
  border-top: 1px solid #ffffff;
  flex-shrink: 0;
  min-height: 80px;
}

/* Photo carousel navigation buttons */
#photo-prev:hover,
#photo-next:hover {
  background: #ffffff;
  color: #000000;
}

#photo-prev:active,
#photo-next:active {
  transform: scale(0.95);
}

/* Loading Indicator */
.loading-indicator {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: #ffffff;
    font-size: 14px;
    background: rgba(0, 0, 0, 0.8);
    padding: 10px 20px;
    border: 1px solid #ffffff;
    z-index: 100;
    pointer-events: none;
}

.loading-indicator::after {
    content: '';
    animation: loading-dots 1.5s steps(4, end) infinite;
}

@keyframes loading-dots {
    0%, 25% { content: ''; }
    26%, 50% { content: '.'; }
    51%, 75% { content: '..'; }
    76%, 100% { content: '...'; }
}

