:root {
    --primary: rgba(29, 185, 84, 1);           /* Spotify Green */
    --primary-light: rgba(30, 215, 96, 1);     /* Bright Green */
    --primary-dark: rgba(22, 156, 70, 1);      /* Dark Green */
    --secondary: rgba(83, 83, 83, 1);          /* Medium Gray */
    --background: rgba(255, 255, 255, 1);      /* White */
    --surface: rgba(246, 246, 246, 1);         /* Light Gray */
    --text-primary: rgba(0, 0, 0, 1);          /* Black */
    --text-secondary: rgba(106, 106, 106, 1);  /* Gray */
    --divider: rgba(217, 217, 217, 1);         /* Light Divider */
    --error: rgba(226, 33, 52, 1);             /* Red */
    --shadow-light: rgba(0, 0, 0, 0.08);       /* Light shadow */
    --shadow-medium: rgba(0, 0, 0, 0.12);      /* Medium shadow */
    --shadow-strong: rgba(0, 0, 0, 0.2);       /* Strong shadow */
    --hover-overlay: rgba(29, 185, 84, 0.1);   /* Green hover overlay */
    --card-overlay: rgb(83, 83 ,83 , 0.08);    /* Light gray overlay for cards */
    --modal-overlay: rgba(0, 0, 0, 0.8);       /* Modal backdrop */
    --subtle-overlay: rgba(0, 0, 0, 0.03);     /* Very subtle overlay */
    --danger-hover: rgba(220, 53, 69, 0.1);    /* Danger button hover */
    --focus-ring: rgba(29, 185, 84, 0.12);     /* Focus ring for inputs */
    --spinner-track: rgba(29, 185, 84, 0.2);   /* Spinner background track */
    --fullscreen-overlay: rgba(255, 255, 255, 0.97); /* Lyrics fullscreen background */
    --input-color-scheme: auto;
}

/* Dark mode color scheme - Spotify style */
body.dark-mode {
    --primary: rgba(29, 185, 84, 1);           /* Spotify Green */
    --primary-light: rgba(30, 215, 96, 1);     /* Bright Green */
    --primary-dark: rgba(22, 156, 70, 1);      /* Dark Green */
    --secondary: rgba(83, 83, 83, 1);          /* Medium Gray */
    --background: rgba(18, 18, 18, 1);         /* Spotify Black */
    --surface: rgba(24, 24, 24, 1);            /* Dark Surface */
    --text-primary: rgba(255, 255, 255, 1);    /* White */
    --text-secondary: rgba(179, 179, 179, 1);  /* Light Gray */
    --divider: rgba(40, 40, 40, 1);            /* Dark Divider */
    --error: rgba(226, 33, 52, 1);             /* Red */
    --shadow-light: rgba(0, 0, 0, 0.3);        /* Light shadow (darker for dark mode) */
    --shadow-medium: rgba(0, 0, 0, 0.5);       /* Medium shadow */
    --shadow-strong: rgba(0, 0, 0, 0.7);       /* Strong shadow */
    --hover-overlay: rgba(29, 185, 84, 0.15);  /* Green hover overlay */
    --card-overlay: rgb(83, 83, 83, 0.29);     /* Light gray overlay for cards in dark mode */
    --modal-overlay: rgba(0, 0, 0, 0.8);       /* Darker modal backdrop */
    --subtle-overlay: rgba(255, 255, 255, 0.05); /* Very subtle light overlay for dark mode */
    --danger-hover: rgba(220, 53, 69, 0.15);   /* Danger button hover (brighter for dark) */
    --focus-ring: rgba(29, 185, 84, 0.15);     /* Focus ring for inputs (brighter in dark) */
    --spinner-track: rgba(29, 185, 84, 0.25);  /* Spinner background track (brighter) */
    --fullscreen-overlay: rgba(18, 18, 18, 0.97); /* Lyrics fullscreen background (dark) */
    --input-color-scheme: dark;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;
}

body {
    background-color: var(--background);
    color: var(--text-primary);
    height: 100vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.app-container {
    display: flex;
    flex-direction: column;
    height: 100%;
    max-width: 100%;
}

/* Header */
.app-header {
    background-color: var(--primary);
    color: white;
    padding: 10px 20px;
    text-align: center;
    font-size: 1.5rem;
    font-weight: 500;
    box-shadow: 0 2px 4px var(--shadow-light);
    z-index: 10;
}

/* Main Content */
.main-content {
    flex: 1;
    overflow-y: auto;
    padding: 12px;
    padding-bottom: 80px; /* Space for bottom nav */
}

/* Tab Content */
.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
    animation: fadeIn 0.3s ease;
}

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

/* Card Styles */
.card {
    background: var(--surface);
    border-radius: 16px;
    box-shadow: 0 4px 12px var(--shadow-light);
    padding: 12px;
    margin-bottom: 20px;
    transition: transform 0.2s, box-shadow 0.2s;
}

.card:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px var(--shadow-medium);
}

.card-title {
    font-size: 1.3rem;
    font-weight: 600;
    margin-bottom: 16px;
    color: var(--primary);
    display: flex;
    align-items: center;
    gap: 10px;
}

.card-title i {
    font-size: 1.5rem;
}

/* Override card hover for song detail main card */
.song-detail-main:hover {
    transform: none;
    box-shadow: 0 4px 12px var(--shadow-light); /* Keep base shadow, no change on hover */
}

/* Ensure child hovers still work */
.song-detail-main .action-btn:hover,
.song-detail-main .play-recording-btn:hover,
.song-detail-main .back-button:hover,
.song-detail-main .btn:hover {
    transform: none; /* Or keep if desired, but disable parent transform */
}

/* Group Management */
.group-header {
    display: flex;
    align-items: center;
    margin-bottom: 20px;
}

.group-logo {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary), var(--primary-light));
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 2.5rem;
    margin-right: 20px;
    box-shadow: 0 4px 8px var(--shadow-strong);
}

.group-info h2 {
    font-size: 1.8rem;
    margin-bottom: 8px;
}

.group-info p {
    color: var(--text-secondary);
}

/* Compact Group Header */
.group-header-compact {
    display: flex;
    align-items: center;
    padding: 16px;
    background: var(--card-overlay);
    border-radius: 12px;
    margin-bottom: 20px;
    cursor: pointer;
    transition: all 0.3s ease;
    border: 1px solid var(--divider);
    min-height: 60px;
}

.group-header-compact:hover {
    background: var(--hover-overlay);
    transform: translateY(-2px);
    box-shadow: 0 4px 8px var(--shadow-light);
}

.group-header-content {
    display: flex;
    align-items: center;
    flex-grow: 1;
}

.group-logo-compact {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary), var(--primary-light));
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 2rem;
    margin-right: 15px;
    flex-shrink: 0;
}

.group-info-compact {
    display: flex;
    flex-direction: column;
    justify-content: center;
    flex-grow: 1;
    min-width: 0;
}

.group-info-compact h2 {
    font-size: 1.4rem;
    margin: 0;
    line-height: 1.3;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.group-info-compact p {
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin: 0;
    line-height: 1.3;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.expand-icon {
    margin-left: auto;
    transition: transform 0.3s ease;
    color: var(--text-secondary);
    flex-shrink: 0;
}

/* Expanded state - keep logo and info on same row */
.group-header-compact.expanded {
    flex-direction: column;
    align-items: stretch;
    padding: 16px;
}

.group-header-compact.expanded .group-header-content {
    width: 100%;
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: center;
    margin-bottom: 15px;
}

.group-header-compact.expanded .group-logo-compact {
    margin-right: 15px;
    margin-bottom: 0;
    align-self: center;
    flex-shrink: 0;
}

.group-header-compact.expanded .group-info-compact {
    width: auto;
    margin-bottom: 0;
    align-items: center;
    text-align: center;
}

.group-header-compact.expanded .expand-icon {
    transform: rotate(180deg);
    margin-top: 10px;
    align-self: center;
}

/* Expanded Members List */
.group-header-compact.expanded .musician-list {
    margin-top: 10px;
    border-top: 1px solid var(--divider);
    padding-top: 20px;
}

.group-header-compact.expanded .musician-item {
    padding: 12px 0;
    border-bottom: 1px solid var(--divider);
    display: flex;
    align-items: center;
}

.group-header-compact.expanded .musician-item:last-child {
    border-bottom: none;
}

.group-header-compact.expanded .musician-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--primary-light);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    margin-right: 15px;
    font-weight: bold;
}

.group-header-compact.expanded .musician-details h3 {
    font-size: 1.1rem;
    margin-bottom: 4px;
}

.group-header-compact.expanded .musician-details p {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

/* Ensure group header items stay in same row when expanded */
.group-header-compact.expanded .group-logo-compact,
.group-header-compact.expanded .group-info-compact {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: center;
}

.group-header-compact.expanded .group-info-compact {
    flex-direction: column;
    text-align: center;
    align-items: flex-start;
}

.musician-list {
    list-style: none;
}

.musician-item {
    display: flex;
    align-items: center;
    padding: 12px 0;
    border-bottom: 1px solid var(--divider);
}

.musician-item:last-child {
    border-bottom: none;
}

.musician-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--primary-light);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    margin-right: 15px;
    font-weight: bold;
}

.musician-details h3 {
    font-size: 1.1rem;
    margin-bottom: 4px;
}

.musician-details p {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

/* Songs and Setlists */
.song-item, .setlist-item {
    padding: 14px;
    border-radius: 12px;
    background: var(--card-overlay);
    margin-bottom: 10px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.setlist-item.past-concert {
    opacity: 0.6;
}

.setlist-item.past-concert:hover {
    opacity: 0.8;
}

.song-info, .setlist-info {
    flex: 1;
    min-width: 0;
}

.song-info h3, .song-order h3, .setlist-info h3 {
    font-size: 1.2rem;
    margin-bottom: 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.song-info p, .setlist-info p {
    color: var(--text-secondary);
    font-size: 0.95rem;
}

.song-duration {
    color: var(--text-secondary);
    font-size: 0.95rem;
    padding-right: 8px;
    padding-left: 8px;
    flex-shrink: 0;
}

.song-actions, .setlist-actions {
    display: flex;
    gap: 12px;
    flex-shrink: 0;
}

.setlist-summary, .songs-summary {
    font-size: 0.95rem;
    color: var(--text-secondary);
    margin-bottom: 12px;
}

.action-btn {
    background: none;
    border: none;
    color: var(--primary);
    cursor: pointer;
    font-size: 1.2rem;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
}

.action-btn:hover {
    background: var(--hover-overlay);
}

.action-btn-primary {
    border: none;
    background-color: var(--secondary);
    color: white;    
    cursor: pointer;
    font-size: 1.2rem;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
}

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

/* Setlist Detail View */
.setlist-detail {
    display: none;
}

.setlist-detail.active {
    display: block;
}

.back-button {
    display: flex;
    align-items: center;
    color: var(--primary);
    margin-bottom: 20px;
    cursor: pointer;
    font-weight: 500;
    gap: 8px;
}

.song-order {
    display: flex;
    align-items: center;
    margin-bottom: 12px;
    /*padding: 12px;*/
    background: var(--surface);
    border-radius: 12px;
}

.order-number {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    /*background: var(--secondary);*/
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 16px;
    font-weight: bold;
}

/* Settings */
.settings-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 20px;
}

.setting-item {
    background: var(--surface);
    border-radius: 16px;
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.setting-item h3 {
    font-size: 1.1rem;
    display: flex;
    align-items: center;
    gap: 10px;
}

.setting-item p {
    color: var(--text-secondary);
    font-size: 0.95rem;
}

.setting-item select {
    color: var(--text-primary);
    padding: 8px;
    border-radius: 6px;
    border: 1px solid var(--divider);
    background: var(--background);
}

.toggle-switch {
    position: relative;
    display: inline-block;
    width: 50px;
    height: 24px;
}

.toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: var(--divider);
    transition: .4s;
    border-radius: 24px;
}

.slider:before {
    position: absolute;
    content: "";
    height: 16px;
    width: 16px;
    left: 4px;
    bottom: 4px;
    background-color: var(--background);
    transition: .4s;
    border-radius: 50%;
}

input:checked + .slider {
    background-color: var(--primary);
}

input:checked + .slider:before {
    transform: translateX(26px);
}

/* Bottom Navigation */
.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: var(--surface);
    display: flex;
    justify-content: space-around;
    padding: 12px 0;
    box-shadow: 0 -2px 10px var(--shadow-light);
    z-index: 100;
}

.nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.8rem;
    padding: 4px 8px;
    border-radius: 8px;
    transition: all 0.2s;
}

.nav-item.active {
    color: var(--primary);
}

.nav-item i {
    font-size: 1.8rem;
    margin-bottom: 4px;
}

/* Bottom Audio Player - App Theme Style */
.bottom-player {
    position: fixed;
    bottom: 80px; /* Above bottom nav, adjust if nav height changes */
    left: 0;
    right: 0;
    background: var(--surface);
    border-top: 1px solid var(--divider);
    color: var(--text-primary);
    z-index: 100;
    display: flex;
    align-items: center;
    padding: 0 16px;
    height: 70px;
    box-shadow: 0 -2px 8px var(--shadow-light);
    transition: all 0.3s ease;
}

.bottom-player.hidden {
    display: none;
}

.player-content {
    display: flex;
    align-items: center;
    width: 100%;
    height: 100%;
    justify-content: space-evenly;
}

.player-track-info {
    flex: 1;
    min-width: 0;
    padding-right: 16px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.track-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-bottom: 2px;
    margin-top: 8px;
    justify-content: center;
}

.track-subtitle {
    font-size: 12px;
    color: var(--text-secondary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.player-controls {
    display: flex;
    align-items: center;
    gap: 12px;
    padding-left: 16px;
}

.player-controls-close{
    display: flex;
    align-items: center;
    gap: 12px;
    padding-right: 16px;
}

.player-progress-info {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.player-btn {
    background: none;
    border: none;
    color: var(--text-primary);
    cursor: pointer;
    padding: 8px;
    border-radius: 50%;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    font-size: 24px;
}

.player-btn:hover {
    background-color: var(--hover-overlay);
    transform: scale(1.05);
}

.player-btn:active {
    transform: scale(0.95);
}

#player-play-btn, #player-pause-btn {
    width: 40px;
    height: 40px;
    font-size: 28px;
    background-color: var(--secondary);
    color: white;
    border-radius: 50%;
}

#player-stop-btn, #player-next-btn {
    width: 40px;
    height: 40px;
    font-size: 28px;
    color: var(--text-primary);
    border-radius: 50%;
}

#player-play-btn:hover, #player-pause-btn:hover {
    background-color: var(--primary-dark);
}

/* Fix icon centering for play/pause buttons */
#player-play-btn .material-icons,
#player-pause-btn .material-icons {
    font-size: 24px;
    width: 24px;
    height: 24px;
    line-height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.player-progress-container {
    flex: 2;
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 200px;
}

.progress-bar {
    flex: 1;
    border-radius: 2px;
    cursor: pointer;
    position: relative;
}

.progress-slider {
    width: 100%;
    height: 4px;
    background: transparent;
    outline: none;
    cursor: pointer;
    accent-color: var(--primary);
}

progress {
  accent-color: var(--primary)
}


.time-display {
    font-size: 11px;
    color: var(--text-secondary);
    display: flex;
    justify-content: space-between;
}

/* Adjust main content padding for player */
.main-content {
    padding-bottom: 150px; /* 70px player + 80px nav */
}

/* Material Icons in player */
.player-btn .material-icons {
    font-size: inherit;
    width: inherit;
    height: inherit;
    line-height: inherit;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 40px 20px;
    color: var(--text-secondary);
}

.empty-state i {
    font-size: 4rem;
    margin-bottom: 20px;
    color: var(--primary-light);
}

.empty-state h3 {
    font-size: 1.5rem;
    margin-bottom: 12px;
    color: var(--text-primary);
}

/* Button Styles */
.btn {
    background: var(--primary);
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 8px;
    font-weight: 500;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: background 0.2s;
}

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

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

.btn-outline:hover {
    background: var(--card-overlay);
}

/* Loading Indicator */
.loading {
    text-align: center;
    padding: 40px;
    color: var(--primary);
}

.spinner {
    border: 4px solid var(--spinner-track);
    border-top: 4px solid var(--primary);
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
    margin: 0 auto 20px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Modal Styles */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: var(--modal-overlay);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}

.modal {
  background: var(--surface);
  border-radius: 12px;
  width: 90%;
  max-width: 700px; /* Increased for setlist builder */
  box-shadow: 0 5px 25px var(--shadow-strong);
  display: flex;
  flex-direction: column;
  max-height: 90vh; /* Limit height to 90% of viewport */
}

.modal-header {
  padding: 16px 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid var(--divider);
  flex-shrink: 0; /* Prevent header from shrinking */
}

.modal-header h3 {
  margin: 0;
  font-size: 1.25rem;
}

.close-btn {
  background: none;
  border: none;
  font-size: 1.5rem;
  cursor: pointer;
  color: var(--text-secondary);
  padding: 0;
  width: 30px;
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.close-btn:hover {
  color: var(--text-primary);
}

.modal-body {
  padding: 20px;
  overflow-y: auto; /* This is the key change to enable scrolling */
  flex-grow: 1; /* Allow body to take up available space */
}

.modal-body .form-group {
  margin-bottom: 16px;
}

.modal-body label {
  display: block;
  margin-bottom: 6px;
  font-weight: 500;
  color: var(--text-primary);
}

.modal-body input,
.modal-body select,
.modal-body textarea {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--divider);
  border-radius: 6px;
  font-size: 1rem;
  box-sizing: border-box;
  background: var(--background);
  color: var(--text-primary);
}

.modal-body input:focus,
.modal-body select:focus,
.modal-body textarea:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--focus-ring);
}

.modal-footer {
  padding: 16px 20px;
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  border-top: 1px solid var(--divider);
  flex-shrink: 0; /* Prevent footer from shrinking */
}

/* Fullscreen modal on mobile */
@media (max-width: 768px) {
    .modal {
        width: 100%;
        height: 100%;
        max-width: 100%;
        max-height: 100%;
        border-radius: 0;
    }
}

/* Song Detail Modal */
.song-detail-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: var(--modal-overlay);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.song-detail-modal {
    background: var(--surface);
    border-radius: 12px;
    max-width: 90%;
    max-height: 90%;
    overflow: auto;
    box-shadow: 0 4px 20px var(--shadow-light);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    border-bottom: 1px solid var(--divider);
    background: var(--primary);
    color: white;
}

.modal-header h3 {
    margin: 0;
    font-size: 1.3rem;
}

.close-btn {
    background: none;
    border: none;
    color: white;
    font-size: 1.5rem;
    cursor: pointer;
    padding: 4px 8px;
}

.modal-body {
    padding: 20px;
}

.lyrics-section {
    margin: 15px 0;
}

.lyrics-text {
    white-space: pre-wrap;
    font-family: monospace;
    background: var(--background);
    padding: 10px;
    border-radius: 6px;
    overflow-x: auto;
}

.recordings-list {
    margin: 10px 0;
}

.recording-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 0;
    border-bottom: 1px solid var(--divider);
}

.recording-info h5 {
    margin: 0 0 4px 0;
    font-size: 1rem;
    display: flex;
    align-items: center;
    gap: 6px; /* spacing between name and star */
}

.recording-info p {
    margin: 0;
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.recording-actions {
    display: flex;
    gap: 8px;
}

.author-info h5 {
    margin: 0 0 4px 0;
    font-size: 1rem;
}

.author-info p {
    margin: 0;
    color: var(--text-secondary);
    font-size: 0.9rem;
}

/* Song detail author small display */
.song-author-small, .author-info {
    margin-top: 6px;
    color: var(--text-secondary);
    font-size: 0.95rem;
}

/* Favorite section header and controls */
.favorite-section {
    border: 1px solid var(--divider);
    padding: 6px; /* reduced padding */
    border-radius: 8px;
    margin-bottom: 8px; /* reduced vertical gap */
}
.favorite-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.favorite-controls {
    display: flex;
    gap: 8px;
    align-items: center;
}
.toggle-favorite-btn.small {
    padding: 3px 5px; /* slightly smaller */
    font-size: 0.78rem;
    min-width: 26px;
    background: var(--subtle-overlay);
    border: 1px solid var(--divider);
    color: var(--text-primary);
    opacity: 0.95;
    line-height: 1; /* tighter */
}
.toggle-favorite-btn.small:hover {
    opacity: 1;
    background: var(--hover-overlay);
}
.toggle-favorite-btn .recording-count {
    background: var(--text-secondary);
    color: var(--background);
    border-radius: 999px;
    padding: 2px 6px;
    font-size: 0.7rem;
    margin-left: 6px;
    display: inline-block;
    vertical-align: middle;
}
.favorite-body {
    margin-top: 6px; /* smaller space between header and body */
}
.compact-recording .recording-info h5 {
    margin: 0 0 4px 0;
}

/* Lyrics section styled like a card + monospace lyrics text */
.lyrics-section {
    border: 1px solid var(--divider);
    padding: 8px; /* reduced padding for compactness */
    border-radius: 8px;
    margin: 8px 0;
    background: var(--surface);
}
.lyrics-section h4 {
    margin: 0 0 8px 0;
    color: var(--primary);
}
.lyrics-text {
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, 'Roboto Mono', 'Courier New', monospace;
    white-space: pre-wrap; /* allow wrapping while preserving line breaks */
    background: transparent;
    border: none;
    padding: 0;
    margin: 0;
    color: var(--text-primary);
    font-size: 0.95rem;
}

    /* Lyrics fullscreen button and overlay */
    .lyrics-header {
        display: flex;
        justify-content: space-between;
        align-items: center;
    }
    .lyrics-fullscreen-btn {
        /* Action-style icon button: no visible border box, circular, small */
        background: none;
        border: none;
        color: var(--primary);
        width: 34px;
        height: 34px;
        border-radius: 50%;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        cursor: pointer;
        transition: background 0.16s ease, transform 0.08s ease;
    }
    .lyrics-fullscreen-btn i {
        font-size: 20px;
    }
    .lyrics-fullscreen-btn:hover {
        background: var(--hover-overlay);
    }
    .lyrics-fullscreen-btn:focus {
        outline: none;
        box-shadow: 0 0 0 3px var(--focus-ring);
    }
    .lyrics-fullscreen {
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background: var(--fullscreen-overlay);
        color: var(--text-primary);
        display: none; /* shown when activated */
        z-index: 2000;
        padding: 30px;
        overflow: auto;
    }
    .lyrics-fullscreen[aria-hidden="false"] {
        display: block;
    }
    .lyrics-fullscreen-header {
        display: flex;
        justify-content: space-between;
        align-items: center;
        margin-bottom: 12px;
        border-bottom: 1px solid var(--divider);
    }
    .lyrics-fullscreen-body {
        background: transparent;
    }
    .lyrics-fullscreen .lyrics-text {
        color: var(--text-primary);
        font-size: 1.2rem;
    }
    .lyrics-fullscreen-close {
        background: var(--surface);
        border: 1px solid var(--divider);
        color: var(--text-primary);
    }

/* Checkbox group styling */
.checkbox-group {
    display: flex;
    align-items: center;
    margin: 12px 0;
}

.checkbox-group label {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    margin: 10px;
}

.checkbox-group input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
}

/* Textarea styling */
textarea {
    width: 100%;
    padding: 10px;
    border: 1px solid var(--divider);
    border-radius: 6px;
    font-family: inherit;
    resize: vertical;
}

/* Play button for recordings in modal */
.play-recording-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 10px;
    background-color: var(--primary);
    color: white;
    border: none;
    border-radius: 16px;
    font-size: 0.82rem;
    cursor: pointer;
    transition: background-color 0.2s, transform 0.1s;
    margin-top: 8px;
    font-weight: 500;
}

.play-recording-btn:hover {
    background-color: var(--primary-dark);
    transform: translateY(-1px);
}

.play-recording-btn:active {
    transform: translateY(0);
}

.btn-small {
    padding: 6px 12px;
    font-size: 0.85rem;
}

/* Remove or adjust old audio controls styles since they're no longer used inline */
.audio-player-controls {
    /* Keep for potential future use, but can be removed if not needed */
    display: flex;
    gap: 8px;
    margin-top: 8px;
    align-items: center;
}

/* Ensure fullscreen header keeps elements on same line */
.fullscreen-header {
    display: flex;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--divider);
    gap: 12px;
}

.fullscreen-header h1.card-title {
    margin: 0;
    flex: 1;
    font-size: 1.8rem;
    color: var(--primary);
}

.fullscreen-header h3.card-title {
    margin: 0;
    flex: 1;
    font-size: 1.8rem;
    color: var(--primary);
}

/* Song Detail Improvements */
.song-info-row {
    display: flex;
    gap: 20px;
    margin-bottom: 20px;
    padding: 12px;
    background: var(--card-overlay);
    border-radius: 12px;
    align-items: center;
    justify-content: space-between;
}

.info-item {
    display: flex;
    vertical-align: middle;
    align-items: center;
    gap: 8px;
    color: var(--text-primary);
    font-size: 0.95rem;
    min-width: 80px;
}

.info-item i {
    font-size: 1.2rem;
    color: var(--primary);
    width: 20px;
    text-align: center;
}

.favorite-section {
    margin: 20px 0;
    padding: 16px;
    background: var(--card-overlay);
    border-radius: 12px;
}

.favorite-section h4 {
    margin-bottom: 12px;
    color: var(--primary);
    display: flex;
    align-items: center;
    gap: 8px;
}

.favorite-recording-compact {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 10px;
    border-radius: 8px;
}

.compact-info {
    display: flex;
    flex-direction: column;
    flex: 1;
    max-width: 60%;
}

.compact-name {
    font-weight: 600;
    margin-bottom: 2px;
    font-size: 1rem;
}

.compact-date {
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.recordings-list .recording-item:last-child {
    border-bottom: none;
}

/* Toggle button for song detail */
.toggle-btn {
    background: var(--primary);
    color: white;
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 0.9rem;
    margin-bottom: 10px;
    transition: background 0.2s;
}

.toggle-btn:hover {
    background: var(--primary-dark);
}

/* Recording star style */
.recording-star {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-left: 0; /* spacing handled by h5 gap */
    color: var(--primary);
    font-size: 0.95rem;
    line-height: 1;
    vertical-align: middle;
}

.recording-star .material-icons {
    font-size: 16px;
    line-height: 1;
}

/* Auth Form Styles */
.auth-card {
    max-width: 420px;
    margin: 48px auto;
    padding: 24px;
}

#inline-auth-form {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

#inline-auth-form input {
    width: 100%;
    padding: 12px;
    border: 1px solid var(--divider);
    border-radius: 8px;
    font-size: 1rem;
    transition: border-color 0.2s, box-shadow 0.2s;
}

#inline-auth-form input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--focus-ring);
}

#inline-auth-form .form-controls {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 12px;
    margin-top: 8px;
}

#inline-auth-error {
    color: var(--error);
    font-size: 0.9rem;
    flex: 1;
}

#inline-auth-form .btn {
    padding: 10px 20px;
}

/* Setlist Builder Styles */
.setlist-builder {
    display: flex;
    gap: 16px;
    flex-direction: column; /* Default for mobile */
}

.available-songs-container,
.setlist-songs-container {
    border: 1px solid var(--divider);
    border-radius: 8px;
    padding: 12px;
    background: var(--background);
    flex: 1;
    min-height: 200px;
    display: flex;
    flex-direction: column;
}

.setlist-builder h6 {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.song-search-filter {
    width: 100%;
    padding: 8px;
    border: 1px solid var(--divider);
    border-radius: 6px;
    margin-bottom: 8px;
}

.available-song-list,
.selected-song-list {
    list-style: none;
    padding: 0;
    margin: 0;
    overflow-y: auto;
    flex: 1;
    max-height: 250px; /* Prevent excessive height */
}

.available-song-list li,
.selected-song-list li {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px;
    border-radius: 6px;
    background: var(--surface);
    margin-bottom: 6px;
    border: 1px solid transparent;
}

.selected-song-list li {
    cursor: move; /* Grab cursor for draggable items */
}

.selected-song-list li.dragging {
    opacity: 0.5;
    background: var(--primary-light);
}

.available-song-list li.filtered-out {
    display: none;
}

.drag-handle {
    color: var(--text-secondary);
    margin-right: 8px;
    cursor: grab;
}

.add-song-btn, .remove-song-btn {
    padding: 4px;
    min-width: auto;
    height: auto;
    line-height: 1;
}

/* Desktop layout for setlist builder */
@media (min-width: 768px) {
    .setlist-builder {
        flex-direction: row; /* Side-by-side on larger screens */
    }
}

/* Key picker styles used inside modals */
/* keys: use a grid so 12 keys form two full rows (6 columns) and each button fills its cell;
   modes: two-equal-column grid so major/minor fill the full row */
.key-picker .key-buttons {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 6px;
    width: 100%;
}

.key-picker .mode-buttons {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 6px;
    width: 100%;
    margin-top: 8px;
}

.key-picker .key-button,
.key-picker .mode-button {
    border: 1px solid var(--divider);
    background: var(--surface);
    color: var(--text-primary);
    padding: 8px 10px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.95rem;
    width: 100%;
    text-align: center;
    box-sizing: border-box;
    min-height: 38px;
}

.key-picker .key-button.selected,
.key-picker .mode-button.selected {
    background: var(--secondary);
    color: white;
    border-color: var(--secondary);
}

/* Slightly larger touch targets on mobile: reduce columns if needed */
@media (max-width: 520px) {
    .key-picker .key-buttons {
        grid-template-columns: repeat(4, 1fr); /* 3 rows of 4 on small screens */
    }
}

/* Ensure key picker layout looks neat in modal */
.modal-body .key-picker {
    margin-top: 6px;
}

.card-header-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.search-container {
    margin-bottom: 16px;
    animation: fadeIn 0.3s ease;
}

#song-search-input {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid var(--divider);
    border-radius: 8px;
    font-size: 1rem;
    background: var(--background);
    color: var(--text-primary);
}

#song-search-input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--focus-ring);
}

/* Song Detail Styles */
.song-detail-fullscreen {
    position: relative;
    height: 100%;
    padding-bottom: 80px; /* Make room for bottom dialog */
}

.song-detail-main {
    margin-bottom: 0;
    padding-bottom: 20px;
}

/* Bottom Dialog Component */
.bottom-dialog {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: var(--surface);
    box-shadow: 0 -2px 10px var(--shadow-light);
    z-index: 1001; /* Slightly lower than floating button */
    padding: 16px 0;
    display: flex;
    justify-content: center;
    min-height: 80px;
    align-items: center;
    border-top-left-radius: 16px;
    border-top-right-radius: 16px;
    transform: translateY(100%);
    transition: transform 0.3s ease-out;
}

.bottom-dialog.hidden {
    display: none;
}

.bottom-dialog:not(.hidden) {
    transform: translateY(0);
}

.bottom-dialog-action-btn.danger {
    color: var(--error); /* Red color for text and icon */
}

.bottom-dialog-action-btn.danger:hover {
    background-color: var(--danger-hover);
}

/* Overlay for blur effect */
.dialog-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--modal-overlay);
    z-index: 999;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.dialog-overlay.active {
    opacity: 1;
    visibility: visible;
}

/* Generic dialog container */
.bottom-dialog-container {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    max-width: 600px;
    width: 100%;
    gap: 8px;
}

/* Generic action button */
.bottom-dialog-action-btn {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: flex-start;
    background: none;
    border: none;
    padding: 12px 16px;
    cursor: pointer;
    color: var(--text-primary);
    font-size: 1rem;
    transition: all 0.2s ease;
    border-radius: 8px;
    min-width: auto;
    width: 100%;
    gap: 12px;
}

.bottom-dialog-action-btn:hover {
    background-color: var(--hover-overlay);
}

.bottom-dialog-action-btn i {
    font-size: 24px;
    margin-bottom: 0;
    min-width: 24px;
    text-align: center;
}

.bottom-dialog-action-btn span {
    flex: 1;
    text-align: left;
}

.bottom-dialog-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--primary);
    margin-bottom: 8px;
    text-align: center;
    border-bottom: 1px solid var(--divider);    
    padding-bottom: 8px;
}

/* Regular song actions button at bottom */
.actions-button-container {
    position: fixed;
    bottom: 80px; /* Same as navbar height */
    left: 90%;
    transform: translateX(-50%);
    z-index: 100;
}

.actions-button {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 16px;
    background: var(--primary);
    color: white;
    border: none;
    border-radius: 50%;
    box-shadow: 0 4px 12px var(--shadow-medium);
    cursor: pointer;
    font-weight: 500;
    transition: all 0.3s ease;
    margin-bottom: 6px;
}

.actions-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px var(--shadow-strong);
}

.actions-button i {
    font-size: 20px;
}

/* Styles for group modal */
.band-logo-image {
    width: 60px;
    height: 60px;
    object-fit: cover;
    border-radius: 50%;
}

.member-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px;
    border-bottom: 1px solid var(--divider);
}

.admin-badge {
    background: var(--primary);
    color: var(--background);
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 0.75rem;
    margin-left: 8px;
}

.btn-icon {
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px;
    color: var(--text-secondary);
}

.btn-icon:hover {
    color: var(--text-primary);
}

/* API Populated Field Highlight */
.api-populated {
    position: relative;
    animation: highlightPulse 0.6s ease-out;
}

.api-populated::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    border: 2px solid var(--primary);
    border-radius: 6px;
    pointer-events: none;
    box-shadow: 0 0 0 3px var(--focus-ring);
}

.api-populated-label::after {
    content: '✓';
    display: inline-block;
    margin-left: 8px;
    color: var(--primary);
    font-weight: bold;
    animation: fadeInScale 0.4s ease-out;
}

@keyframes highlightPulse {
    0% {
        background-color: transparent;
    }
    50% {
        background-color: var(--focus-ring);
    }
    100% {
        background-color: transparent;
    }
}

@keyframes fadeInScale {
    0% {
        opacity: 0;
        transform: scale(0.5);
    }
    100% {
        opacity: 1;
        transform: scale(1);
    }
}

/* App Footer Styles */
.app-footer {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: var(--surface);
    border-top: 1px solid var(--divider);
    padding: 8px 16px;
    text-align: center;
    z-index: 99;
    font-size: 0.75rem;
}

.footer-text {
    margin: 0;
    color: var(--text-secondary);
}

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

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

/* Adjust main content padding for footer */
.main-content {
    padding-bottom: 180px; /* 70px player + 80px nav + 30px footer */
}

/* Icon color for html inputs */
input {
  color-scheme: var(--input-color-scheme);
}