/*
 * This is a manifest file that'll be compiled into application.css.
 *
 * With Propshaft, assets are served efficiently without preprocessing steps. You can still include
 * application-wide styles in this file, but keep in mind that CSS precedence will follow the standard
 * cascading order, meaning styles declared later in the document or manifest will override earlier ones,
 * depending on specificity.
 *
 * Consider organizing styles into separate files for maintainability.
 */

/* === Chord Chart Styles === */
/* Include chord_chart.css content here */

/* === Songs Styles === */
/* Page header styles */
.page-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
}

.page-header h1 {
  margin: 0;
}

/* Button styles */
.btn {
  display: inline-block;
  padding: 8px 12px;
  text-decoration: none;
  border-radius: 4px;
  cursor: pointer;
  font-weight: 500;
  font-size: 14px;
  text-align: center;
  border: 1px solid transparent;
  transition: background-color 0.2s, color 0.2s, border-color 0.2s;
}

.btn-primary {
  background-color: #3498db;
  color: white;
  border-color: #2980b9;
}

.btn-primary:hover {
  background-color: #2980b9;
}

.btn-outline-secondary {
  background-color: transparent;
  color: #777;
  border-color: #ccc;
}

.btn-outline-secondary:hover {
  background-color: #f5f5f5;
  color: #555;
}

.btn-outline-primary {
  background-color: transparent;
  color: #3498db;
  border-color: #3498db;
}

.btn-outline-primary:hover {
  background-color: #ebf5fb;
}

.btn-outline-danger {
  background-color: transparent;
  color: #e74c3c;
  border-color: #e74c3c;
}

.btn-outline-danger:hover {
  background-color: #fef5f4;
}

.btn-sm {
  padding: 4px 8px;
  font-size: 12px;
}

/* Song list styles */
.songs-list .song-item {
  border-bottom: 1px solid #eee;
  padding-bottom: 15px;
  margin-bottom: 15px;
  overflow: hidden; /* Clear floats */
}

.songs-list .song-item:last-child {
  border-bottom: none;
  margin-bottom: 0;
}

.songs-list .song-item h2 {
  margin-top: 0;
  margin-bottom: 5px;
  float: left;
  margin-right: 10px;
  font-size: 1.2em; /* Smaller font size */
}

.songs-list .song-item h2 a {
  color: #333;
  text-decoration: none;
}

.songs-list .song-item h2 a:hover {
  color: #3498db;
  text-decoration: underline;
}

.songs-list .song-item .song-meta {
  float: right;
  margin-left: 10px;
}

.songs-list .song-item .song-meta .key-display {
  margin-right: 10px;
  display: inline-block;
  vertical-align: middle;
  color: #555;
}

.songs-list .song-item .edit-link {
  display: inline-block;
  vertical-align: middle;
}

.songs-list .song-item .author-info {
  clear: both;
  padding-top: 5px;
  color: #666;
}

/* Form styles for show page */
.form-group {
  margin-bottom: 15px;
}

.form-group label {
  margin-right: 8px;
  font-weight: 500;
}

.form-control {
  padding: 6px 8px;
  border: 1px solid #ccc;
  border-radius: 4px;
}

/* Spacing helpers */
.mb-4 {
  margin-bottom: 20px;
}

.mt-4 {
  margin-top: 20px;
}

.mt-5 {
  margin-top: 30px;
}

.mr-2 {
  margin-right: 10px;
}

.ml-2 {
  margin-left: 10px;
}

/* Responsive adjustments */
@media (max-width: 576px) {
  .songs-list .song-item h2 {
    float: none;
    margin-bottom: 10px;
  }

  .songs-list .song-item .song-meta {
    float: none;
    text-align: left;
    margin-top: 5px;
  }

  .songs-list .song-item .song-meta .key-display,
  .songs-list .song-item .edit-link {
    display: block;
    margin-right: 0;
    margin-bottom: 5px;
  }

  .songs-list .song-item .edit-link {
    margin-bottom: 0;
  }
}

.new-song-button-container {
  /* No specific styles needed here if btn-primary handles button appearance */
  /* and flexbox on .page-header handles positioning */
}

/* Basic layout styles */
body {
  font-family: Arial, sans-serif;
  margin: 0;
  padding: 0;
  background-color: #f4f4f4;
}

header {
  background-color: #333;
  color: #fff;
  padding: 10px 0;
}

nav ul {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
}

nav ul li {
  margin: 5px 0;
}

nav ul li a {
  color: #fff;
  text-decoration: none;
}

main {
  padding: 20px;
}

/* Responsive styles */
@media (min-width: 768px) {
  nav ul {
    flex-direction: row;
    justify-content: space-between;
  }

  nav ul li {
    margin: 0 15px;
  }

  nav ul li:last-child {
    margin-left: auto;
  }
}

/* Author styles for song show page */
.song-author {
  font-size: 0.9em;
  color: #777;
}

/* Key control styles */
.key-display {
  display: flex;
  align-items: center;
}

.key-display .key-info {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

.key-display .transposed-info {
  color: #777;
  font-size: 0.85em;
  font-style: italic;
}

.key-display .change-link {
  margin-left: 8px;
  font-size: 0.8em;
  color: #3498db;
  text-decoration: none;
  cursor: pointer;
}

.key-display .change-link:hover {
  text-decoration: underline;
}

.key-controls-inline {
  display: flex;
  align-items: center;
  gap: 10px;
}

.key-controls-inline .form-group {
  margin-bottom: 0;
  display: flex;
  align-items: center;
}

.hidden {
  display: none;
}

/* Song navigation container */
.song-nav-container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
}

.song-nav-right {
  margin-left: auto;
}

/* === Song Form Styles === */
.song-form-container {
  max-width: 100%;
}

.song-form-main-fields {
  background-color: #f8f9fa;
  padding: 20px;
  border-radius: 6px;
  margin-bottom: 20px;
  box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

.song-form-row {
  display: flex;
  flex-direction: column;
  gap: 20px;
  margin-bottom: 20px;
}

.song-form-row .field {
  width: 100%;
}

.field label {
  font-size: 0.9em;
  font-weight: 500;
  color: #555;
  margin-bottom: 4px;
  display: inline-block;
}

.form-control {
  width: 100%;
  max-width: 100%;
  padding: 10px;
  border: 1px solid #ddd;
  border-radius: 4px;
  font-size: 16px; /* Larger for better readability and touch interaction */
}

input.form-control {
  height: 42px; /* Taller input fields for better usability */
}

select.form-control {
  height: 42px; /* Match input height */
}

.metadata-toggle {
  display: inline-block;
  color: #3498db;
  text-decoration: none;
  font-size: 14px;
  margin-bottom: 10px;
  font-weight: 500;
}

.metadata-toggle:hover {
  text-decoration: underline;
}

.metadata-fields {
  background-color: #fff;
  border: 1px solid #eee;
  padding: 15px;
  border-radius: 4px;
  margin-top: 10px;
}

.chart-field {
  margin-bottom: 20px;
}

.monospace-editor {
  font-family: monospace;
  width: 100%;
  padding: 10px;
  border: 1px solid #ddd;
  border-radius: 4px;
  background-color: #f9f9f9;
  line-height: 1.5;
  font-size: 16px;
  white-space: pre-wrap;
  word-wrap: break-word;
}

.monospace-editor:focus {
  border-color: #3498db;
  outline: none;
  box-shadow: 0 0 0 2px rgba(52, 152, 219, 0.2);
}

/* Large screens - constrain max-width to prevent overly wide fields */
@media (min-width: 768px) {
  .song-form-container {
    max-width: 900px;
    margin: 0 auto;
  }
}

/* Optional horizontal layout for very large screens */
@media (min-width: 1200px) {
  .song-form-row.optional-horizontal {
    flex-direction: row;
    flex-wrap: wrap;
  }
  
  .song-form-row.optional-horizontal .field {
    flex: 1;
    min-width: 30%;
  }
  
  .song-form-row.optional-horizontal .key-field {
    flex: 0 0 150px;
  }
}

/* Sticky form controls */
.form-sticky-controls {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background-color: #fff;
  padding: 15px;
  box-shadow: 0 -2px 10px rgba(0,0,0,0.1);
  z-index: 100;
  display: flex;
  justify-content: center;
}

.form-sticky-controls .actions {
  width: 100%;
  max-width: 900px;
  display: flex;
  justify-content: flex-start;
  gap: 10px;
}

.form-sticky-controls .btn {
  min-width: 120px;
}

/* Add padding at the bottom of the container to prevent fixed controls from covering content */
.form-with-sticky-controls {
  padding-bottom: 80px; /* Reverted back to original value since page container now handles spacing */
}

/* Filter form styles */
.filters-container {
  margin-bottom: 20px;
  padding: 15px;
  background-color: #f9f9f9;
  border: 1px solid #e0e0e0;
  border-radius: 4px;
}

.filters-toggle {
  display: block;
  margin-bottom: 10px;
  font-weight: bold;
  color: #333;
  text-decoration: none;
}

.filters-toggle:hover {
  color: #3498db;
}

.filter-fields .field {
  margin-bottom: 10px;
}

.filter-fields .field label {
  display: block;
  margin-bottom: 5px;
  font-weight: normal;
}

.filter-fields .actions {
  margin-top: 15px;
}

.filter-fields select[multiple].form-control {
  height: auto; /* Adjust height for multiselect */
  min-height: 100px; /* Provide a decent default size */
}

/* Tag filter checkbox styles */
.tag-checkbox-list {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 20px;
  margin-top: 5px;
  margin-bottom: 5px;
}
.tag-checkbox {
  display: flex;
  align-items: center;
  font-size: 1em;
  background: #f4f4f4;
  border-radius: 4px;
  padding: 4px 10px;
  transition: background 0.2s;
}
.tag-checkbox input[type="checkbox"] {
  margin-right: 6px;
}
.tag-checkbox:hover {
  background: #e9f3fb;
}

/* Song show page font unification */
h1, .song-author, .song-tags, .key-display, .key-info, .transposed-info {
  font-family: 'Arial', sans-serif;
  color: #222;
}
h1 {
  font-size: 2.5em;
  font-weight: 700;
  margin-bottom: 0.2em;
}
.song-author {
  font-size: 1.1em;
  color: #888;
  margin-bottom: 0.2em;
}
.song-tags {
  font-size: 1em;
  color: #444;
  margin-bottom: 1em;
}
.key-display {
  font-size: 1.1em;
  color: #333;
  margin-bottom: 1em;
}
.key-info {
  font-size: 1.1em;
  color: #333;
}
.transposed-info {
  font-size: 0.95em;
  color: #888;
  font-style: italic;
}

/* === Public Layout Styles === */
.public-layout {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  line-height: 1.6;
  color: #333;
}

.public-header {
  background: white;
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
  position: sticky;
  top: 0;
  z-index: 100;
}

.public-nav .nav-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 2rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  height: 70px;
}

.nav-brand .brand-link {
  text-decoration: none;
  color: #666;
  font-size: 1.5rem;
  font-weight: bold;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border: 1px solid #d1d5db;
  border-radius: 6px;
  transition: all 0.2s;
}

.nav-brand .brand-link:hover {
  color: #333;
  background: #f1f5f9;
  border-color: #9ca3af;
}

.nav-brand .brand-link.active,
.nav-brand .brand-link:active {
  color: #667eea;
  background: #eef2ff;
  border-color: #667eea;
}

.nav-brand .brand-link:focus {
  outline: none;
  box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
  border-color: #667eea;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 1.5rem;
}

.nav-link {
  text-decoration: none;
  color: #666;
  font-weight: 500;
  padding: 0.5rem 1rem;
  border-radius: 6px;
  transition: all 0.2s;
}

.nav-link:hover {
  color: #333;
}

.nav-link.btn-outline {
  border: 2px solid #667eea;
  color: #667eea;
}

.nav-link.btn-outline:hover {
  background: #667eea;
  color: white;
}

.nav-link.btn-primary {
  background: #667eea;
  color: white;
  border: 2px solid #667eea;
}

.nav-link.btn-primary:hover {
  background: #5a6fd8;
  border-color: #5a6fd8;
}

/* Button styles for homepage */
.btn-white {
  background: white;
  color: #667eea;
  border: 2px solid white;
}

.btn-white:hover {
  background: rgba(255,255,255,0.9);
}

.btn-outline-white {
  background: transparent;
  color: white;
  border: 2px solid white;
}

.btn-outline-white:hover {
  background: white;
  color: #667eea;
}

.btn-large {
  padding: 1rem 2rem;
  font-size: 1.1rem;
  font-weight: 600;
  border-radius: 8px;
}

/* Footer styles */
.public-footer {
  background: #2c3e50;
  color: white;
  padding: 60px 0 20px;
}

.footer-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 2rem;
}

.footer-content {
  display: grid;
  grid-template-columns: 1fr 2fr;
  gap: 3rem;
  margin-bottom: 2rem;
}

.footer-brand .footer-logo {
  font-size: 1.5rem;
  font-weight: bold;
  margin-bottom: 1rem;
  display: block;
}

.footer-brand p {
  color: #bdc3c7;
  margin: 0;
}

.footer-links {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 2rem;
}

.footer-section h4 {
  margin-bottom: 1rem;
  color: white;
}

.footer-section ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

.footer-section ul li {
  margin-bottom: 0.5rem;
}

.footer-section ul li a {
  color: #bdc3c7;
  text-decoration: none;
  transition: color 0.2s;
}

.footer-section ul li a:hover {
  color: white;
}

.footer-bottom {
  border-top: 1px solid #34495e;
  padding-top: 1rem;
  text-align: center;
}

.footer-bottom p {
  margin: 0;
  color: #bdc3c7;
}

/* Mobile responsive */
@media (max-width: 768px) {
  .public-nav .nav-container {
    padding: 0 1rem;
    height: 60px;
  }
  
  .nav-links {
    gap: 0.5rem;
  }
  
  .nav-link {
    padding: 0.4rem 0.8rem;
    font-size: 0.9rem;
  }
  
  .footer-content {
    grid-template-columns: 1fr;
    gap: 2rem;
  }
  
  .footer-links {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* === Member Interface Styles === */

/* Member Layout */
.member-layout {
  background: #f8fafc;
  min-height: 100vh;
}

/* Member Header & Navigation */
.member-header {
  background: white;
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
  position: sticky;
  top: 0;
  z-index: 100;
}

.member-nav .nav-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 2rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  height: 70px;
}

.member-nav .nav-brand .brand-link {
  text-decoration: none;
  color: #666;
  font-size: 1.5rem;
  font-weight: bold;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border: 1px solid #d1d5db;
  border-radius: 6px;
  transition: all 0.2s;
}

.member-nav .nav-brand .brand-link:hover {
  color: #333;
  background: #f1f5f9;
  border-color: #9ca3af;
}

.member-nav .nav-brand .brand-link.active,
.member-nav .nav-brand .brand-link:active {
  color: #667eea;
  background: #eef2ff;
  border-color: #667eea;
}

.member-nav .nav-brand .brand-link:focus {
  outline: none;
  box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
  border-color: #667eea;
}

.member-nav .nav-links {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.member-nav .nav-link {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  text-decoration: none;
  color: #666;
  font-weight: 500;
  padding: 0.5rem 1rem;
  border-radius: 6px;
  transition: all 0.2s;
}

.member-nav .nav-link:hover {
  color: #333;
  background: #f1f5f9;
}

.member-nav .nav-link.active {
  color: #667eea;
  background: #eef2ff;
}

/* User Menu Dropdown */
.nav-user-menu {
  position: relative;
}

.nav-user-toggle {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background: none;
  border: none;
  padding: 0.5rem;
  border-radius: 6px;
  cursor: pointer;
  transition: background 0.2s;
}

.nav-user-toggle:hover {
  background: #f1f5f9;
}

.user-avatar {
  width: 32px;
  height: 32px;
  background: #667eea;
  color: white;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: 0.9rem;
}

.user-name {
  color: #333;
  font-weight: 500;
}

.nav-user-dropdown {
  position: absolute;
  top: 100%;
  right: 0;
  background: white;
  border-radius: 8px;
  box-shadow: 0 10px 25px rgba(0,0,0,0.15);
  min-width: 200px;
  padding: 0.5rem 0;
  z-index: 1000;
  margin-top: 0.5rem;
}

.nav-user-dropdown.hidden {
  display: none;
}

.dropdown-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 1rem;
  text-decoration: none;
  color: #333;
  transition: background 0.2s;
}

.dropdown-item:hover {
  background: #f8fafc;
}

.dropdown-item.logout {
  color: #dc2626;
  border-top: 1px solid #e5e7eb;
  margin-top: 0.5rem;
}

/* Member Main Content */
.member-main {
  max-width: 1200px;
  margin: 0 auto;
  padding: 2rem;
}

/* Alert Styles */
.alert {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 1rem;
  border-radius: 8px;
  margin-bottom: 1.5rem;
}

.alert-success {
  background: #dcfce7;
  color: #166534;
  border: 1px solid #bbf7d0;
}

.alert-danger {
  background: #fef2f2;
  color: #dc2626;
  border: 1px solid #fecaca;
}

.alert-content h3 {
  margin: 0 0 0.5rem 0;
  font-size: 1rem;
}

.alert-content ul {
  margin: 0;
  padding-left: 1.5rem;
}

/* Dashboard Styles */
.dashboard-container {
  max-width: 1000px;
  margin: 0 auto;
}

.dashboard-header {
  text-align: center;
  margin-bottom: 3rem;
}

.dashboard-header h1 {
  font-size: 2.5rem;
  font-weight: 700;
  color: #1a1a1a;
  margin-bottom: 0.5rem;
}

.dashboard-subtitle {
  font-size: 1.125rem;
  color: #6b7280;
  margin: 0;
}

/* Quick Actions */
.quick-actions {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.5rem;
  margin-bottom: 3rem;
}

.quick-action {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1.5rem;
  background: white;
  border-radius: 12px;
  text-decoration: none;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
  transition: all 0.2s;
  border: 2px solid transparent;
}

.quick-action:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px -5px rgba(0, 0, 0, 0.1);
}

.quick-action.primary {
  border-color: #667eea;
}

.quick-action.primary .action-icon {
  background: #667eea;
  color: white;
}

.quick-action.secondary .action-icon {
  background: #f1f5f9;
  color: #667eea;
}

.action-icon {
  width: 48px;
  height: 48px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.action-content h3 {
  margin: 0 0 0.25rem 0;
  font-size: 1.125rem;
  font-weight: 600;
  color: #1a1a1a;
}

.action-content p {
  margin: 0;
  color: #6b7280;
  font-size: 0.9rem;
}

/* Stats Grid */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1.5rem;
  margin-bottom: 3rem;
}

.stat-card {
  background: white;
  padding: 1.5rem;
  border-radius: 12px;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
  display: flex;
  align-items: center;
  gap: 1rem;
}

.stat-icon {
  width: 48px;
  height: 48px;
  background: #f1f5f9;
  color: #667eea;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.stat-content h3 {
  margin: 0 0 0.25rem 0;
  font-size: 1.5rem;
  font-weight: 700;
  color: #1a1a1a;
}

.stat-content p {
  margin: 0;
  color: #6b7280;
  font-size: 0.9rem;
}

/* Dashboard Sections */
.dashboard-section {
  background: white;
  border-radius: 12px;
  padding: 2rem;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
  margin-bottom: 2rem;
}

.dashboard-section h2 {
  margin: 0 0 1.5rem 0;
  font-size: 1.5rem;
  font-weight: 600;
  color: #1a1a1a;
}

.recent-songs {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.recent-song-item {
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  overflow: hidden;
  transition: all 0.2s;
}

.recent-song-item:hover {
  border-color: #667eea;
  box-shadow: 0 4px 12px rgba(102, 126, 234, 0.15);
}

.song-link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem;
  text-decoration: none;
  color: inherit;
}

.song-info h3 {
  margin: 0 0 0.25rem 0;
  font-size: 1.125rem;
  font-weight: 600;
  color: #1a1a1a;
}

.song-meta {
  margin: 0 0 0.25rem 0;
  color: #6b7280;
  font-size: 0.9rem;
}

.key-badge {
  background: #f1f5f9;
  color: #667eea;
  padding: 0.25rem 0.5rem;
  border-radius: 4px;
  font-size: 0.8rem;
  font-weight: 500;
  margin-left: 0.5rem;
}

.song-updated {
  margin: 0;
  color: #9ca3af;
  font-size: 0.8rem;
}

.song-action {
  color: #9ca3af;
  transition: color 0.2s;
}

.recent-song-item:hover .song-action {
  color: #667eea;
}

.dashboard-section-footer {
  margin-top: 1.5rem;
  text-align: center;
}

/* Empty State */
.empty-state {
  text-align: center;
  padding: 3rem 1rem;
}

.empty-icon {
  color: #d1d5db;
  margin-bottom: 1rem;
}

.empty-state h3 {
  margin: 0 0 0.5rem 0;
  font-size: 1.25rem;
  font-weight: 600;
  color: #374151;
}

.empty-state p {
  margin: 0 0 1.5rem 0;
  color: #6b7280;
}

/* Key Stats */
.key-stats {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
}

.key-stat {
  background: #f8fafc;
  padding: 1rem;
  border-radius: 8px;
  text-align: center;
  min-width: 100px;
}

.key-name {
  font-size: 1.25rem;
  font-weight: 600;
  color: #667eea;
  margin-bottom: 0.25rem;
}

.key-count {
  font-size: 0.9rem;
  color: #6b7280;
}

/* Songs Page Styles */
.songs-page {
  max-width: 1200px;
  margin: 0 auto;
}

.songs-header {
  background: white;
  border-radius: 12px;
  padding: 1.5rem;
  margin-bottom: 2rem;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

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

.songs-header h1 {
  margin: 0;
  font-size: 2rem;
  font-weight: 700;
  color: #1a1a1a;
}

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

.sidebar-toggle {
  display: none;
  align-items: center;
  gap: 0.5rem;
  background: #f1f5f9;
  color: #667eea;
  border: none;
  padding: 0.5rem 1rem;
  border-radius: 6px;
  cursor: pointer;
  font-weight: 500;
  transition: all 0.2s;
}

.sidebar-toggle:hover {
  background: #e2e8f0;
}

.add-song-buttons {
  display: flex;
  gap: 0.5rem;
}

/* Songs Layout */
.songs-layout {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 2rem;
  align-items: start;
}

/* Songs Sidebar */
.songs-sidebar {
  background: white;
  border-radius: 12px;
  padding: 1.5rem;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
  position: sticky;
  top: 90px;
}

.sidebar-content {
  display: flex;
  flex-direction: column;
  gap: 2rem;
}

.sidebar-section h3 {
  margin: 0 0 1rem 0;
  font-size: 1.125rem;
  font-weight: 600;
  color: #1a1a1a;
}

/* Stats Mini */
.stats-mini {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.stat-mini {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.75rem;
  background: #f8fafc;
  border-radius: 6px;
}

.stat-number {
  font-size: 1.25rem;
  font-weight: 700;
  color: #667eea;
}

.stat-label {
  font-size: 0.9rem;
  color: #6b7280;
}

/* Filter Form */
.filter-form {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.form-label {
  font-weight: 600;
  color: #374151;
  font-size: 0.9rem;
}

.form-control {
  padding: 0.75rem;
  border: 1px solid #d1d5db;
  border-radius: 6px;
  font-size: 0.9rem;
  transition: border-color 0.2s;
}

.form-control:focus {
  outline: none;
  border-color: #667eea;
  box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

/* Tag Filter List */
.tag-filter-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  max-height: 200px;
  overflow-y: auto;
}

.tag-filter-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  cursor: pointer;
  padding: 0.25rem;
  border-radius: 4px;
  transition: background 0.2s;
}

.tag-filter-item:hover {
  background: #f8fafc;
}

.tag-label {
  font-size: 0.9rem;
  color: #374151;
}

/* Filter Actions */
.filter-actions {
  display: flex;
  gap: 0.5rem;
}

.btn-sm {
  padding: 0.5rem 1rem;
  font-size: 0.875rem;
}

/* Tag Cloud */
.tag-cloud {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.tag-badge {
  background: #f1f5f9;
  color: #667eea;
  padding: 0.25rem 0.75rem;
  border-radius: 20px;
  text-decoration: none;
  font-size: 0.8rem;
  font-weight: 500;
  transition: all 0.2s;
}

.tag-badge:hover {
  background: #667eea;
  color: white;
}

/* Songs Main Content */
.songs-main {
  min-height: 400px;
}

/* Active Filters */
.active-filters {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
}

.filter-label {
  font-weight: 600;
  color: #374151;
  font-size: 0.9rem;
}

.filter-badge {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background: #667eea;
  color: white;
  padding: 0.25rem 0.75rem;
  border-radius: 20px;
  font-size: 0.8rem;
  font-weight: 500;
}

.filter-remove {
  color: white;
  text-decoration: none;
  opacity: 0.8;
  transition: opacity 0.2s;
}

.filter-remove:hover {
  opacity: 1;
}

/* Songs Grid */
.songs-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 1.5rem;
}

.song-card {
  background: white;
  border-radius: 12px;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
  overflow: hidden;
  transition: all 0.2s;
}

.song-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px -5px rgba(0, 0, 0, 0.1);
}

.song-card-link {
  display: block;
  text-decoration: none;
  color: inherit;
  padding: 1.5rem;
}

.song-card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 0.75rem;
  gap: 1rem;
}

.song-title {
  margin: 0;
  font-size: 1.125rem;
  font-weight: 600;
  color: #1a1a1a;
  line-height: 1.3;
}

.song-author {
  margin: 0 0 0.75rem 0;
  color: #6b7280;
  font-size: 0.9rem;
}

/* Song Tags */
.song-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem;
  margin-bottom: 1rem;
}

.tag-mini {
  background: #f1f5f9;
  color: #667eea;
  padding: 0.125rem 0.5rem;
  border-radius: 12px;
  font-size: 0.75rem;
  font-weight: 500;
}

.tag-mini.more {
  background: #e5e7eb;
  color: #6b7280;
}

/* Song Card Footer */
.song-card-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid #f3f4f6;
}

.song-actions {
  display: flex;
  gap: 0.5rem;
}

/* Profile Page Styles */
.profile-container {
  max-width: 1000px;
  margin: 0 auto;
}

.profile-header {
  text-align: center;
  margin-bottom: 3rem;
}

.profile-header h1 {
  font-size: 2.5rem;
  font-weight: 700;
  color: #1a1a1a;
  margin-bottom: 0.5rem;
}

.profile-subtitle {
  font-size: 1.125rem;
  color: #6b7280;
  margin: 0;
}

.profile-content {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 2rem;
  align-items: start;
}

/* Profile Form Card */
.profile-form-card {
  background: white;
  border-radius: 12px;
  padding: 2rem;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

.profile-form {
  display: flex;
  flex-direction: column;
  gap: 2rem;
}

.form-section h2 {
  margin: 0 0 1.5rem 0;
  font-size: 1.25rem;
  font-weight: 600;
  color: #1a1a1a;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid #e5e7eb;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

.select-wrapper {
  position: relative;
}

.select-icon {
  position: absolute;
  right: 0.75rem;
  top: 50%;
  transform: translateY(-50%);
  color: #9ca3af;
  pointer-events: none;
}

.form-help {
  margin: 0.5rem 0 0 0;
  font-size: 0.8rem;
  color: #6b7280;
}

.form-control-static {
  padding: 0.75rem;
  background: #f9fafb;
  border: 1px solid #e5e7eb;
  border-radius: 6px;
  color: #374151;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.email-note {
  font-size: 0.8rem;
  color: #9ca3af;
}

.form-actions {
  display: flex;
  gap: 1rem;
  padding-top: 1rem;
  border-top: 1px solid #e5e7eb;
}

/* Profile Sidebar */
.profile-sidebar {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.profile-info-card {
  background: white;
  border-radius: 12px;
  padding: 2rem;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
  text-align: center;
}

.profile-avatar {
  width: 80px;
  height: 80px;
  background: #667eea;
  color: white;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 2rem;
  margin: 0 auto 1rem auto;
}

.profile-info-card h3 {
  margin: 0 0 0.5rem 0;
  font-size: 1.25rem;
  font-weight: 600;
  color: #1a1a1a;
}

.profile-email {
  margin: 0 0 1.5rem 0;
  color: #6b7280;
  font-size: 0.9rem;
}

.profile-stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  padding-top: 1rem;
  border-top: 1px solid #e5e7eb;
}

.stat-item {
  text-align: center;
}

.stat-item .stat-number {
  display: block;
  font-size: 1.5rem;
  font-weight: 700;
  color: #667eea;
  margin-bottom: 0.25rem;
}

.stat-item .stat-label {
  font-size: 0.8rem;
  color: #6b7280;
}

/* Quick Actions Card */
.quick-actions-card {
  background: white;
  border-radius: 12px;
  padding: 1.5rem;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

.quick-actions-card h4 {
  margin: 0 0 1rem 0;
  font-size: 1.125rem;
  font-weight: 600;
  color: #1a1a1a;
}

.quick-action-links {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.quick-action-link {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem;
  text-decoration: none;
  color: #374151;
  border-radius: 6px;
  transition: all 0.2s;
}

.quick-action-link:hover {
  background: #f8fafc;
  color: #667eea;
}

/* Responsive Design */
@media (max-width: 1024px) {
  .songs-layout {
    grid-template-columns: 1fr;
  }
  
  .songs-sidebar {
    position: static;
    display: none;
  }
  
  .songs-sidebar.sidebar-open {
    display: block;
    position: fixed;
    top: 0;
    left: 0;
    width: 300px;
    height: 100vh;
    z-index: 1000;
    overflow-y: auto;
    border-radius: 0;
  }
  
  .sidebar-toggle {
    display: flex;
  }
  
  .sidebar-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 999;
  }
  
  .profile-content {
    grid-template-columns: 1fr;
  }
  
  .profile-sidebar {
    order: -1;
  }
}

@media (max-width: 768px) {
  .member-main {
    padding: 1rem;
  }
  
  .member-nav .nav-container {
    padding: 0 1rem;
    height: 60px;
  }
  
  .member-nav .nav-links {
    gap: 0.5rem;
  }
  
  .member-nav .nav-link {
    padding: 0.3rem 0.5rem;
    font-size: 0.85rem;
  }
  
  /* Make brand button even more compact on small phones */
  .member-nav .nav-brand .brand-link {
    width: 36px;
    height: 36px;
  }
  
  .member-nav .nav-brand .brand-link svg {
    width: 16px;
    height: 16px;
  }
  
  .user-name {
    display: none;
  }
  
  .dashboard-header h1 {
    font-size: 2rem;
  }
  
  .quick-actions {
    grid-template-columns: 1fr;
  }
  
  .stats-grid {
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  }
  
  .songs-header-content {
    flex-direction: column;
    align-items: stretch;
  }
  
  .header-actions {
    justify-content: space-between;
  }
  
  .songs-grid {
    grid-template-columns: 1fr;
  }
  
  .form-row {
    grid-template-columns: 1fr;
  }
  
  .form-actions {
    flex-direction: column;
  }
  
  .profile-stats {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 480px) {
  .add-song-buttons {
    flex-direction: column;
  }

  .add-song-buttons .btn {
    margin-bottom: 8px;
  }
  
  /* Even more compact navigation on small phones */
  .member-nav .nav-container {
    padding: 0 0.5rem;
    height: 56px;
  }
  
  .member-nav .nav-links {
    gap: 0.25rem;
  }
  
  .member-nav .nav-link {
    padding: 0.3rem 0.5rem;
    font-size: 0.85rem;
  }
  
  .member-nav .nav-link[href*="dashboard"] {
    padding: 0.3rem 0.4rem;
  }
}

/* Password Update Form Styles */
.password-form {
  margin-top: 40px;
  padding-top: 30px;
  border-top: 2px solid #f0f0f0;
}

.password-form .form-section {
  margin-bottom: 25px;
}

.password-form .form-section h2 {
  color: #e74c3c;
  border-left: 4px solid #e74c3c;
  padding-left: 15px;
  margin-bottom: 8px;
}

.password-form .section-description {
  color: #666;
  margin-bottom: 20px;
  font-size: 14px;
  font-style: italic;
}

.password-form .form-control {
  border: 2px solid #ddd;
  transition: border-color 0.3s ease;
}

.password-form .form-control:focus {
  border-color: #e74c3c;
  outline: none;
  box-shadow: 0 0 0 3px rgba(231, 76, 60, 0.1);
}

.password-form .form-help {
  color: #888;
  font-size: 12px;
  margin-top: 4px;
}

.password-form .form-actions {
  margin-top: 25px;
  padding-top: 20px;
  border-top: 1px solid #eee;
}

.password-form .btn-primary {
  background-color: #e74c3c;
  border-color: #c0392b;
  font-weight: 600;
}

.password-form .btn-primary:hover {
  background-color: #c0392b;
  border-color: #a93226;
}

/* === Song Modal Styles === */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.75);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.modal-container {
  background: white;
  border-radius: 12px;
  box-shadow: 0 25px 50px rgba(0, 0, 0, 0.25);
  max-width: 95vw;
  /* Use dynamic viewport height with fallback for better mobile compatibility */
  max-height: 95vh; /* Fallback for browsers that don't support dvh */
  max-height: 95dvh; /* Dynamic viewport height for modern browsers */
  height: 90vh; /* Use a fixed viewport height for consistency */
  height: 90dvh; /* Use dynamic viewport height where supported */
  width: 1000px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  position: relative;
  /* Ensure modal content is contained within viewport */
  contain: layout style;
  /* Ensure this is a positioned containing block for floating controls */
  isolation: isolate;
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.5rem 2rem;
  border-bottom: 1px solid #e5e7eb;
  background: #f9fafb;
}

.modal-title {
  margin: 0;
  font-size: 1.75rem;
  font-weight: 700;
  color: #111827;
}

.modal-actions {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.modal-close-btn {
  background: none;
  border: none;
  color: #6b7280;
  cursor: pointer;
  padding: 0.5rem;
  border-radius: 6px;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
}

.modal-close-btn:hover {
  background: #f3f4f6;
  color: #374151;
}

.modal-content {
  flex: 1;
  overflow-y: auto;
  padding: 2rem;
  position: relative;
  /* Add bottom padding to prevent floating controls from covering content */
  padding-bottom: 80px;
}

.modal-content .song-author {
  font-size: 1.1rem;
  color: #6b7280;
  margin-bottom: 1rem;
}

.modal-content .song-tags {
  margin-bottom: 1.5rem;
  font-size: 1rem;
}

.modal-content .song-notes,
.modal-content .modal-notes {
  background: #f0faff;
  border: 1px solid #bae6fd;
  border-radius: 8px;
  padding: 1rem;
  margin-bottom: 1.5rem;
}

.modal-chart-content,
.modal-content .chart-content {
  margin-top: 2rem;
  line-height: 1.6;
  font-size: 18px; /* Set default font size to match middle button */
  /* Enable horizontal scrolling for wide charts */
  overflow-x: auto;
  max-width: 100%;
}

/* Song show container needs bottom padding for floating controls */
.song-show-container {
  padding-bottom: 120px; /* Increased padding */
}

.modal-content {
  padding-bottom: 120px; /* Increased padding */
}

/* Song content styles for regular show view */
.song-notes {
  background: #f0faff;
  border: 1px solid #bae6fd;
  border-radius: 8px;
  padding: 1rem;
  margin-bottom: 1.5rem;
}

.chart-content {
  margin-top: 2rem;
  line-height: 1.6;
  font-size: 18px; /* Set default font size to match middle button */
  overflow-x: auto;
  max-width: 100%;
}

/* Tap-to-focus styles when autoscroll is active */
.chart-content[data-autoscroll-active="true"],
.modal-chart-content[data-autoscroll-active="true"] {
  cursor: pointer;
  position: relative;
}

.copyright {
  margin-top: 2rem;
  color: #6b7280;
  font-size: 0.875rem;
}

/* === Floating Controls Styles === */
.floating-controls {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: white;
  border-top: 1px solid #e5e7eb;
  box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.1);
  display: flex;
  z-index: 200;
}

/* In modal, position the floating controls relative to the modal */
.modal-container .floating-controls {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 201;
  background: white;
  border-top: 1px solid #e5e7eb;
  box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.1);
  display: flex;
}

.control-group {
  flex: 1;
  display: flex;
  justify-content: center;
  position: relative;
}

.control-button {
  background: white;
  border: none;
  border-right: 1px solid #e5e7eb;
  color: #374151;
  padding: 16px 0;
  width: 100%;
  cursor: pointer;
  font-size: 15px;
  font-weight: 500;
  transition: background-color 0.2s, color 0.2s;
  text-align: center;
  border-radius: 0;
}

.control-button:hover {
  background: #f9fafb;
  color: #111827;
}

.control-group:last-child .control-button {
  border-right: none;
}

/* Key List Styles */
.key-list {
  display: none;
  flex-direction: column;
  position: absolute;
  bottom: 100%;
  left: 0;
  width: 100%;
  background: white;
  padding: 8px 0;
  border-top-left-radius: 8px;
  border-top-right-radius: 8px;
  max-height: 540px; /* Accommodate all 12 keys on larger screens */
  max-height: calc(100vh - 220px); /* Fallback for smaller viewports */
  overflow-y: auto;
  border: 1px solid #e5e7eb;
  border-bottom: none;
  box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.15);
}

.key-item {
  background: white;
  color: #374151;
  padding: 10px 16px;
  cursor: pointer;
  font-size: 14px;
  font-weight: 500;
  transition: background-color 0.2s, color 0.2s;
  text-decoration: none;
  display: flex; /* Enable flex for two-column layout */
  justify-content: space-between; /* Space out columns */
  align-items: center;
  border-bottom: 1px solid #f3f4f6;
}

.key-item .key-name {
  flex-grow: 1;
  text-align: left;
  font-size: 1.1em; /* Slightly larger for readability */
  color: #374151; /* Standard dark text color */
  font-weight: 500;
}

.key-item .key-shift {
  color: #6b7280;
  font-size: 0.9em;
  min-width: 55px; /* Ensure alignment for "current" */
  text-align: right;
  font-style: italic;
}

.key-item:hover {
  background: #f3f4f6;
}

.key-item.selected {
  background: #e5e7eb; /* Slightly darker grey for selection */
  font-weight: bold;
}

.key-item.selected .key-shift {
  color: #1f2937;
  font-weight: 600;
}

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

/* Scroll Overlay Styles */
.scroll-overlay {
  display: none;
  position: absolute;
  bottom: 100%;
  left: 0;
  right: 0; /* Make overlay span full width of parent */
  background: white;
  padding: 12px;
  border-top-left-radius: 8px;
  border-top-right-radius: 8px;
  display: flex;
  justify-content: center;
  align-items: center;
  border: 1px solid #e5e7eb;
  border-bottom: none;
  box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.15);
}

.scroll-overlay .speed-selector-group {
  justify-content: center; /* Center the buttons within the group */
}

.scroll-overlay button {
  background: #f3f4f6;
  border: 1px solid #d1d5db;
  color: #374151;
  padding: 6px 12px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  border-radius: 4px;
  transition: background-color 0.2s, border-color 0.2s;
}

.scroll-overlay button:hover {
  background: #e5e7eb;
  border-color: #9ca3af;
}

.scroll-speed {
  font-weight: 600;
  color: #374151;
  padding: 6px 12px;
  display: flex;
  align-items: center;
  min-width: 60px;
  justify-content: center;
}

/* Format Overlay Styles */
.format-overlay {
  display: none;
  position: absolute;
  bottom: 100%;
  left: 0;
  width: 100%;
  background: white;
  padding: 12px;
  border-top-left-radius: 8px;
  border-top-right-radius: 8px;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 8px;
  border: 1px solid #e5e7eb;
  border-bottom: none;
  box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.15);
}

.format-overlay button {
  background: #f3f4f6;
  border: 1px solid #d1d5db;
  color: #374151;
  padding: 6px 12px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  border-radius: 4px;
  transition: background-color 0.2s, border-color 0.2s;
}

.format-overlay button:hover {
  background: #e5e7eb;
  border-color: #9ca3af;
}

/* Flash Banner Styles */
.flash-banner {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  background: #e0b400;
  color: #000;
  padding: 10px;
  text-align: center;
  z-index: 300;
  font-weight: 600;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 12px;
}

/* Transpose Banner Styles - inline with content */
.transpose-banner {
  background: #f0f9ff;
  border: 1px solid #0ea5e9;
  border-radius: 8px;
  color: #0369a1;
  padding: 12px 16px;
  margin-bottom: 20px;
  font-weight: 500;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}

.modal-transpose-banner {
  margin-bottom: 16px;
}

.transpose-banner-content {
  flex: 1;
}

.transpose-banner-actions {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-shrink: 0;
}

.transpose-banner .btn {
  background: #0ea5e9;
  color: #fff;
  border: 1px solid #0ea5e9;
  padding: 6px 12px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 14px;
  text-decoration: none;
  transition: all 0.2s;
  font-weight: 500;
}

.transpose-banner .btn:hover {
  background: #0284c7;
  border-color: #0284c7;
  color: #fff;
  text-decoration: none;
}

.transpose-banner .btn-outline-secondary {
  background: transparent;
  color: #6b7280;
  border-color: #d1d5db;
}

.transpose-banner .btn-outline-secondary:hover {
  background: #f3f4f6;
  color: #374151;
  border-color: #9ca3af;
}

.flash-banner .btn {
  background: #604800;
  color: #fff;
  border: none;
  padding: 4px 10px;
  border-radius: 4px;
  cursor: pointer;
  font-size: 14px;
  text-decoration: none;
  transition: background 0.2s;
}

.flash-banner .btn:hover {
  background: #503e00;
  color: #fff;
  text-decoration: none;
}

/* Responsive design for mobile */
@media (max-width: 768px) {
  .control-button {
    font-size: 13px;
    padding: 14px 0;
  }
  
  .key-item {
    font-size: 12px;
  }
  
  .scroll-overlay button,
  .format-overlay button {
    font-size: 12px;
    padding: 4px 10px;
  }
}

@media (max-width: 480px) {
  .control-button {
    font-size: 12px;
    padding: 12px 0;
  }
  
  .flash-banner {
    flex-direction: column;
    gap: 8px;
    padding: 8px;
    font-size: 14px;
  }
  
  .transpose-banner {
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
    padding: 12px;
    text-align: center;
  }
  
  .transpose-banner-content {
    text-align: center;
  }
  
  .transpose-banner-actions {
    justify-content: center;
    flex-wrap: wrap;
    gap: 8px;
  }
  
  .transpose-banner .btn {
    flex: 1;
    min-width: 100px;
    max-width: 140px;
  }
}

/* Ensure chord chart styling works in modals */
.modal-chart-content div#chordsheet {
  margin: 1em 0;
  font-family: monospace;
  line-height: 1.5;
  position: relative;
  /* Prevent chart from breaking modal layout */
  min-width: max-content;
}

.modal-chart-content div#chordsheet table.linepair,
.modal-chart-content div#chordsheet table.simpleline {
  border-collapse: collapse;
  width: auto;
  /* Ensure table doesn't shrink in modal */
  white-space: nowrap;
}

.modal-chart-content div#chordsheet table.linepair td,
.modal-chart-content div#chordsheet table.simpleline td {
  padding: 0;
  vertical-align: top;
  white-space: pre;
}

/* Ensure chord colors work in modal */
.modal-chart-content div#chordsheet table.linepair tr.chordline td span {
  position: relative;
  top: 0.4em;
  font-size: 0.9em;
  font-weight: bold;
  color: #930;
  font-family: 'Courier New', monospace;
}

.modal-chart-content div#chordsheet table.linepair tr.chordline td {
  padding-right: 0.4em;
  vertical-align: bottom;
  padding-bottom: 0.2em;
}

/* Lyric styling in modal */
.modal-chart-content div#chordsheet table.linepair tr.lyricline td span,
.modal-chart-content div#chordsheet table.simpleline tr td {
  font-family: 'Arial', sans-serif;
  font-size: 1em;
}

/* Section labels in modal */
.modal-chart-content div#chordsheet.with-labels div.label {
  position: absolute;
  left: 0;
  width: 120px;
  text-align: right;
  font-style: italic;
  font-weight: bold;
  margin-right: 20px;
  font-family: 'Georgia', serif;
  color: #606060;
  margin-top: 1.5em;
}

.modal-chart-content div#chordsheet.with-labels table.linepair,
.modal-chart-content div#chordsheet.with-labels table.simpleline {
  margin-left: 150px;
}

.modal-copyright {
  margin-top: 2rem;
  padding-top: 1rem;
  border-top: 1px solid #e5e7eb;
  color: #6b7280;
  font-size: 0.9rem;
}

/* Key controls in modal */
.modal-content #key-control {
  margin-bottom: 2rem;
  padding: 1rem;
  background: #f8fafc;
  border-radius: 8px;
  border: 1px solid #e2e8f0;
}

.modal-content .key-display .key-info {
  font-size: 1.1rem;
  font-weight: 600;
  color: #1f2937;
}

.modal-content .change-link {
  color: #3b82f6;
  text-decoration: none;
  font-size: 0.9rem;
  margin-left: 1rem;
}

.modal-content .change-link:hover {
  text-decoration: underline;
}

.modal-content .key-controls-inline {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-top: 1rem;
}

.modal-content .key-controls-inline .form-group {
  margin-bottom: 0;
}

.modal-content .key-controls-inline label {
  margin-right: 0.5rem;
  font-weight: 500;
}

.modal-content .key-controls-inline .form-control {
  min-width: 100px;
}

/* Responsive modal styles */
@media (max-width: 768px) {
  .modal-overlay {
    /* Use safe area insets for iPhone notch/home indicator compatibility */
    padding: max(10px, env(safe-area-inset-top)) max(10px, env(safe-area-inset-right)) max(10px, env(safe-area-inset-bottom)) max(10px, env(safe-area-inset-left));
  }
  
  .modal-container {
    margin: 10px;
    max-width: calc(100vw - 20px);
    /* Better height handling for mobile browsers */
    max-height: calc(100vh - 40px);
    max-height: calc(100dvh - 40px);
    width: auto;
  }
  
  .modal-header {
    padding: 1rem 1.5rem;
  }
  
  .modal-title {
    font-size: 1.5rem;
  }
  
  .modal-content {
    padding: 1.5rem;
    /* Ensure content can scroll if needed */
    overflow-y: auto;
    -webkit-overflow-scrolling: touch; /* Smooth scrolling on iOS */
  }
  
  .modal-content .key-controls-inline {
    flex-direction: column;
    align-items: stretch;
  }
  
  .modal-content .key-controls-inline .form-group {
    margin-bottom: 1rem;
  }

  /* Better chart scrolling on mobile */
  .modal-chart-content {
    /* Add visual indicator for horizontal scrolling */
    background: linear-gradient(90deg, white 0%, rgba(255,255,255,0) 20px),
                linear-gradient(270deg, white 0%, rgba(255,255,255,0) 20px);
    background-size: 20px 100%, 20px 100%;
    background-position: left, right;
    background-repeat: no-repeat;
    background-attachment: local, local;
  }

  /* Reduce chart margins on mobile */
  .modal-chart-content div#chordsheet.with-labels table.linepair,
  .modal-chart-content div#chordsheet.with-labels table.simpleline {
    margin-left: 80px; /* Reduced from 150px */
  }

  .modal-chart-content div#chordsheet.with-labels div.label {
    width: 70px; /* Reduced from 120px */
    font-size: 0.85em;
  }
}

@media (max-width: 480px) {
  .modal-overlay {
    padding: 5px;
    /* Use full viewport on very small screens */
    padding: env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left);
  }
  
  .modal-container {
    margin: 0;
    max-width: 100vw;
    max-height: 100vh;
    max-height: 100dvh;
    border-radius: 0;
    /* Make modal fill screen on small devices */
    height: 100vh;
    height: 100dvh;
  }
  
  .modal-header {
    padding: 1rem;
  }
  
  .modal-title {
    font-size: 1.25rem;
  }
  
  .modal-content {
    padding: 1rem;
    /* Ensure full height usage */
    flex: 1;
  }

  /* Remove section labels on very small screens to save space */
  .modal-chart-content div#chordsheet.with-labels div.label {
    display: none;
  }

  .modal-chart-content div#chordsheet.with-labels table.linepair,
  .modal-chart-content div#chordsheet.with-labels table.simpleline {
    margin-left: 0;
  }
}

/* Page container for forms with floating controls */
.page-with-floating-controls {
  padding-bottom: 4rem;
}

/* Ensure song content has proper spacing for floating controls */
.song-show-container {
  padding-bottom: 120px; /* Increased padding */
}

.modal-content {
  padding-bottom: 120px; /* Increased padding */
}

/* Button size variants for flash banner */
.btn-sm {
  padding: 4px 8px;
  font-size: 12px;
}

.btn-default {
  background-color: #6b7280;
  color: white;
  border-color: #6b7280;
}

.btn-default:hover {
  background-color: #4b5563;
  border-color: #4b5563;
}

/* Floating Controls - Speed Selector */
.speed-selector-group {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 8px;
}

.speed-selector-btn {
  padding: 8px 12px;
  border: 1px solid #ccc;
  background-color: #f0f0f0;
  border-radius: 4px;
  cursor: pointer;
  transition: background-color 0.2s, color 0.2s;
}

.speed-selector-btn:hover {
  background-color: #e0e0e0;
}

.speed-selector-btn.selected,
.speed-selector-btn.selected:hover {
  background-color: #007bff;
  color: white;
  border-color: #007bff;
}

/* Floating Controls - Font Selector */
.font-selector-group {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 8px;
}

.font-selector-btn {
  padding: 8px 12px;
  border: 1px solid #ccc;
  background-color: #f0f0f0;
  border-radius: 4px;
  cursor: pointer;
  transition: background-color 0.2s, color 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 44px; /* Ensure buttons have a consistent size */
  min-height: 44px;
}

.font-selector-btn:hover {
  background-color: #e0e0e0;
}

.font-selector-btn.selected,
.font-selector-btn.selected:hover {
  background-color: #007bff;
  color: white;
  border-color: #007bff;
}

/* Responsive stacking for smaller screens */
@media (max-width: 480px) {
  .speed-selector-group,
  .font-selector-group {
    flex-direction: column;
    align-items: stretch; /* Make buttons full width */
  }

  .speed-selector-btn,
  .font-selector-btn {
    text-align: center;
  }
}

/* Speed Stepper for mobile */
.speed-stepper-group {
  display: flex;
  align-items: center;
  gap: 12px;
}

.speed-stepper-btn {
  font-size: 1.2em;
  padding: 8px 16px;
}

.scroll-speed {
  font-weight: 600;
  color: #374151;
  font-size: 1.1em;
  min-width: 40px;
  text-align: center;
}

/* Responsive UI swapping for speed controls */
/* Mobile-first: Stepper is visible by default, selector is hidden */
.speed-selector-group {
  display: none;
}
.speed-stepper-group {
  display: flex;
}

/* Wider screens: hide stepper, show selector */
@media (min-width: 481px) {
  .speed-selector-group {
    display: flex;
  }
  .speed-stepper-group {
    display: none;
  }
}

/* Responsive stacking for smaller screens (now only for font) */
@media (max-width: 480px) {
  .font-selector-group {
    flex-direction: column;
    align-items: stretch; /* Make buttons full width */
  }

  .font-selector-btn {
    text-align: center;
  }
}
