/* ==========================================================================
   DROESKE BROTHERS CAMPING TRIP - MODERN MUSIC LOOKUP
   Mobile-first, modern responsive styling with dark mode support
   ========================================================================== */

:root {
  --font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --bg-primary: #f5f8f6;
  --bg-surface: #ffffff;
  --bg-surface-secondary: #ebf1ee;
  --border-color: #d1ded8;
  --border-focus: #1f6f50;

  --text-primary: #192720;
  --text-secondary: #4a6156;
  --text-muted: #728c81;

  --brand-primary: #1f6f50;
  --brand-primary-hover: #16533c;
  --brand-accent: #c66928;
  --brand-accent-hover: #a8541c;
  --badge-bg: #e2ede8;
  --badge-text: #17543d;

  --danger: #d32f2f;
  --danger-bg: #fde8e8;
  --warning-bg: #fff8e1;
  --warning-border: #ffd54f;
  --warning-text: #8d6e00;

  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.08), 0 2px 4px -1px rgba(0, 0, 0, 0.04);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --radius-full: 9999px;

  --transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

[data-theme="dark"] {
  --bg-primary: #0f1613;
  --bg-surface: #17221d;
  --bg-surface-secondary: #213029;
  --border-color: #2b3d35;
  --border-focus: #34a87a;

  --text-primary: #e6ede9;
  --text-secondary: #a3bbb0;
  --text-muted: #728c81;

  --brand-primary: #34a87a;
  --brand-primary-hover: #43bd8c;
  --brand-accent: #e07d3b;
  --brand-accent-hover: #f09050;
  --badge-bg: #21382d;
  --badge-text: #59dca5;

  --danger-bg: #3d1b1b;
  --warning-bg: #2d2613;
  --warning-border: #63501a;
  --warning-text: #ffca28;

  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.4);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.5);
}

/* Base resets */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: var(--font-family);
  background-color: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* Container */
.container {
  width: 100%;
  max-width: 1100px;
  margin: 0 auto;
  padding: 1rem;
}

/* Top App Bar */
.app-header {
  background-color: var(--bg-surface);
  border-bottom: 1px solid var(--border-color);
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: var(--shadow-sm);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem 1rem;
  max-width: 1100px;
  margin: 0 auto;
  gap: 1rem;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  text-decoration: none;
  color: var(--text-primary);
}

.brand-icon {
  font-size: 1.6rem;
}

.brand-title {
  font-size: 1.15rem;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.brand-subtitle {
  font-size: 0.8rem;
  color: var(--text-muted);
  display: block;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  padding: 0.55rem 1rem;
  border-radius: var(--radius-md);
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  border: 1px solid transparent;
  transition: var(--transition);
  text-decoration: none;
  white-space: nowrap;
}

.btn-primary {
  background-color: var(--brand-primary);
  color: white;
}

.btn-primary:hover {
  background-color: var(--brand-primary-hover);
}

.btn-accent {
  background-color: var(--brand-accent);
  color: white;
}

.btn-accent:hover {
  background-color: var(--brand-accent-hover);
}

.btn-outline {
  background-color: transparent;
  border-color: var(--border-color);
  color: var(--text-primary);
}

.btn-outline:hover {
  background-color: var(--bg-surface-secondary);
}

.btn-icon {
  padding: 0.55rem;
  border-radius: var(--radius-full);
  color: var(--text-secondary);
  border: 1px solid var(--border-color);
  background: var(--bg-surface);
}

.btn-icon:hover {
  background: var(--bg-surface-secondary);
}

/* Search Card */
.search-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 1.25rem;
  margin: 1.25rem 0;
  box-shadow: var(--shadow-sm);
}

.search-input-wrapper {
  position: relative;
  display: flex;
  align-items: center;
  margin-bottom: 0.75rem;
}

.search-icon {
  position: absolute;
  left: 1rem;
  font-size: 1.1rem;
  color: var(--text-muted);
  pointer-events: none;
}

.search-input {
  width: 100%;
  padding: 0.85rem 2.8rem 0.85rem 2.8rem;
  font-size: 1.05rem;
  border: 2px solid var(--border-color);
  border-radius: var(--radius-md);
  background: var(--bg-surface);
  color: var(--text-primary);
  transition: var(--transition);
}

.search-input:focus {
  outline: none;
  border-color: var(--border-focus);
  box-shadow: 0 0 0 3px rgba(31, 111, 80, 0.15);
}

.search-clear {
  position: absolute;
  right: 0.75rem;
  background: none;
  border: none;
  font-size: 1.1rem;
  color: var(--text-muted);
  cursor: pointer;
  padding: 0.3rem 0.5rem;
  display: none;
}

.search-clear.visible {
  display: block;
}

/* Category Filter Pills */
.filter-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
  justify-content: space-between;
}

.filter-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.pill {
  padding: 0.35rem 0.75rem;
  font-size: 0.82rem;
  border-radius: var(--radius-full);
  border: 1px solid var(--border-color);
  background: var(--bg-surface-secondary);
  color: var(--text-secondary);
  cursor: pointer;
  font-weight: 500;
  transition: var(--transition);
}

.pill:hover {
  border-color: var(--text-muted);
}

.pill.active {
  background: var(--brand-primary);
  color: white;
  border-color: var(--brand-primary);
}

.year-select {
  padding: 0.4rem 0.8rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
  background: var(--bg-surface);
  color: var(--text-primary);
  font-size: 0.85rem;
  font-weight: 500;
  cursor: pointer;
}

.advanced-filters {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.65rem;
  margin-top: 0.85rem;
  padding-top: 0.85rem;
  border-top: 1px solid var(--border-color);
}

.advanced-filter-details {
  margin-top: 0.85rem;
  border-top: 1px solid var(--border-color);
}

.advanced-filter-details summary {
  padding-top: 0.85rem;
  color: var(--text-secondary);
  cursor: pointer;
  font-size: 0.85rem;
  font-weight: 600;
  user-select: none;
}

.advanced-filter-details[open] summary {
  margin-bottom: 0.85rem;
}

.advanced-filter-details .advanced-filters {
  margin-top: 0;
  padding-top: 0;
  border-top: none;
}

.filter-hint {
  grid-column: 1 / -1;
  margin: 0;
  color: var(--text-muted);
  font-size: 0.78rem;
}

.filter-field {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  color: var(--text-secondary);
  font-size: 0.75rem;
  font-weight: 600;
}

.filter-field input,
.filter-field select {
  min-width: 0;
  padding: 0.45rem 0.6rem;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  background: var(--bg-surface);
  color: var(--text-primary);
  font: inherit;
  font-weight: 400;
}

.year-range-fields {
  grid-column: span 2;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.65rem;
}

.year-range-fields[hidden],
.filter-field[hidden] {
  display: none;
}

.clear-filters {
  align-self: end;
  padding: 0.45rem 0.7rem;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  background: var(--bg-surface-secondary);
  color: var(--text-secondary);
  cursor: pointer;
  font: inherit;
}

.clear-filters:hover {
  border-color: var(--brand-primary);
  color: var(--brand-primary);
}

@media (max-width: 900px) {
  .advanced-filters {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 520px) {
  .advanced-filters {
    grid-template-columns: 1fr;
  }

  .year-range-fields {
    grid-column: span 1;
  }
}

/* Duplicate Match Alert */
.duplicate-alert {
  display: none;
  background-color: var(--warning-bg);
  border: 1px solid var(--warning-border);
  color: var(--warning-text);
  padding: 0.85rem 1.1rem;
  border-radius: var(--radius-md);
  margin-bottom: 1rem;
  font-size: 0.92rem;
}

.duplicate-alert.visible {
  display: block;
}

.duplicate-alert strong {
  color: #bf360c;
}

/* Controls Header (Results count, view toggle, export) */
.results-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.75rem;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.results-count {
  font-size: 0.95rem;
  color: var(--text-secondary);
  font-weight: 600;
}

.results-tools {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.page-size-control {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  color: var(--text-secondary);
  font-size: 0.85rem;
  font-weight: 600;
}

.page-size-select {
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 0.4rem 0.55rem;
  background: var(--bg-surface);
  color: var(--text-primary);
  font-size: 0.85rem;
}

.view-toggle {
  display: inline-flex;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  overflow: hidden;
}

.view-btn {
  background: var(--bg-surface);
  border: none;
  padding: 0.4rem 0.7rem;
  cursor: pointer;
  color: var(--text-secondary);
  font-size: 0.85rem;
  display: flex;
  align-items: center;
  gap: 0.3rem;
}

.view-btn.active {
  background: var(--brand-primary);
  color: white;
}

.pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  margin: 0 0 2rem;
}

.pagination-btn {
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 0.45rem 0.75rem;
  background: var(--bg-surface);
  color: var(--text-primary);
  cursor: pointer;
  font-size: 0.85rem;
}

.pagination-btn:hover:not(:disabled) {
  border-color: var(--brand-primary);
  color: var(--brand-primary);
}

.pagination-btn:disabled {
  cursor: not-allowed;
  opacity: 0.45;
}

.page-status {
  min-width: 7rem;
  text-align: center;
  color: var(--text-secondary);
  font-size: 0.85rem;
  font-weight: 600;
}

/* Data Table (Desktop View) */
.table-wrapper {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  overflow-x: auto;
  box-shadow: var(--shadow-sm);
  margin-bottom: 2rem;
}

.songs-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 0.92rem;
}

.songs-table th {
  background: var(--bg-surface-secondary);
  padding: 0.85rem 1rem;
  font-weight: 600;
  color: var(--text-primary);
  border-bottom: 2px solid var(--border-color);
  white-space: nowrap;
  user-select: none;
  cursor: pointer;
  transition: var(--transition);
}

.songs-table th:hover {
  color: var(--brand-primary);
}

.songs-table th .sort-icon {
  margin-left: 0.3rem;
  font-size: 0.8rem;
  color: var(--text-muted);
}

.songs-table th.sorted-asc .sort-icon::after {
  content: " ▲";
  color: var(--brand-primary);
}

.songs-table th.sorted-desc .sort-icon::after {
  content: " ▼";
  color: var(--brand-primary);
}

.songs-table td {
  padding: 0.85rem 1rem;
  border-bottom: 1px solid var(--border-color);
  color: var(--text-primary);
}

.title-cell {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
}

.youtube-link {
  color: var(--brand-primary);
  font-size: 0.75rem;
  font-weight: 700;
  text-decoration: none;
  white-space: nowrap;
}

.youtube-link:hover {
  text-decoration: underline;
}

.card-youtube-link {
  font-size: 0.8rem;
}

.songs-table tbody tr:last-child td {
  border-bottom: none;
}

.songs-table tbody tr:hover {
  background-color: var(--bg-surface-secondary);
}

/* Badges */
.badge-year {
  display: inline-block;
  padding: 0.2rem 0.6rem;
  border-radius: var(--radius-full);
  font-size: 0.8rem;
  font-weight: 700;
  background: var(--badge-bg);
  color: var(--badge-text);
  white-space: nowrap;
}

.badge-owner {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  font-size: 0.85rem;
  color: var(--text-secondary);
  font-weight: 500;
}

/* Mobile Cards View */
.cards-wrapper {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.75rem;
  margin-bottom: 2rem;
}

@media (min-width: 640px) {
  .cards-wrapper {
    grid-template-columns: repeat(2, 1fr);
  }
}

.song-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1rem;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  transition: var(--transition);
}

.song-card:hover {
  border-color: var(--brand-primary);
  box-shadow: var(--shadow-md);
}

.card-title {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text-primary);
}

.card-artist {
  font-size: 0.95rem;
  color: var(--brand-primary);
  font-weight: 600;
}

.card-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 0.3rem;
  padding-top: 0.5rem;
  border-top: 1px dashed var(--border-color);
  font-size: 0.85rem;
}

.card-notes {
  font-size: 0.82rem;
  color: var(--text-muted);
  font-style: italic;
  margin-top: 0.2rem;
}

/* Photo Carousel Section */
.gallery-section {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  margin-top: 2rem;
  margin-bottom: 2rem;
  box-shadow: var(--shadow-sm);
}

.gallery-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1rem;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.gallery-title {
  font-size: 1.2rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.carousel-container {
  position: relative;
  width: 100%;
  max-width: 800px;
  margin: 0 auto;
  overflow: hidden;
  border-radius: var(--radius-md);
  background: #000;
}

.carousel-track {
  display: flex;
  transition: transform 0.4s ease-in-out;
  touch-action: pan-y;
}

.carousel-slide {
  min-width: 100%;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #000;
  cursor: zoom-in;
}

.carousel-slide img {
  width: 100%;
  max-height: 480px;
  object-fit: contain;
  display: block;
}

.carousel-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(0, 0, 0, 0.6);
  color: white;
  border: none;
  font-size: 1.5rem;
  padding: 0.75rem 1rem;
  cursor: pointer;
  border-radius: var(--radius-sm);
  transition: var(--transition);
  z-index: 10;
}

.carousel-nav:hover {
  background: rgba(0, 0, 0, 0.85);
}

.carousel-prev {
  left: 0.5rem;
}

.carousel-next {
  right: 0.5rem;
}

.carousel-pause {
  left: 50%;
  right: auto;
  transform: translate(-50%, -50%);
  opacity: 0;
  pointer-events: none;
}

.carousel-container:hover .carousel-pause,
.carousel-pause:focus-visible {
  opacity: 1;
  pointer-events: auto;
}

.carousel-container:hover .carousel-pause:hover {
  transform: translate(-50%, -50%);
}

.carousel-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 0.75rem;
  font-size: 0.85rem;
  color: var(--text-muted);
}

/* Lightbox Modal */
.lightbox-modal {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.92);
  z-index: 1000;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

.lightbox-modal.active {
  display: flex;
}

.lightbox-img {
  max-width: 95vw;
  max-height: 90vh;
  object-fit: contain;
  border-radius: var(--radius-sm);
}

.lightbox-close {
  position: absolute;
  top: 1.5rem;
  right: 1.5rem;
  background: rgba(255, 255, 255, 0.2);
  color: white;
  border: none;
  border-radius: var(--radius-full);
  width: 2.5rem;
  height: 2.5rem;
  font-size: 1.4rem;
  cursor: pointer;
}

/* Classic Jokes & Footers */
.trip-quotes {
  text-align: center;
  padding: 1.5rem 1rem;
  margin: 1.5rem 0;
  background: var(--bg-surface-secondary);
  border-radius: var(--radius-md);
  font-size: 0.95rem;
  color: var(--text-secondary);
}

.quote-highlight {
  font-weight: 700;
  color: var(--brand-accent);
  letter-spacing: 0.03em;
  margin-bottom: 0.4rem;
}

.credits-text {
  font-size: 0.85rem;
  color: var(--text-muted);
  line-height: 1.4;
}

/* Add Song Modal */
.modal-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(2px);
  z-index: 200;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

.modal-backdrop.active {
  display: flex;
}

.modal-dialog {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 480px;
  padding: 1.5rem;
  box-shadow: var(--shadow-lg);
  animation: modalIn 0.2s ease-out;
}

@keyframes modalIn {
  from { opacity: 0; transform: translateY(15px); }
  to { opacity: 1; transform: translateY(0); }
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.25rem;
}

.modal-title {
  font-size: 1.15rem;
  font-weight: 700;
}

.modal-close {
  background: none;
  border: none;
  font-size: 1.3rem;
  color: var(--text-muted);
  cursor: pointer;
}

.form-group {
  margin-bottom: 1rem;
}

.form-label {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  margin-bottom: 0.35rem;
  color: var(--text-primary);
}

.form-control {
  width: 100%;
  padding: 0.65rem 0.85rem;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  font-size: 0.95rem;
  background: var(--bg-surface);
  color: var(--text-primary);
  font-family: inherit;
}

.form-control:focus {
  outline: none;
  border-color: var(--border-focus);
}

.form-actions {
  display: flex;
  justify-content: flex-end;
  gap: 0.75rem;
  margin-top: 1.25rem;
}

/* Toast Notifications */
.toast-container {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  z-index: 500;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.toast {
  background: var(--text-primary);
  color: var(--bg-surface);
  padding: 0.75rem 1.25rem;
  border-radius: var(--radius-md);
  font-size: 0.9rem;
  font-weight: 500;
  box-shadow: var(--shadow-lg);
  animation: toastIn 0.3s ease-out;
}

@keyframes toastIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Footer */
.site-footer {
  margin-top: auto;
  border-top: 1px solid var(--border-color);
  background: var(--bg-surface);
  padding: 1.5rem 1rem;
  text-align: center;
  font-size: 0.85rem;
  color: var(--text-muted);
}

.footer-links {
  display: flex;
  justify-content: center;
  gap: 1.25rem;
  margin-bottom: 0.5rem;
}

.footer-links a {
  color: var(--brand-primary);
  text-decoration: none;
  font-weight: 500;
}

.footer-links a:hover {
  text-decoration: underline;
}

/* Empty State */
.empty-state {
  text-align: center;
  padding: 3rem 1rem;
  color: var(--text-muted);
}

.empty-state-icon {
  font-size: 3rem;
  margin-bottom: 0.75rem;
}

/* Responsive Utilities */
@media (max-width: 767px) {
  .hide-on-mobile {
    display: none !important;
  }
}

@media (min-width: 768px) {
  .hide-on-desktop {
    display: none !important;
  }
}
