/* Links Window Sizing & Translucent Styling */
.window-container.links-window {
  min-width: 420px;
  min-height: 320px;
  max-width: 95vw;
  max-height: 90vh;
}

.window-container.links-window .window-body {
  padding: 12px;
  height: calc(100% - 43px); /* Subtract title bar height */
  overflow: hidden;
  background: rgba(23, 23, 23, 0.5); /* Translucent background like gallery-window / controls-wrap */
  box-sizing: border-box;
}

.links-folder-view {
  display: flex;
  flex-direction: column;
  height: 100%;
  width: 100%;
  background: transparent;
  font-family: 'MS Sans Serif', Arial, sans-serif;
  font-size: 11px;
  box-sizing: border-box;
}

/* Compact Windows Explorer icon grid */
.links-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, 76px);
  grid-auto-rows: max-content;
  gap: 16px 12px;
  padding: 12px 8px;
  align-content: start;
  justify-content: start;
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
}

.links-item {
  width: 76px;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 4px 2px;
  border: 1px solid transparent;
  cursor: pointer;
  text-align: center;
  text-decoration: none;
  color: #ffffff;
  position: relative;
  user-select: none;
  background: transparent;
  border-radius: 2px;
  box-sizing: border-box;
}

.links-item:hover {
  background-color: #000080;
  color: #ffffff;
  border: 1px dotted #ffffff;
}

.links-item:hover .links-item-label {
  color: #ffffff;
  background: #000080;
}

.links-icon-wrap {
  position: relative;
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 4px;
}

.links-icon-wrap .links-icon {
  width: 48px;
  height: 48px;
  background-size: contain;
  background-position: center;
  background-repeat: no-repeat;
  display: flex;
  align-items: center;
  justify-content: center;
}

.links-icon-wrap .links-icon-img {
  width: 48px;
  height: 48px;
  object-fit: contain;
  display: block;
}

/* External link shortcut icon indicator */
.links-icon-wrap::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 0;
  width: 32px;
  height: 32px;
  background: url('/img/shortcut-32x32.png') no-repeat;
  background-size: contain;
  pointer-events: none;
}

.links-item-label {
  font-size: 11px;
  word-wrap: break-word;
  max-width: 74px;
  line-height: 1.2;
  color: #ffffff;
  text-shadow: 1px 1px 1px #000000;
}

/* External link warning dialog (Murray from Monkey Island) */
.external-warning-content {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 8px 4px;
}

.external-warning-murray {
  width: 64px;
  height: 85px;
  flex-shrink: 0;
  image-rendering: pixelated;
  user-select: none;
}

.external-warning-text {
  flex: 1;
}

.external-warning-text p {
  margin: 0 0 6px 0;
  font-size: 12px;
  line-height: 1.35;
  color: #fafafa;
  text-shadow: 1px 1px 1px #000000;
}

.external-warning-text p:last-child {
  margin-bottom: 0;
}

.external-warning-target {
  display: block;
  color: #ffff55;
  font-weight: bold;
  font-size: 13px;
  word-break: break-all;
  margin: 3px 0 6px 0;
  text-shadow: 1px 1px 2px #000000;
}

.window-container.modal .window-buttons .external-warning-btn {
  min-width: 80px;
  padding: 4px 14px;
  margin: 0 4px;
  font-size: 12px;
  cursor: pointer;
}

@media (max-width: 768px) {
  .links-grid {
    grid-template-columns: repeat(auto-fill, 68px);
    gap: 12px 8px;
    padding: 8px 4px;
  }
  
  .links-item {
    width: 68px;
  }

  .links-icon-wrap,
  .links-icon-wrap .links-icon,
  .links-icon-wrap .links-icon-img {
    width: 40px;
    height: 40px;
  }
  
  .links-icon-wrap::after {
    width: 26px;
    height: 26px;
  }
  
  .links-item-label {
    font-size: 10px;
    max-width: 66px;
  }
}
