:root {
  --bg-color: #121212;
  --card-bg: #1e1e1e;
  --text-color: #e0e0e0;
  --accent-color: #bb86fc;
  --hover-color: #333;
}

body {
  margin: 0;
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  background: var(--bg-color);
  color: var(--text-color);
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* --- Header & Search --- */
header {
  padding: 1rem 0.5rem;
  text-align: center;
  background: var(--card-bg);
  border-bottom: 1px solid #333;
  z-index: 10;
  position: sticky;
  top: 0;
}

.title {
  font-size: 1.5rem;
  font-weight: bold;
  margin-bottom: 10px;
}

.search-wrapper {
  width: 100%;
  display: flex;
  justify-content: center;
}

#searchBar {
  width: 90%;
  max-width: 500px;
  padding: 10px 15px;
  border-radius: 25px;
  border: 1px solid #444;
  background: #121212;
  color: #fff;
  font-size: 1rem;
  outline: none;
  transition: border-color 0.3s;
}

#searchBar:focus {
  border-color: var(--accent-color);
}

/* --- Loader --- */
.loader {
  border: 5px solid #333;
  border-top: 5px solid var(--accent-color);
  border-radius: 50%;
  width: 40px; height: 40px;
  animation: spin 1s linear infinite;
  margin: 50px auto;
}
@keyframes spin { 0% { transform: rotate(0deg); } 100% { transform: rotate(360deg); } }

/* --- Album List --- */
main#album-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1.5rem;
  padding: 1.5rem;
  max-width: 1400px;
  margin: 0 auto;
  width: 100%;
  box-sizing: border-box;
}

.album-card {
  background: var(--card-bg);
  border-radius: 12px;
  overflow: hidden;
  cursor: pointer;
  transition: transform 0.2s, box-shadow 0.2s;
  display: flex;
  flex-direction: column;
  aspect-ratio: 1 / 1;
}

.album-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 8px 16px rgba(0,0,0,0.5);
}

.thumbnail-container {
  width: 100%; height: 75%;
  overflow: hidden; background: #000;
}

.thumbnail-container img,
.thumbnail-container video {
  width: 100%; height: 100%; object-fit: cover;
}

.album-card h3 {
  height: 25%; margin: 0; padding: 0.5rem 1rem;
  font-size: 1rem;
  display: flex; align-items: center; justify-content: center;
  text-align: center; word-break: break-word;
}

/* --- Album View --- */
section#album-view {
  display: none;
  flex-direction: column; align-items: center;
  padding: 1rem;
  background: var(--bg-color);
  min-height: 100vh; width: 100%;
  box-sizing: border-box;
}

section#album-view.visible { display: flex; }

.view-header { width: 100%; max-width: 900px; text-align: center; }

#album-title { font-size: 1.5rem; margin: 1rem 0; color: var(--accent-color); }

/* AUDIO PLAYER */
.audio-wrapper {
    position: static;
    width: 100%; max-width: 900px;
    padding: 10px 0;
    margin-bottom: 20px;
    text-align: center;
    background: transparent;
    border: none;
}

#narration { width: 100%; display: block; }

#media-container {
  max-width: 900px; width: 100%;
  display: flex; flex-direction: column;
  gap: 2rem; align-items: center;
}

#media-container img,
#media-container video {
  width: 100%; height: auto;
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.5);
  cursor: default; /* No longer zoom-in */
}

.caption {
  max-width: 800px; width: 90%;
  text-align: center; font-size: 1.1rem;
  color: #ccc; background: #222;
  padding: 15px; border-radius: 8px;
  border-left: 4px solid var(--accent-color);
  line-height: 1.5;
}

.back-btn {
  background: #333; color: #fff;
  border: none; padding: 10px 20px;
  border-radius: 20px; cursor: pointer;
  font-size: 1rem; transition: background 0.3s;
  display: inline-block;
}
.back-btn:hover { background: var(--accent-color); color: #000; }
.bottom-btn { margin-top: 3rem; margin-bottom: 2rem; width: 100%; max-width: 900px; }

/* --- 5. Scroll To Top Button (Updated) --- */
#scrollTopBtn {
    display: none;
    position: fixed;
    bottom: 20px; right: 20px;
    z-index: 99;
    border: none; outline: none;
    
    /* Smaller & Transparent */
    width: 30px; height: 30px; 
    font-size: 16px;
    background-color: var(--accent-color);
    color: #000;
    opacity: 0.3; /* Very transparent */
    
    cursor: pointer;
    border-radius: 50%;
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
    transition: opacity 0.3s, transform 0.3s;
}

#scrollTopBtn:hover { 
    opacity: 1; 
    transform: translateY(-3px); 
}
