/* Core Reset & Full-Viewport Box Model */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html, body {
  width: 100%;
  height: 100%;
  overflow: hidden;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background-color: #1a1a1a;
  color: #e0e0e0;
}

body {
  display: flex;
  flex-direction: column;
}

/* 1. Header Area */
.app-header {
  height: 64px;
  background-color: #121212;
  border-bottom: 1px solid #2d2d2d;
  display: flex;
  align-items: center;
  padding: 0 24px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
  z-index: 10;
}

.header-title {
  font-size: 1.25rem;
  font-weight: 600;
  color: #ffffff;
  line-height: 1.2;
}

.header-artist {
  font-size: 0.875rem;
  color: #a0a0a0;
  margin-top: 2px;
}

/* App Body Layout */
.app-body {
  flex: 1;
  display: flex;
  height: calc(100vh - 64px);
  overflow: hidden;
}

/* 2. Sidebar Panel */
.sidebar {
  width: 220px;
  background-color: #222222;
  border-right: 1px solid #2d2d2d;
  overflow-y: auto;
  padding: 12px;
}

/* Scrollbar styling for sidebar */
.sidebar::-webkit-scrollbar {
  width: 8px;
}
.sidebar::-webkit-scrollbar-track {
  background: #1a1a1a;
}
.sidebar::-webkit-scrollbar-thumb {
  background: #444444;
  border-radius: 4px;
}
.sidebar::-webkit-scrollbar-thumb:hover {
  background: #666666;
}

.thumbnail-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.thumb-item {
  width: 100%;
  height: 120px;
  border-radius: 6px;
  overflow: hidden;
  cursor: pointer;
  border: 2px solid transparent;
  background-color: #111111;
  transition: border-color 0.2s ease, transform 0.15s ease;
}

.thumb-item:hover {
  border-color: #666666;
  transform: translateY(-1px);
}

.thumb-item.active {
  border-color: #007acc;
  box-shadow: 0 0 8px rgba(0, 122, 204, 0.5);
}

.thumb-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* 3. Main Display Area */
.main-display {
  flex: 1;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: #0f0f0f;
  padding: 24px;
  overflow: hidden;
}

.image-wrapper {
  position: relative;
  max-width: 100%;
  max-height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

/* Image maintains aspect ratio without scaling distortion */
.image-wrapper img {
  max-width: 100%;
  max-height: calc(100vh - 160px);
  width: auto;
  height: auto;
  object-fit: contain;
  border-radius: 4px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.6);
}

/* Image Caption Container */
.caption-box {
  margin-top: 12px;
  background: rgba(0, 0, 0, 0.75);
  padding: 8px 16px;
  border-radius: 4px;
  max-width: 80%;
  text-align: center;
  backdrop-filter: blur(4px);
}

.caption-box.hidden {
  display: none;
}

.caption-text {
  font-size: 0.95rem;
  color: #dcdcdc;
  font-style: italic;
}

/* Navigation Buttons */
.nav-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(0, 0, 0, 0.5);
  color: #ffffff;
  border: none;
  font-size: 2rem;
  padding: 16px 12px;
  cursor: pointer;
  border-radius: 4px;
  transition: background 0.2s ease, opacity 0.2s ease;
  z-index: 5;
  user-select: none;
}

.nav-btn:hover {
  background: rgba(0, 122, 204, 0.8);
}

.prev-btn { left: 16px; }
.next-btn { right: 16px; }