/***************************************************
* Project:   The Funny Stuff (Chug.ched.beer)
* Author:    Cheddlar
* Copyright: (c) 2025 Cheddlatron. All Rights Reserved.
***************************************************/

/* ==========================================================================
  CSS Variables
  ========================================================================== */
:root {
  --bg-dark: #1a1a1f;
  --bg-light: #23232b;
  --bg-card: #2a2a32;
  --text-primary: #e6e6f7;
  --text-secondary: #b0b0c3;
  --text-muted: #7a7a87;
  --accent: #bb86fc;
  --accent-hover: #a175d1;
  --accent-darker: #8b5cf6;
  --border-color: #3a3a42;
  --shadow-light: rgba(187, 134, 252, 0.12);
  --shadow-medium: rgba(187, 134, 252, 0.22);
  --shadow-strong: rgba(187, 134, 252, 0.4);
  --bg-dark-rgb: 26, 26, 31;
  --accent-rgb: 187, 134, 252;
}

/* ==========================================================================
  Reset & Base Styles
  ========================================================================== */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html,
body {
  height: 100%;
}

body {
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  background: var(--bg-dark);
  color: var(--text-primary);
  line-height: 1.6;
  overflow-x: hidden;
  display: flex;
  flex-direction: column;
  user-select: none;
}

main {
  flex-grow: 1;
  padding: 2rem;
  max-width: 1400px;
  margin: 0 auto;
  width: 100%;
}

/* ==========================================================================
  Text Selection Rules
  ========================================================================== */
input[type="search"],
input[type="text"],
textarea,
.site-footer p {
  user-select: text;
  -webkit-user-select: text;
}

/* ==========================================================================
  Footer
  ========================================================================== */
.site-footer {
  padding: 1.5rem 2rem;
  background-color: var(--bg-light);
  border-top: 1px solid var(--border-color);
  text-align: center;
  color: var(--text-muted);
  font-size: 0.85rem;
  flex-shrink: 0;
}

.site-footer p {
  margin: 0;
}

.site-footer .heart-emoji {
  color: var(--accent);
  font-style: normal;
}

/* ==========================================================================
  Scrollbar Styles
  ========================================================================== */
html::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

html::-webkit-scrollbar-track {
  background: var(--bg-dark);
}

html::-webkit-scrollbar-thumb {
  background: var(--accent);
  border-radius: 4px;
}

html::-webkit-scrollbar-thumb:hover {
  background: var(--accent-hover);
}

/* ==========================================================================
  Overlay
  ========================================================================== */
.overlay {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(var(--bg-dark-rgb), 0.97);
  backdrop-filter: blur(10px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 3000;
  transition: opacity 1.2s ease-out, backdrop-filter 1.2s ease-out;
  cursor: pointer;
}

.overlay.hidden {
  opacity: 0;
  pointer-events: none;
  backdrop-filter: blur(0px);
}

.overlay-content {
  text-align: center;
  max-width: 600px;
  padding: 2rem;
}

.overlay h1 {
  font-size: 3rem;
  font-weight: 300;
  color: var(--accent);
  margin-bottom: 1.5rem;
  letter-spacing: 2px;
}

.overlay-description p {
  font-size: 1.1rem;
  color: var(--text-secondary);
  margin-bottom: 0.8rem;
}

.overlay-instruction {
  margin-top: 2rem;
  padding: 0.8rem 1.5rem;
  border: 2px solid var(--accent);
  border-radius: 50px;
  color: var(--accent);
  font-weight: 500;
  display: inline-block;
  transition: all 0.3s ease;
}

.overlay-instruction:hover {
  background: var(--accent);
  color: var(--bg-dark);
  transform: translateY(-2px);
}

/* ==========================================================================
  Tab Navigation
  ========================================================================== */
.tab-scrollbar {
  position: relative;
  background: var(--bg-light);
  margin-bottom: 2.2rem;
  z-index: 500;
  flex-shrink: 0;
}

.tab-list {
  display: flex;
  overflow-x: auto;
  white-space: nowrap;
  scrollbar-width: thin;
  scrollbar-color: var(--accent) var(--bg-dark);
  scroll-behavior: smooth;
  padding: 0.5rem 0.5rem 0.5rem 1rem;
  gap: 0.6rem;
  justify-content: center;
}

.tab-list::-webkit-scrollbar {
  height: 6px;
}

.tab-list::-webkit-scrollbar-thumb {
  background: var(--accent);
  border-radius: 4px;
}

.tab-list::-webkit-scrollbar-track {
  background: var(--bg-dark);
}

.tab {
  background: none;
  border: none;
  color: var(--text-secondary);
  font-size: 1.08em;
  font-weight: 500;
  padding: 0.48em 1.35em;
  border-radius: 1.6em;
  cursor: pointer;
  transition: color 0.18s, background 0.18s;
  position: relative;
  z-index: 1;
  outline: none;
}

.tab.active,
.tab:focus,
.tab:hover {
  color: #fff;
  background: var(--accent);
}

.tab-scroll-fade {
  position: absolute;
  top: 0;
  width: 36px;
  height: 100%;
  pointer-events: none;
  z-index: 2;
  transition: opacity 0.25s;
  opacity: 0.85;
}

.tab-fade-left {
  left: 0;
  background: linear-gradient(to right, var(--bg-light) 60%, transparent);
}

.tab-fade-right {
  right: 0;
  background: linear-gradient(to left, var(--bg-light) 60%, transparent);
}

/* ==========================================================================
  Gallery Styles
  ========================================================================== */
.gallery {
  opacity: 1;
  position: relative;
  overflow: hidden;
}

.gallery.loading-state {
  opacity: 0.5;
}

.loading {
  grid-column: 1 / -1;
  text-align: center;
  color: var(--text-secondary);
  font-size: 1.2rem;
  padding: 3rem;
}

.gallery-list-view .loading {
  width: 100%;
}

/* Grid View */
.gallery-grid-view {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 2rem;
}

.gallery-grid-view .media-container {
  position: relative;
  width: 100%;
  height: 220px;
  overflow: hidden;
}

.gallery-grid-view .media-card img,
.gallery-grid-view .media-card video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s;
}

.gallery-grid-view .media-card:hover img,
.gallery-grid-view .media-card:hover video {
  transform: scale(1.05);
}

.gallery-grid-view .audio-content-area {
  width: 100%;
  height: 180px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  box-sizing: border-box;
}

.gallery-grid-view .audio-content-area audio {
  display: block;
  width: 100%;
  max-width: 300px;
  height: 40px;
  background-color: transparent;
  border-radius: 6px;
  color-scheme: dark;
}

.gallery-grid-view .audio-content-area audio::-webkit-media-controls-panel {
  background-color: var(--bg-light);
  border-radius: 6px;
  padding: 0.3rem 0.5rem;
  box-sizing: border-box;
}

/* List View */
.gallery-list-view {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.gallery-list-view .media-card {
  flex-direction: row;
  align-items: center;
  width: 100%;
  padding: 0.6rem;
  background: var(--bg-light);
  border-radius: 6px;
}

.gallery-list-view .media-container,
.gallery-list-view .audio-content-area {
  width: 70px;
  height: 50px;
  flex-shrink: 0;
  margin-right: 0.75rem;
  border-radius: 4px;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

.gallery-list-view .media-container img,
.gallery-list-view .media-container video,
.gallery-list-view .audio-content-area audio {
  width: 100%;
  height: 100%;
  object-fit: cover;
  margin: 0;
}

.gallery-list-view .media-caption {
  flex-grow: 1;
  text-align: left;
  font-size: 0.9rem;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  background: transparent;
  padding: 0;
  margin-top: 0;
}

.gallery-list-view .media-type-badge {
  display: none;
}

/* ==========================================================================
  Media Card
  ========================================================================== */
.media-card {
  background: var(--bg-card);
  border-radius: 12px;
  overflow: hidden;
  cursor: pointer;
  transition: transform 0.3s, box-shadow 0.3s, border-color 0.3s;
  border: 1px solid var(--border-color);
  position: relative;
  display: flex;
  flex-direction: column;
}

.media-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 10px 30px var(--shadow-medium);
  border-color: var(--accent);
}

/* ==========================================================================
  Caption & Badge
  ========================================================================== */
.media-caption {
  padding: 0.8rem 1rem;
  background: var(--bg-light);
  color: var(--text-secondary);
  font-size: 0.85rem;
  text-align: center;
  word-break: break-word;
  margin-top: auto;
}

.media-type-badge {
  position: absolute;
  top: 0.5rem;
  right: 0.5rem;
  background: var(--accent);
  color: var(--bg-dark);
  padding: 0.25rem 0.5rem;
  border-radius: 12px;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  z-index: 10;
}

.media-type-badge.copy-link-btn {
  border: none;
  cursor: pointer;
}

/* ==========================================================================
  Thumbnail Sizes (Grid View)
  ========================================================================== */
.gallery-grid-view.gallery-thumbnails-small .media-container,
.gallery-grid-view.gallery-thumbnails-small .audio-content-area {
  height: 150px;
}

.gallery-grid-view.gallery-thumbnails-large .media-container,
.gallery-grid-view.gallery-thumbnails-large .audio-content-area {
  height: 280px;
}

/* ==========================================================================
  Toolbar & Controls
  ========================================================================== */
.toolbar {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.8rem;
  padding: 0 0.5rem;
  gap: 1rem;
}

#media-search {
  background: var(--bg-light);
  color: var(--text-primary);
  border: 1px solid var(--border-color);
  border-radius: 20px;
  padding: 0.6rem 1rem;
  font-size: 0.95rem;
  max-width: 350px;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
  flex-grow: 1;
  min-width: 180px;
}

#media-search:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--shadow-light);
}

#media-search::placeholder {
  color: var(--text-muted);
}

.gallery-controls {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.control-button.icon-button {
  background-color: transparent;
  border: 1px solid transparent;
  color: var(--text-secondary);
  width: 38px;
  height: 38px;
  border-radius: 50%;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: background-color 0.2s, color 0.2s, box-shadow 0.2s;
}

.control-button.icon-button:hover {
  background-color: rgba(var(--accent-rgb), 0.1);
  color: var(--accent);
}

.control-button.icon-button:focus,
.control-button.icon-button:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px var(--shadow-light);
}

.control-button.icon-button svg {
  width: 20px;
  height: 20px;
  fill: currentColor;
}

.thumbnail-size-controls {
  display: none !important;
}

/* ==========================================================================
  Animations & Reduced Motion
  ========================================================================== */
.reduce-motion * {
  animation-duration: 0.01ms !important;
  animation-iteration-count: 1 !important;
  transition-duration: 0.01ms !important;
  scroll-behavior: auto !important;
  transition-delay: 0ms !important;
}

@keyframes fadeOutGallery {
  from { opacity: 1; transform: translateY(0);}
  to   { opacity: 0; transform: translateY(15px);}
}

@keyframes fadeInGallery {
  from { opacity: 0; transform: translateY(-15px);}
  to   { opacity: 1; transform: translateY(0);}
}

.gallery-fade-out {
  animation: fadeOutGallery 0.25s ease-out forwards;
}

.gallery-fade-in {
  animation: fadeInGallery 0.25s ease-in forwards;
}

/* ==========================================================================
  Lightbox, FAB, Modals, To-Do Panel
  ========================================================================== */
.lightbox {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(20, 16, 28, 0.96);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2000;
  opacity: 1;
  transition: opacity 0.4s;
  backdrop-filter: blur(8px);
}

.lightbox.hidden {
  opacity: 0;
  pointer-events: none;
}

.lightbox-content {
  max-width: 90vw;
  max-height: 90vh;
  position: relative;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 0 50px var(--shadow-strong);
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-card);
}

.lightbox-content img,
.lightbox-content video {
  display: block;
  max-width: 90vw;
  max-height: 90vh;
  width: auto;
  height: auto;
  object-fit: contain;
  border-radius: 8px;
}

.lightbox-content audio {
  display: block;
  width: 80%;
  max-width: 600px;
  margin: 1rem auto;
  height: 50px;
  color-scheme: dark;
}

.lightbox-content audio::-webkit-media-controls-panel {
  background-color: var(--bg-light);
  border-radius: 8px;
}

.lightbox-close {
  position: absolute;
  top: 20px;
  right: 20px;
  background: none;
  border: none;
  color: var(--accent);
  font-size: 2.5rem;
  cursor: pointer;
  padding: 0.5rem;
  border-radius: 50%;
  width: 50px;
  height: 50px;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2001;
  transition: background 0.3s, transform 0.3s;
}

.lightbox-close:hover {
  background: rgba(var(--accent-rgb), 0.2);
  transform: scale(1.1);
}

/* FAB */
.fab-container {
  position: fixed;
  bottom: 32px;
  right: 32px;
  z-index: 1500;
  display: flex;
  flex-direction: column-reverse;
  align-items: center;
  pointer-events: none;
  gap: 15px;
}

.fab-main {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: var(--bg-light);
  border: none;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
  cursor: pointer;
  transition: transform 0.2s, background-color 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: auto;
}

.fab-main:hover {
  background-color: var(--accent-darker);
}

.fab-main svg {
  transform: rotate(90deg);
  width: 28px;
  height: 28px;
  transition: transform 0.3s;
}

.fab-container.open .fab-main svg {
  transform: rotate(135deg);
}

.fab-action {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--accent);
  border: none;
  cursor: pointer;
  opacity: 0;
  transform: translateY(20px) scale(0.5);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  display: grid;
  place-items: center;
  pointer-events: none;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.fab-action:hover {
  background: var(--accent-hover);
}

.fab-container.open .fab-action {
  opacity: 1;
  transform: translateY(0) scale(1);
  pointer-events: auto;
}

.fab-action svg {
  fill: #fff;
  width: 22px;
  height: 22px;
}

/* Info Modal */
.info-modal-overlay-reimplemented {
  position: fixed;
  inset: 0;
  background-color: rgba(var(--bg-dark-rgb), 0.92);
  backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2500;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s;
}

.info-modal-overlay-reimplemented.visible {
  opacity: 1;
  pointer-events: auto;
}

.info-modal-content-reimplemented {
  background: var(--bg-light);
  color: var(--text-primary);
  padding: 2rem 2.5rem;
  border-radius: 12px;
  border: 1px solid var(--border-color);
  box-shadow: 0 15px 35px rgba(0, 0, 0, 0.35);
  max-width: 500px;
  width: calc(100% - 40px);
  position: relative;
  transform: translateY(20px) scale(0.98);
  transition: opacity 0.3s, transform 0.3s;
  opacity: 0;
}

.info-modal-overlay-reimplemented.visible .info-modal-content-reimplemented {
  transform: translateY(0) scale(1);
  opacity: 1;
}

.info-modal-close-button-reimplemented {
  position: absolute;
  top: 10px;
  right: 12px;
  background: transparent;
  border: none;
  color: var(--text-secondary);
  font-size: 2.4rem;
  font-weight: 300;
  cursor: pointer;
  padding: 0.5rem;
  line-height: 0.5;
  border-radius: 50%;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color 0.2s, transform 0.2s, background 0.2s;
}

.info-modal-close-button-reimplemented:hover {
  color: var(--accent);
  transform: scale(1.1);
  background-color: rgba(var(--accent-rgb), 0.1);
}

.info-modal-title-reimplemented {
  font-size: 2rem;
  color: var(--accent);
  margin-bottom: 1.5rem;
  font-weight: 400;
  text-align: center;
  letter-spacing: 0.5px;
}

.info-modal-text-reimplemented {
  font-size: 1.05rem;
  color: var(--text-secondary);
  margin-bottom: 1rem;
  line-height: 1.7;
  text-align: center;
}

.info-modal-contact-reimplemented {
  margin: 2rem 0 1.5rem 0;
  font-size: 1.1rem;
  font-weight: 500;
  text-align: center;
}

.info-modal-link-reimplemented {
  color: var(--accent);
  text-decoration: none;
  font-weight: 600;
  transition: color 0.2s, border-bottom 0.2s;
  border-bottom: 1px solid transparent;
}

.info-modal-link-reimplemented:hover {
  color: var(--accent-hover);
  border-bottom-color: var(--accent-hover);
}

.info-modal-note-reimplemented {
  font-size: 0.95rem;
  color: var(--text-muted);
  margin-top: 1.5rem;
  text-align: center;
  font-style: italic;
}

/* To-Do Panel */
#todo-panel {
  position: fixed;
  top: 0;
  right: -370px;
  width: 340px;
  max-width: 90vw;
  height: 100vh;
  background: var(--bg-light);
  box-shadow: -2px 0 24px rgba(0, 0, 0, 0.23);
  color: var(--text-primary);
  z-index: 1800;
  padding: 0;
  display: flex;
  flex-direction: column;
  transition: right 0.38s cubic-bezier(.8, .1, .2, 1);
}

#todo-panel.open {
  right: 0;
}

.todo-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: var(--bg-dark);
  padding: 1.1em 1.4em 1em 1.4em;
  font-size: 1.2em;
  font-weight: bold;
  border-bottom: 1px solid var(--accent);
  flex-shrink: 0;
}

#todo-close {
  background: none;
  border: none;
  color: var(--accent);
  font-size: 1.5em;
  cursor: pointer;
  transition: color 0.2s;
}

#todo-close:hover {
  color: #fff;
}

#todo-list {
  list-style: none;
  margin: 0;
  flex: 1;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: var(--accent) var(--bg-dark);
  padding: 1.2em 1.5em;
}

#todo-list::-webkit-scrollbar {
  width: 8px;
}

#todo-list::-webkit-scrollbar-track {
  background: var(--bg-dark);
}

#todo-list::-webkit-scrollbar-thumb {
  background: var(--accent);
  border-radius: 4px;
}

#todo-list::-webkit-scrollbar-thumb:hover {
  background: var(--accent-hover);
}

.todo-section:not(:last-child) {
  margin-bottom: 1rem;
}

.todo-section h3 {
  color: var(--accent);
  margin: 0 0 0.8em 0;
  font-size: 1.1em;
}

.todo-section ul {
  list-style: none;
  padding-left: 0;
}

.todo-section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  cursor: pointer;
  padding: 0.4em 0;
}

.todo-section-header h3 {
  margin: 0;
}

.todo-toggle {
  color: var(--text-secondary);
  font-size: 0.9em;
  transition: transform 0.25s;
}

.todo-section-header:hover .todo-toggle {
  color: var(--accent);
}

.todo-item {
  display: flex;
  align-items: center;
  margin-bottom: 1.1em;
  font-size: 1.07em;
  gap: 0.8em;
  transition: color 0.2s;
  word-break: break-word;
}

.todo-item:last-child {
  margin-bottom: 0;
}

.todo-checkbox {
  accent-color: var(--accent);
  width: 1.2em;
  height: 1.2em;
  cursor: pointer;
  flex-shrink: 0;
}

.todo-done {
  text-decoration: line-through;
  color: var(--text-secondary);
  opacity: 0.62;
}

.todo-collapsed {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s, margin 0.3s, padding 0.3s;
  margin-top: 0;
  padding-top: 0;
  padding-bottom: 0;
}

.todo-expanded {
  max-height: 800px;
  transition: max-height 0.35s, margin 0.35s, padding 0.35s;
  margin-top: 0.8em;
}

/* ==========================================================================
  Updates Panel
  ========================================================================== */
#updates-panel {
  position: fixed;
  top: 0;
  right: -370px;
  width: 340px;
  max-width: 90vw;
  height: 100vh;
  background: var(--bg-light);
  box-shadow: -2px 0 24px rgba(0, 0, 0, 0.23);
  color: var(--text-primary);
  z-index: 1801;
  padding: 0;
  display: flex;
  flex-direction: column;
  transition: right 0.38s cubic-bezier(.8, .1, .2, 1);
}

#updates-panel.open {
  right: 0;
}

.updates-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: var(--bg-dark);
  padding: 1.1em 1.4em 1em 1.4em;
  font-size: 1.2em;
  font-weight: bold;
  border-bottom: 1px solid var(--accent);
  flex-shrink: 0;
}

#updates-close {
  background: none;
  border: none;
  color: var(--accent);
  font-size: 1.5em;
  cursor: pointer;
  transition: color 0.2s;
}

#updates-close:hover {
  color: #fff;
}

#updates-list {
  flex: 1;
  overflow-y: auto;
  padding: 1.2em 1.5em;
  scrollbar-width: thin;
  scrollbar-color: var(--accent) var(--bg-dark);
}

#updates-list::-webkit-scrollbar {
  width: 8px;
}

#updates-list::-webkit-scrollbar-thumb {
  background: var(--accent);
  border-radius: 4px;
}

.update-item {
  margin-bottom: 1.5em;
  padding-bottom: 1em;
  border-bottom: 1px solid var(--border-color);
}

.update-item:last-child {
  border-bottom: none;
  margin-bottom: 0;
  padding-bottom: 0;
}

.update-date {
  font-size: 0.92em;
  color: var(--text-muted);
  margin-bottom: 0.2em;
}

.update-title {
  font-weight: 600;
  color: var(--accent);
  margin-bottom: 0.3em;
}

.update-details {
  font-size: 1em;
  color: var(--text-secondary);
}

/* Grouped updates styling */
.update-list {
  margin-top: 0.5em;
}
.update-list .update-title {
  font-weight: 600;
  color: var(--accent);
  margin-top: 0.7em;
  margin-bottom: 0.2em;
}
.update-list .update-title:first-child {
  margin-top: 0;
}
.update-list .update-details {
  font-size: 1em;
  color: var(--text-secondary);
  margin-bottom: 0.5em;
}

/* ==========================================================================
  Responsive Design
  ========================================================================== */
@media (max-width: 768px) {
  .toolbar {
   padding: 0 0.5rem;
   justify-content: center;
  }
  #media-search {
   flex-basis: 180px;
  }
  .gallery-controls {
   flex-basis: auto;
  }
  .overlay h1 {
   font-size: 2.2rem;
  }
  .gallery.gallery-grid-view {
   grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
   gap: 1.5rem;
  }
  .gallery-grid-view .media-container,
  .gallery-grid-view .audio-content-area {
   height: 180px;
  }
  .gallery-grid-view.gallery-thumbnails-small .media-container,
  .gallery-grid-view.gallery-thumbnails-small .audio-content-area {
   height: 130px;
  }
  .gallery-grid-view.gallery-thumbnails-large .media-container,
  .gallery-grid-view.gallery-thumbnails-large .audio-content-area {
   height: 220px;
  }
  .lightbox-close {
   top: 15px;
   right: 15px;
   font-size: 2.2rem;
  }
  main {
   padding: 1.5rem;
  }
}

@media (max-width: 600px) {
  .toolbar {
   margin-bottom: 1.2rem;
   flex-direction: column;
   align-items: center;
   gap: 1rem;
  }
  #media-search {
   max-width: 100%;
   min-width: auto;
   width: 100%;
   flex-grow: 0;
   height: 42px;
   padding: 0 1rem;
   font-size: 0.9rem;
   line-height: 42px;
   flex-basis: auto;
  }
  .gallery-controls {
   justify-content: center;
   width: 100%;
  }
  .control-button.icon-button {
   padding: 0.5rem;
  }
  .tab-list {
   font-size: 0.98em;
   padding-left: 0.4rem;
   gap: 0.3rem;
  }
  .tab {
   padding: 0.38em 0.7em;
   font-size: 0.97em;
  }
  main {
   padding: 1rem;
  }
  .info-modal-content-reimplemented {
   padding: 1.5rem;
   width: calc(100% - 30px);
  }
  .info-modal-title-reimplemented {
   font-size: 1.7rem;
  }
  .info-modal-text-reimplemented,
  .info-modal-contact-reimplemented {
   font-size: 1rem;
  }
  .info-modal-close-button-reimplemented {
   font-size: 2.2rem;
   top: 5px;
   right: 5px;
  }
  .lightbox-content audio {
   width: 90%;
  }
}

@media (max-width: 480px) {
  .overlay h1 {
   font-size: 1.8rem;
  }
  .gallery.gallery-grid-view {
   grid-template-columns: 1fr;
   gap: 1rem;
  }
  .gallery-grid-view .media-container,
  .gallery-grid-view .audio-content-area {
   height: 160px;
  }
  .gallery-grid-view.gallery-thumbnails-small .media-container,
  .gallery-grid-view.gallery-thumbnails-small .audio-content-area {
   height: 120px;
  }
  .gallery-grid-view.gallery-thumbnails-large .media-container,
  .gallery-grid-view.gallery-thumbnails-large .audio-content-area {
   height: 200px;
  }
  #todo-panel {
   width: 94vw;
   min-width: 0;
   right: -100vw;
  }
  .gallery-controls {
   flex-direction: column;
   align-items: center;
   width: auto;
  }
  .gallery-controls .control-button.icon-button {
   margin-bottom: 0.5rem;
  }
}

/* ==========================================================================
  Work In Progress Placeholder Styles
  ========================================================================== */
.work-in-progress-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 2rem 1rem;
  color: var(--text-secondary);
  min-height: 350px;
  border: 2px dashed var(--border-color);
  border-radius: 12px;
  margin: 1rem auto;
  max-width: 700px;
  box-sizing: border-box;
}

.wip-emoji {
  font-size: 3.5rem;
  margin-bottom: 1.5rem;
  line-height: 1;
}

.wip-title {
  font-size: 2rem;
  color: var(--text-primary);
  margin-bottom: 1rem;
  font-weight: 500;
}

.wip-message {
  font-size: 1.1rem;
  line-height: 1.7;
  max-width: 90%;
  color: var(--text-secondary);
}

.gallery.gallery-list-view .work-in-progress-container {
  width: 100%;
}

/* ==========================================================================
  Easter Egg Styles
  ========================================================================== */
.fab-easter-egg-popup {
  position: fixed;
  bottom: 100px;
  right: 30px;
  background-color: var(--accent);
  color: var(--bg-dark);
  padding: 10px 15px;
  border-radius: 8px;
  box-shadow: 0 4px 15px rgba(0,0,0,0.25);
  z-index: 9990;
  opacity: 0;
  transform: translateY(15px) scale(0.95);
  transition: opacity 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275),
          transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  pointer-events: none;
  font-size: 0.9rem;
  font-weight: 500;
}

.fab-easter-egg-popup.show {
  opacity: 1;
  transform: translateY(0) scale(1);
}

/* ==========================================================================
  Responsive Rickroll iframe in Lightbox
  ========================================================================== */
.lightbox-content iframe {
  display: block;
  border: none;
  width: 100%;
  max-width: 854px;
  height: auto;
  aspect-ratio: 16 / 9;
  margin: auto;
}

.lightbox-content.lightbox-content-rickroll {
  padding: 0;
  background: #000;
}
