/* Emoji support for title bars and buttons */
.title-bar-text,
.taskbar button {
  font-family: 'Tahoma', 'Arial', sans-serif;
  font-feature-settings: "liga" 0, "kern" 1;
  letter-spacing: 0;
  word-spacing: 0;
}

body {
  background-color: #2d2d2d;
  background-image: url('img/Metallic-Foam-final.jpg');
  background-repeat: no-repeat;
  background-position: center center;
  background-size: cover;
  height: 100vh;
  margin: 0;
  padding: 0;
  font-family: 'Tahoma', 'Arial', sans-serif;
  overflow: hidden;
  color: #f8f8f2;
  /* Prevent zoom on double tap for mobile */
  touch-action: manipulation;
  /* Prevent text selection during drag */
  user-select: none;
  -webkit-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
}

#top-banner {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
}

.taskbar {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: 30px;
  background: #2d2d2d;
  border-top: 2px solid #75715e;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 2px 4px;
  gap: 4px;
  z-index: 1000;
}

.taskbar-left {
  display: flex;
  align-items: center;
  gap: 4px;
}

.taskbar-clock {
  background: #3c3c3c;
  border: 1px outset #75715e;
  padding: 1px 4px;
  font-family: 'Tahoma', sans-serif;
  font-size: 11px;
  font-weight: normal;
  color: #f8f8f2;
  min-width: 60px;
  text-align: center;
  margin-left: auto;
  height: 22px;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1.2;
}

.taskbar button {
  font-size: 12px;
  padding: 2px 6px;
  background: #2a2a2a;
  border-top: 1px outset #4a4a4a;
  border-left: 1px outset #4a4a4a;
  border-bottom: 1px inset #1a1a1a;
  border-right: 1px inset #1a1a1a;
  cursor: pointer;
  color: #f8f8f2;
  /* Better touch targets for mobile */
  min-height: 24px;
  min-width: 60px;
  /* Prevent text selection */
  user-select: none;
  -webkit-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
  /* Better line height for text alignment */
  line-height: 1.2;
}

.taskbar button:hover {
  background: #3a3a3a;
}

.taskbar button:active {
  border-top: 1px inset #1a1a1a;
  border-left: 1px inset #1a1a1a;
  border-bottom: 1px outset #4a4a4a;
  border-right: 1px outset #4a4a4a;
  background: #1a1a1a;
}

/* Taskbar button styling */
#taskbar .taskbar-btn,
.taskbar .taskbar-btn,
button.taskbar-btn {
  font-size: 12px !important;
  padding: 2px 6px !important;
  background: #2a2a2a !important;
  border: none !important;
  border-top: 1px solid #4a4a4a !important;
  border-left: 1px solid #4a4a4a !important;
  border-bottom: 1px solid #1a1a1a !important;
  border-right: 1px solid #1a1a1a !important;
  cursor: pointer !important;
  color: #f8f8f2 !important;
  /* Better touch targets for mobile */
  min-height: 24px !important;
  min-width: 60px !important;
  /* Prevent text selection */
  user-select: none !important;
  -webkit-user-select: none !important;
  -moz-user-select: none !important;
  -ms-user-select: none !important;
  /* Better line height for text alignment */
  line-height: 1.2 !important;
  font-family: 'Tahoma', 'Arial', sans-serif !important;
  font-feature-settings: "liga" 0, "kern" 1 !important;
  letter-spacing: 0 !important;
  word-spacing: 0 !important;
  box-shadow: none !important;
  text-shadow: none !important;
  white-space: nowrap !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
}

#taskbar .taskbar-btn:hover,
.taskbar .taskbar-btn:hover,
button.taskbar-btn:hover {
  background: #3a3a3a !important;
}

#taskbar .taskbar-btn:active,
.taskbar .taskbar-btn:active,
button.taskbar-btn:active {
  border-top: 1px solid #1a1a1a !important;
  border-left: 1px solid #1a1a1a !important;
  border-bottom: 1px solid #4a4a4a !important;
  border-right: 1px solid #4a4a4a !important;
  background: #1a1a1a !important;
}

.window {
  background: #3c3c3c;
  border: 2px outset #75715e;
  width: 300px;
  position: absolute;
  top: 60px;
  left: 60px;
  z-index: 1000;
  box-shadow: 4px 4px 16px rgba(0, 0, 0, 0.9), 0 0 4px rgba(0, 0, 0, 0.6);
  resize: both;
  cursor: default;
  overflow: hidden;
  min-width: 200px;
  min-height: 100px;
  box-sizing: border-box;
  /* Better mobile handling */
  touch-action: none;
  /* Prevent text selection during drag */
  user-select: none;
  /* Remove default resize for custom handles */
  resize: none;
  -webkit-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
}

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

.resize-se {
  bottom: 0;
  right: 0;
  width: 20px;
  height: 20px;
  cursor: se-resize;
  background: transparent;
  border: none;
  padding: 1px;
  z-index: 1001; /* Ensure it's above content */
}

.resize-se:hover {
  background: rgba(117, 113, 94, 0.2);
}

.resize-se::after {
  content: '';
  position: absolute;
  bottom: 2px;
  right: 2px;
  width: 0;
  height: 0;
  border-left: 6px solid transparent;
  border-bottom: 6px solid rgba(117, 113, 94, 0.3);
  pointer-events: none;
}

@media (max-width: 768px) {
  .resize-se {
    width: 30px;
    height: 30px;
  }
}

/* Title bar styling */
.title-bar {
  background: #4a4a4a !important;
  color: #f8f8f2 !important;
  border-bottom: 1px solid #75715e !important;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 2px 4px;
}

.title-bar-controls {
  display: flex;
  align-items: center;
  gap: 2px;
}

.title-bar-controls button {
  min-width: 20px;
  min-height: 20px;
  padding: 2px;
  border: 1px outset #c0c0c0;
  background: #c0c0c0;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
}

.title-bar-controls button:active {
  border: 1px inset #c0c0c0;
  background: #a0a0a0;
}

.title-bar-text {
  color: #f8f8f2 !important;
  font-weight: bold;
  letter-spacing: 0;
  word-spacing: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.window .window-body {
  height: calc(100% - 28px); /* Title bar height */
  overflow: hidden;
  display: flex;
  flex-direction: column;
  padding-bottom: 0; /* Remove bottom padding to prevent overlap with resize handle */
  box-sizing: border-box;
}


.window-body iframe {
  width: 100%;
  height: 100%;
  border: none;
  padding: 10px;
}


iframe {
  border: none;
}

.hidden {
  display: none;
}

#now-playing-window {
  font-family: 'Courier New', monospace;
  background: #111;
  color: #0f0;
  border: 2px outset #75715e;
  box-shadow: 4px 4px 16px rgba(0, 0, 0, 0.9), 0 0 4px rgba(0, 0, 0, 0.6);
}

#now-playing-window .title-bar {
  background: #004400;
  color: #afa;
  border-bottom: 2px solid #0f0;
}

#now-playing-window .title-bar-text {
  font-weight: bold;
}

#now-playing-window .window-body {
  background: #002200;
  padding: 10px;
  box-sizing: border-box;
}

#progress-container {
  width: 100%;
  background: #333;
  height: 8px;
  border-radius: 4px;
  overflow: hidden;
  margin-top: 10px;
}

#progress-bar {
  width: 100%;
  height: 8px;
  background: #333;
  border: 1px solid #0f0;
  border-radius: 4px;
  box-sizing: border-box;
  overflow: hidden;
}

#progress-fill {
  height: 100%;
  background: #00ffcc;
  width: 0%;
  transition: width 0.3s ease;
}

/* Now Playing Window - Media Player Layout */
.window-body.custom-player {
  padding: 8px !important;
  background: #3c3c3c;
  border: 2px inset #75715e;
  font-family: 'Tahoma', sans-serif;
  font-size: 12px;
  height: 100%;
  box-sizing: border-box;
  overflow: hidden;
  min-width: 150px;
  min-height: 120px;
  display: flex;
  flex-direction: column;
  justify-content: space-between; /* Album art at top, controls at bottom */
}

#playerWindow {
  min-width: 150px;
  min-height: 120px; /* Much smaller minimum */
  max-width: 90vw;
  max-height: 90vh;
}

/* Album Art */
.album-art-container {
  width: 100%;
  max-width: 100%; /* Allow it to grow wider */
  aspect-ratio: 1;
  border: 2px inset #75715e;
  background: #000;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
  box-sizing: border-box;
  flex-shrink: 1;
  flex-grow: 1; /* Take up most of the available space */
  min-height: 40px;
}

/* Timeline Row */
.timeline-row {
  display: flex;
  align-items: center;
  gap: 8px;
  background: #1a1a1a;
  border: 1px inset #75715e;
  padding: 6px;
  height: 50px; /* Increased height to accommodate progress bar and labels */
  box-sizing: border-box;
  width: 100%;
  flex-shrink: 0;
  flex-grow: 0;
}

/* Controls Row */
.controls-row {
  display: flex;
  align-items: center;
  gap: 8px;
  background: #1a1a1a;
  border: 1px inset #75715e;
  padding: 6px;
  height: 40px;
  box-sizing: border-box;
  width: 100%;
  flex-shrink: 0;
  flex-grow: 0;
  flex-direction: row; /* Ensure horizontal layout */
  overflow: hidden; /* Prevent overflow */
}

.timeline-container {
  flex-grow: 1;
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}

/* Timeline Row - Progress bar and time display */
.timeline-row .timeline-container {
  flex-grow: 1;
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}

.timeline-row .progress-bar {
  width: 100%;
  height: 16px;
}

.timeline-row .time-display {
  display: flex;
  justify-content: space-between;
  font-size: 9px;
  color: #f8f8f2;
  font-family: 'Courier New', monospace;
}

.control-buttons {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-shrink: 0;
}

/* Volume Control */
.volume-slider {
  width: 80px; /* Smaller fixed width */
  height: 20px;
  background: #2a2a2a;
  border: 1px inset #75715e;
  outline: none;
  -webkit-appearance: none;
  appearance: none;
  flex-shrink: 2; /* Allow shrinking when container is small */
  box-sizing: border-box;
}

.volume-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 16px;
  height: 16px;
  background: #c0c0c0;
  border: 1px outset #c0c0c0;
  cursor: pointer;
}

.volume-slider::-moz-range-thumb {
  width: 16px;
  height: 16px;
  background: #c0c0c0;
  border: 1px outset #c0c0c0;
  cursor: pointer;
  border-radius: 0;
}

.album-art {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: none;
  position: absolute;
  top: 0;
  left: 0;
  box-sizing: border-box;
}

.no-art-placeholder {
  color: #c0c0c0;
  font-size: 24px;
  font-weight: bold;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  position: absolute;
  top: 0;
  left: 0;
  box-sizing: border-box;
}

/* Track Info & Controls Container */
.player-content {
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex-shrink: 0; /* Don't shrink */
  flex-grow: 0; /* Don't grow - fixed size */
  box-sizing: border-box;
}

.track-info {
  text-align: center;
  color: #f8f8f2;
  width: 100%;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 2px;
  flex-shrink: 0;
  flex-grow: 0;
  padding: 4px 0;
  min-height: 40px;
}

/* Track Info Text */
.track-title {
  font-family: 'Courier New', monospace;
  font-size: 16px;
  color: #a6e22e; /* Lighter green color */
  font-weight: bold; /* Make it bold */
  margin: 0;
  padding: 0;
  text-decoration: underline;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.track-artist {
  font-family: 'Courier New', monospace;
  font-size: 14px;
  font-weight: bold;
  color: #f8f8f2;
  margin: 0;
  padding: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.track-album {
  font-family: 'Courier New', monospace;
  font-size: 12px;
  font-style: italic;
  color: #b8b8b8;
  margin: 0;
  padding: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Smart scrolling animation - only applied when needed */
@keyframes scroll-text {
  0% {
    transform: translateX(0);
  }
  20% {
    transform: translateX(0);
  }
  80% {
    transform: translateX(calc(-100% + 150px));
  }
  100% {
    transform: translateX(calc(-100% + 150px));
  }
}

.progress-bar {
  width: 100%;
  height: 8px;
  background: #000;
  border: 1px inset #c0c0c0;
  position: relative;
  margin-bottom: 2px;
  flex-shrink: 0;
}

.progress-fill {
  height: 100%;
  background: linear-gradient(to right, #0f0, #0ff);
  width: 0%;
  transition: width 0.3s ease;
  position: relative;
}

.progress-fill.paused {
  background: #666;
  opacity: 0.5;
}

.progress-fill::after {
  content: '';
  position: absolute;
  right: 0;
  top: 0;
  width: 2px;
  height: 100%;
  background: #2d2d2d;
  box-shadow: 1px 0 0 #000;
}

.time-display {
  display: flex;
  justify-content: space-between;
  font-size: 9px;
  color: #f8f8f2;
  font-family: 'Courier New', monospace;
  flex-shrink: 0;
  height: 12px;
}

.player-controls {
  display: flex;
  align-items: center;
  gap: 4px;
  background: #c0c0c0;
  border: 1px inset #c0c0c0;
  padding: 4px;
  flex-shrink: 1;
  flex-grow: 0;
  width: 100%;
  box-sizing: border-box;
  justify-content: center;
  min-height: 30px;
}

.control-btn {
  background: #2a2a2a !important;
  border: none !important;
  border-top: 1px solid #4a4a4a !important;
  border-left: 1px solid #4a4a4a !important;
  border-bottom: 1px solid #1a1a1a !important;
  border-right: 1px solid #1a1a1a !important;
  padding: 2px 6px !important;
  font-size: 11px !important;
  cursor: pointer !important;
  min-width: 20px !important;
  min-height: 20px !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  color: #f8f8f2 !important;
  box-shadow: none !important;
  text-shadow: none !important;
  font-family: 'Tahoma', 'Arial', sans-serif !important;
  font-feature-settings: "liga" 0, "kern" 1 !important;
  letter-spacing: 0 !important;
  word-spacing: 0 !important;
}

.control-btn:active {
  border-top: 1px solid #1a1a1a !important;
  border-left: 1px solid #1a1a1a !important;
  border-bottom: 1px solid #4a4a4a !important;
  border-right: 1px solid #4a4a4a !important;
  background: #1a1a1a !important;
}

.control-btn:hover {
  background: #3a3a3a !important;
}

/* Walking Cat */
.walking-cat {
  position: fixed;
  bottom: 30px; /* Above taskbar */
  left: 0;
  z-index: 999;
  cursor: pointer;
  user-select: none;
  -webkit-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
  animation: catWalk 50s linear infinite;
}

.cat-gif {
  width: 100px;
  height: auto;
  image-rendering: pixelated;
  image-rendering: -moz-crisp-edges;
  image-rendering: crisp-edges;
  filter: drop-shadow(2px 2px 4px rgba(0, 0, 0, 0.5));
  transition: transform 0.3s ease;
}

.walking-cat:hover .cat-gif {
  filter: drop-shadow(2px 2px 6px rgba(0, 0, 0, 0.5));
  transform: scale(1.1);
  transition: all 0.2s ease;
}

@keyframes catWalk {
  0% {
    left: -100px;
    transform: scaleX(1);
  }
  45% {
    left: calc(100vw - 100px);
    transform: scaleX(1);
  }
  50% {
    left: calc(100vw - 100px);
    transform: scaleX(-1);
  }
  95% {
    left: -100px;
    transform: scaleX(-1);
  }
  100% {
    left: -100px;
    transform: scaleX(1);
  }
}

.walking-cat:hover {
  animation-play-state: paused;
}

/* Widget Styling */
.window-body iframe {
  width: 100%;
  height: 100%;
  border: none;
  padding: 0;
  background: #c0c0c0;
  /* Add Windows 98 styling to iframe containers */
  border: 1px inset #c0c0c0;
  box-sizing: border-box;
}

/* History Window */
#historyWindow .window-body {
  background: #3c3c3c;
  padding: 0;
}

#historyWindow iframe {
  background: #3c3c3c;
  border: 1px inset #c0c0c0;
}

/* Requests Window */
#requestWindow .window-body {
  background: #3c3c3c;
  padding: 0;
}

#requestWindow iframe {
  background: #3c3c3c;
  border: 1px inset #c0c0c0;
}

/* Custom Scrollbars */
.window-body::-webkit-scrollbar {
  width: 16px;
  height: 16px;
}

.window-body::-webkit-scrollbar-track {
  background: #c0c0c0;
  border: 1px inset #c0c0c0;
}

.window-body::-webkit-scrollbar-thumb {
  background: #c0c0c0;
  border: 1px outset #c0c0c0;
  border-top: 1px inset #c0c0c0;
  border-left: 1px inset #c0c0c0;
}

.window-body::-webkit-scrollbar-thumb:hover {
  background: #d0d0d0;
}

.window-body::-webkit-scrollbar-corner {
  background: #c0c0c0;
  border: 1px inset #c0c0c0;
}

/* History Display */
.custom-history {
  display: flex;
  flex-direction: column;
  height: 100%;
  min-height: 0;
  padding: 8px;
  background: #3c3c3c;
  box-sizing: border-box;
  font-family: 'Tahoma', sans-serif;
  font-size: 12px;
  color: #f8f8f2;
  overflow: hidden;
}

.history-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
  padding: 4px;
  background: #2d2d2d;
  border: 2px inset #75715e;
  flex-shrink: 0;
}

.history-title {
  font-weight: bold;
  color: #f8f8f2;
}

.refresh-btn {
  background: #2a2a2a !important;
  border: none !important;
  border-top: 1px solid #4a4a4a !important;
  border-left: 1px solid #4a4a4a !important;
  border-bottom: 1px solid #1a1a1a !important;
  border-right: 1px solid #1a1a1a !important;
  padding: 2px 6px !important;
  font-size: 11px !important;
  cursor: pointer !important;
  min-width: 20px !important;
  min-height: 16px !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  color: #f8f8f2 !important;
  box-shadow: none !important;
  text-shadow: none !important;
  font-family: 'Tahoma', 'Arial', sans-serif !important;
  font-feature-settings: "liga" 0, "kern" 1 !important;
  letter-spacing: 0 !important;
  word-spacing: 0 !important;
}

.refresh-btn:active {
  border-top: 1px solid #1a1a1a !important;
  border-left: 1px solid #1a1a1a !important;
  border-bottom: 1px solid #4a4a4a !important;
  border-right: 1px solid #4a4a4a !important;
  background: #1a1a1a !important;
  transform: scale(0.95) !important;
}

.refresh-btn:hover {
  background: #3a3a3a !important;
  transform: scale(1.05) !important;
}

.history-list {
  flex: 1;
  overflow-y: auto;
  background: #2d2d2d;
  border: 1px inset #75715e;
  padding: 4px;
  min-height: 0;
  /* Removed max-height to allow full window expansion */
}

.history-item {
  display: flex;
  align-items: center;
  padding: 8px 10px;
  margin-bottom: 4px;
  background: #2d2d2d;
  border: 1px solid #c0c0c0;
  border-radius: 2px;
  font-size: 11px;
  transition: all 0.2s ease;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
  gap: 8px;
}

.history-item:hover {
  background: #4a4a4a;
  border-color: #75715e;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.15);
  transform: translateY(-1px);
}

.history-item:last-child {
  margin-bottom: 0;
}

.history-time {
  color: #b8b8b8;
  font-family: 'Courier New', monospace;
  margin-right: 8px;
  min-width: 40px;
  flex-shrink: 0;
}

.history-album-art {
  width: 32px;
  height: 32px;
  border: 1px inset #c0c0c0;
  background: #000;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  border-radius: 2px;
}

.history-art-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 1px;
}

.history-no-art {
  color: #c0c0c0;
  font-size: 16px;
  font-weight: bold;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
}

.history-track {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.history-track-title {
  font-weight: bold;
  color: #f8f8f2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-bottom: 2px;
  font-size: 12px;
}

.history-track-artist {
  color: #b8b8b8;
  font-size: 10px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-style: italic;
}

.history-loading {
  text-align: center;
  color: #666;
  padding: 20px;
  font-style: italic;
}

.history-error {
  text-align: center;
  color: #c00;
  padding: 20px;
  font-weight: bold;
}

/* Requests Interface */
.custom-requests {
  display: flex;
  flex-direction: column;
  height: 100%;
  min-height: 0;
  padding: 8px;
  background: #3c3c3c;
  box-sizing: border-box;
  font-family: 'Tahoma', sans-serif;
  font-size: 12px;
  color: #f8f8f2;
  overflow: hidden;
}


.section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
  padding: 4px;
  background: #2d2d2d;
  border: 1px inset #75715e;
  flex-shrink: 0;
}

.section-buttons {
  display: flex;
  gap: 5px;
}

.section-title {
  font-weight: bold;
  color: #f8f8f2;
}

.songs-list {
  flex: 1;
  overflow-y: auto;
  background: #2d2d2d;
  border: 1px inset #75715e;
  padding: 4px;
  min-height: 0;
  margin-top: 8px;
}

.song-item {
  display: flex;
  align-items: center;
  padding: 8px 10px;
  margin-bottom: 4px;
  background: #2d2d2d;
  border: 1px solid #c0c0c0;
  border-radius: 2px;
  font-size: 11px;
  transition: all 0.2s ease;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
  gap: 8px;
}

.song-item:hover {
  background: #4a4a4a;
  border-color: #75715e;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.15);
  transform: translateY(-1px);
}

.song-item:last-child {
  margin-bottom: 0;
}

.song-album-art {
  width: 32px;
  height: 32px;
  border: 1px inset #c0c0c0;
  background: #000;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  border-radius: 2px;
}

.song-art-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 1px;
}

.song-no-art {
  color: #c0c0c0;
  font-size: 16px;
  font-weight: bold;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
}

.song-details {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  margin-right: 8px;
}

.song-title {
  font-weight: bold;
  color: #f8f8f2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-bottom: 2px;
  font-size: 12px;
}

.song-artist {
  color: #b8b8b8;
  font-size: 10px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-style: italic;
}

.song-request-btn {
  background: #2a2a2a !important;
  color: #f8f8f2 !important;
  border: none !important;
  border-top: 1px solid #4a4a4a !important;
  border-left: 1px solid #4a4a4a !important;
  border-bottom: 1px solid #1a1a1a !important;
  border-right: 1px solid #1a1a1a !important;
  padding: 2px 8px !important;
  font-size: 11px !important;
  cursor: pointer !important;
  font-family: 'Tahoma', sans-serif !important;
  font-weight: bold !important;
  min-width: 50px !important;
  min-height: 16px !important;
  box-shadow: none !important;
  text-shadow: none !important;
  letter-spacing: 0 !important;
  word-spacing: 0 !important;
}

.song-request-btn:active {
  border-top: 1px solid #1a1a1a !important;
  border-left: 1px solid #1a1a1a !important;
  border-bottom: 1px solid #4a4a4a !important;
  border-right: 1px solid #4a4a4a !important;
  background: #1a1a1a !important;
}

.song-request-btn:hover {
  background: #3a3a3a !important;
}

.song-request-btn:disabled {
  background: #1a1a1a !important;
  color: #666 !important;
  border-top: 1px solid #333 !important;
  border-left: 1px solid #333 !important;
  border-bottom: 1px solid #333 !important;
  border-right: 1px solid #333 !important;
  cursor: not-allowed !important;
}

.song-request-btn.requested {
  background: #2a4a2a !important;
  border-top: 1px solid #4a6a4a !important;
  border-left: 1px solid #4a6a4a !important;
  border-bottom: 1px solid #1a3a1a !important;
  border-right: 1px solid #1a3a1a !important;
}

.song-request-btn.requested:hover {
  background: #3a5a3a !important;
}



.songs-loading,
.songs-error {
  text-align: center;
  color: #666;
  padding: 20px;
  font-style: italic;
}

.songs-more,
.history-more {
  text-align: center;
  color: #666;
  padding: 8px;
  font-size: 10px;
  font-style: italic;
  background: #f8f8f8;
  border-top: 1px solid #e0e0e0;
  margin-top: 4px;
}

.songs-error {
  color: #c00;
  font-weight: bold;
  font-style: normal;
}

/* Mobile Styles */
@media (max-width: 768px) {
  .window {
    /* Make windows more mobile-friendly */
    min-width: 280px;
    min-height: 200px;
    max-width: calc(100vw - 20px);
    max-height: calc(100vh - 100px);
  }
  
  /* Player window mobile adjustments */
  #playerWindow {
    min-width: 280px;
    min-height: 350px; /* Slightly larger for mobile */
  }
  
  .window-body.custom-player {
    min-height: 350px; /* Match player window */
    padding: 16px !important; /* More padding on mobile */
  }
  
  .album-art-container {
    max-width: 200px; /* Reasonable max size for mobile */
    /* Keep aspect-ratio: 1 to maintain square shape */
  }
  
  .track-info {
    min-height: 90px; /* More space on mobile */
  }
  
  /* Video player mobile adjustments */
  #media-player-window {
    min-width: 280px;
    min-height: 180px;
    max-width: calc(100vw - 20px);
    max-height: calc(100vh - 100px);
  }
  
  .window-body.custom-video-player {
    padding: 6px !important; /* Less padding on mobile */
    min-height: 120px;
  }
  
  .video-display-container {
    min-height: 60px;
    flex: 1; /* Take up remaining space */
  }
  
  .video-controls {
    height: 35px;
    padding: 4px;
    /* Ensure controls are always visible on mobile */
    min-height: 35px;
    max-height: 35px;
  }
  
  
  .taskbar {
    /* Larger touch targets on mobile */
    height: 40px;
    padding: 4px 8px;
  }
  
  .taskbar button {
    font-size: 14px;
    padding: 4px 8px;
    min-height: 32px;
    min-width: 80px;
  }
  
  /* Walking cat positioning for mobile */
  .walking-cat {
    bottom: 45px; /* Above the taller mobile taskbar */
  }
  
  /* Player window adjustments for small screens */
  .window-body.custom-player {
    padding: 6px !important; /* Less padding on mobile */
    gap: 6px; /* Smaller gap */
  }
  
  .album-art-container {
    max-width: 120px; /* Smaller on mobile */
    min-height: 50px; /* Even smaller minimum */
  }
  
  .player-content {
    padding-bottom: 6px; /* Less padding on mobile */
  }
  
  .timeline-row {
    padding: 4px 4px 2px 4px; /* Less padding on mobile */
    height: 40px; /* Increased height for mobile too */
  }
  
  .controls-row {
    padding: 4px 4px 8px 4px; /* Less padding on mobile but still some bottom */
    height: 35px;
  }
  
  .volume-slider {
    width: 50px; /* Even smaller on mobile */
  }
  
  /* Better title bar for mobile dragging */
  .title-bar {
    min-height: 32px;
    display: flex;
    align-items: center;
    /* Larger touch area */
    padding: 4px 8px;
  }
  
  .title-bar-text {
    flex: 1;
    /* Prevent text selection */
    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    /* Better line height for text alignment */
    line-height: 1.2;
  }
  
  /* Make minimize buttons easier to tap */
  .title-bar-controls button {
    min-width: 32px;
    min-height: 32px;
    margin: 0 2px;
    padding: 4px;
    border: 1px outset #c0c0c0;
    background: #c0c0c0;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
  }
  
  .title-bar-controls button:active {
    border: 1px inset #c0c0c0;
    background: #a0a0a0;
  }
  
  .title-bar-controls button:hover {
    background: #d0d0d0;
  }
  
  /* Ensure buttons are touch-friendly */
  .title-bar-controls button {
    -webkit-tap-highlight-color: rgba(0,0,0,0.1);
    touch-action: manipulation;
  }
  
  /* Adjust window positioning for mobile */
  .window {
    top: 50px;
    left: 10px;
  }
  
  /* Reset button positioning for mobile */
  #reset-windows {
    top: 5px;
    right: 5px;
    font-size: 12px;
    padding: 4px 8px;
    min-height: 28px;
  }
}

@media (max-width: 480px) {
  .window {
    min-width: 250px;
    left: 5px;
    right: 5px;
    width: calc(100vw - 10px);
  }
  
  .taskbar button {
    font-size: 12px;
    padding: 3px 6px;
    min-width: 70px;
  }
}

/* Video Player Window */
#media-player-window {
  min-width: 300px;
  min-height: 200px;
  max-width: 90vw;
  max-height: 90vh;
}

/* Video Player - Traditional Layout (same pattern as player window) */
.window-body.custom-video-player {
  padding: 8px !important;
  background: #3c3c3c;
  border: 2px inset #75715e;
  font-family: 'Tahoma', sans-serif;
  font-size: 12px;
  height: 100%;
  box-sizing: border-box;
  overflow: hidden;
  min-width: 150px;
  min-height: 120px;
  display: flex;
  flex-direction: column;
  justify-content: space-between; /* Video at top, controls at bottom */
}

/* Video Display - Takes most space */
.video-display-container {
  width: 100%;
  background: #000;
  margin: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
  box-sizing: border-box;
  flex: 1; /* Take up remaining space */
  min-height: 80px;
}

.video-display {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
}



.video-placeholder {
  color: #c0c0c0;
  font-size: 16px;
  font-weight: bold;
  text-align: center;
}

.video-display video,
.video-display img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

/* Video Controls - Fixed at bottom */
.video-controls {
  display: flex;
  align-items: center;
  gap: 8px;
  background: #1a1a1a;
  border: 1px inset #75715e;
  padding: 6px;
  height: 40px;
  box-sizing: border-box;
  width: 100%;
  flex-shrink: 0;
  flex-grow: 0;
  margin: 0;
  /* Ensure no extra spacing */
  overflow: hidden;
  /* Force the controls to stay within bounds */
  max-width: 100%;
  min-width: 0;
  /* Ensure controls are always visible */
  min-height: 40px;
  max-height: 40px;
}

.video-info {
  flex: 1;
  text-align: center;
  padding: 0 10px;
  min-width: 0; /* Allow shrinking */
  overflow: hidden;
}

.video-name {
  font-size: 12px;
  font-weight: bold;
  color: #f8f8f2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  width: 100%;
  margin: 0;
  padding: 0;
}

/* Video control buttons - ensure they don't overflow */
.video-controls .control-btn {
  flex-shrink: 0;
  min-width: 24px;
  height: 24px;
  margin: 0;
  padding: 2px 4px !important;
  font-size: 10px !important;
}

/* Terminal Window */
.terminal-body {
  padding: 8px;
  background: #282828; /* Gruvbox background */
  border: 2px inset #75715e;
  height: calc(100% - 28px);
  overflow: hidden;
  box-sizing: border-box;
}

#terminal {
  width: 100%;
  height: 100%;
  background: #282828; /* Gruvbox background */
  color: #ebdbb2; /* Gruvbox foreground */
  font-family: 'Courier New', monospace;
  font-size: 13px; /* Increased font size */
  line-height: 1.3; /* Slightly increased line height */
  padding: 6px; /* Increased padding */
  box-sizing: border-box;
}

.terminal-body .xterm {
  height: 100%;
  width: 100%;
}


.terminal-body .xterm-viewport {
  background: #282828 !important; /* Gruvbox background */
}

.terminal-body .xterm-screen {
  background: #282828 !important; /* Gruvbox background */
}
