/* Song Creator Modal Styles */

:root {
    /* Appalachian Color Variables (matching explore.css) */
    --color-forest-deep: #2d5016;
    --color-forest-main: #3d6b1f;
    --color-forest-light: #4d7f2a;
    --color-earth-dark: #3e2f1f;
    --color-earth-main: #5c4533;
    --color-rust-main: #c45d28;
    --color-rust-light: #d47842;
    --color-rust-dark: #a84d1f;
    --color-amber-main: #d4a537;
    --color-amber-light: #e6b955;
    --color-crimson-main: #a03333;
    --color-crimson-light: #b94d4d;
    --color-mountain-main: #4a6b7c;
    --color-mountain-light: #5d7f91;
    --color-parchment: #f5f1e8;
    --color-cream: #ede6d6;
    --color-sand: #d9cdb8;
    --color-stone: #7a7261;
    --color-bark: #4a4238;
    --color-charcoal: #2b2520;
    --shadow-sm: 0 1px 3px rgba(62, 47, 31, 0.12);
    --shadow-md: 0 2px 8px rgba(62, 47, 31, 0.15);
    --shadow-lg: 0 4px 16px rgba(62, 47, 31, 0.18);
    --shadow-xl: 0 8px 32px rgba(62, 47, 31, 0.22);
}

.song-creator-modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.5);
  z-index: 1000;
  align-items: center;
  justify-content: center;
}

.song-creator-overlay {
  background: white;
  border-radius: 12px;
  width: 90%;
  max-width: 800px;
  max-height: 90vh;
  height: 90vh; /* Set explicit height */
  display: flex;
  flex-direction: column;
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1),
    0 10px 10px -5px rgba(0, 0, 0, 0.04);
  overflow: hidden; /* Prevent overflow from container */
}

.song-creator-container {
  display: flex;
  flex-direction: column;
  height: 100%;
}

/* Header */
.song-creator-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px 24px;
  border-bottom: 1px solid #e5e7eb;
}

.song-creator-header h2 {
  margin: 0;
  font-size: 1.5rem;
  font-weight: 600;
  color: #111827;
}

.close-btn {
  background: none;
  border: none;
  padding: 8px;
  cursor: pointer;
  border-radius: 6px;
  color: #6b7280;
  transition: all 0.2s;
}

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

/* Progress Indicator */
.progress-container {
  padding: 20px 24px;
  border-bottom: 1px solid #e5e7eb;
}

.progress-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  position: relative;
}

.progress-bar::before {
  content: "";
  position: absolute;
  top: 20px;
  left: 40px;
  right: 40px;
  height: 2px;
  background-color: #e5e7eb;
  z-index: 1;
}

.progress-step {
  display: flex;
  flex-direction: column;
  align-items: center;
  position: relative;
  z-index: 2;
}

.step-circle {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background-color: #e5e7eb;
  color: #6b7280;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: 14px;
  transition: all 0.3s;
}

.progress-step.active .step-circle {
  background-color: var(--color-rust-main);
  color: white;
}

.progress-step.completed .step-circle {
  background-color: var(--color-forest-main);
  color: white;
}

.step-label {
  margin-top: 8px;
  font-size: 12px;
  color: #6b7280;
  font-weight: 500;
}

.progress-step.active .step-label {
  color: var(--color-rust-main);
}

/* Content Area */
.song-creator-content {
  flex: 1;
  overflow-y: auto;
  padding: 24px;
  min-height: 0; /* Allow flex item to shrink */
  max-height: calc(90vh - 160px); /* Account for header, progress, and footer */
}

.page {
  max-width: 600px;
  margin: 0 auto;
  height: 100%;
  display: flex;
  flex-direction: column;
}

.page h3 {
  margin: 0 0 24px 0;
  font-size: 1.25rem;
  font-weight: 600;
  color: #111827;
}

.page-description {
  margin-bottom: 24px;
  color: #6b7280;
  line-height: 1.5;
}

/* Form Elements */
.form-group {
  margin-bottom: 24px;
}

.form-group label {
  display: block;
  margin-bottom: 8px;
  font-weight: 500;
  color: #374151;
}

/* Compact Form Layout */
.form-row {
  display: flex;
  gap: 32px;
  margin-bottom: 24px;
  align-items: center;
  padding: 16px;
  background-color: #f9fafb;
  border-radius: 8px;
  border: 1px solid #e5e7eb;
}

.form-group-inline {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
}

.form-group-inline label {
  font-weight: 500;
  color: #374151;
  font-size: 14px;
  white-space: nowrap;
  margin: 0;
}

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

.button-group.compact {
  gap: 12px;
  height: 40px; /* Fixed height for alignment */
}

.button-group.compact .type-btn {
  padding: 10px 20px;
  font-size: 14px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.form-input {
  width: 100%;
  padding: 12px 16px;
  border: 1px solid #d1d5db;
  border-radius: 8px;
  font-size: 16px;
  transition: border-color 0.2s;
}

.form-input:focus {
  outline: none;
  border-color: var(--color-rust-main);
  box-shadow: 0 0 0 3px rgba(196, 93, 40, 0.15);
}

.form-textarea {
  width: 100%;
  padding: 12px 16px;
  border: 1px solid #d1d5db;
  border-radius: 8px;
  font-size: 14px;
  font-family: inherit;
  resize: vertical;
  min-height: 120px;
  transition: border-color 0.2s;
}

.form-textarea:focus {
  outline: none;
  border-color: var(--color-rust-main);
  box-shadow: 0 0 0 3px rgba(196, 93, 40, 0.15);
}

/* Key Selector */
.key-selector-container {
  position: relative;
}

.key-selector-btn {
  width: 100%;
  padding: 12px 16px;
  border: 1px solid #d1d5db;
  border-radius: 8px;
  background: white;
  text-align: left;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  transition: border-color 0.2s;
}

.key-selector-btn:hover {
  border-color: #9ca3af;
}

.key-selector-btn.compact {
  padding: 8px 12px;
  font-size: 14px;
  width: 80px; /* Much smaller fixed width */
  height: 40px;
  text-align: left;
}

/* Radio Groups */
.radio-group {
  display: flex;
  gap: 24px;
}

.radio-option {
  display: flex;
  align-items: center;
  cursor: pointer;
}

.radio-option input[type="radio"] {
  margin-right: 8px;
}

.radio-group.compact {
  gap: 16px;
  display: flex;
  align-items: center;
}

.radio-group.compact .radio-option {
  font-size: 14px;
  margin: 0;
  display: flex;
  align-items: center;
  white-space: nowrap;
}

/* Button Groups */
.button-group {
  display: flex;
  gap: 16px;
}

.type-btn {
  flex: 1;
  padding: 12px 24px;
  border: 1px solid #d1d5db;
  border-radius: 8px;
  background: white;
  cursor: pointer;
  font-weight: 500;
  transition: all 0.2s;
}

.type-btn:hover {
  border-color: #9ca3af;
}

.type-btn.active {
  background: linear-gradient(135deg, var(--color-rust-main), var(--color-rust-dark));
  border-color: var(--color-rust-main);
  color: white;
}

/* Empty State */
.empty-state {
  text-align: center;
  padding: 60px 20px;
}

.empty-icon {
  font-size: 64px;
  margin-bottom: 16px;
}

.empty-state h3 {
  margin: 0 0 8px 0;
  color: #374151;
  font-weight: 600;
}

.empty-state p {
  margin: 0 0 24px 0;
  color: #6b7280;
  line-height: 1.5;
}

/* Add Section Button */
.add-section-btn {
  width: 100%;
  padding: 16px;
  border: 2px dashed #d1d5db;
  border-radius: 8px;
  background: transparent;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  color: #6b7280;
  font-weight: 500;
  transition: all 0.2s;
  margin-top: 16px;
}

.add-section-btn:hover {
  border-color: var(--color-rust-main);
  color: var(--color-rust-main);
  background-color: rgba(196, 93, 40, 0.05);
}

/* Footer */
.song-creator-footer {
  border-top: 1px solid #e5e7eb;
  background-color: #f9fafb;
  flex-shrink: 0;
}

.footer-navigation {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px 24px;
}

.spacer {
  flex: 1;
}

/* Buttons */
.btn {
  padding: 12px 24px;
  border-radius: 8px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
  border: none;
  font-size: 14px;
}

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

.btn-primary {
  background: linear-gradient(135deg, var(--color-rust-main), var(--color-rust-dark));
  color: white;
  box-shadow: var(--shadow-sm);
}

.btn-primary:hover:not(:disabled) {
  background: linear-gradient(135deg, var(--color-rust-light), var(--color-rust-main));
  box-shadow: var(--shadow-md);
}

.btn-secondary {
  background-color: white;
  color: #374151;
  border: 1px solid #d1d5db;
}

.btn-secondary:hover:not(:disabled) {
  background-color: #f3f4f6;
}

/* New Song Button in Sidebar */
.new-song-btn {
  background: linear-gradient(135deg, var(--color-rust-main), var(--color-rust-dark));
  color: white;
  padding: 14px 20px;
  border: none;
  border-radius: 12px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
  flex-shrink: 0;
  box-shadow: var(--shadow-md);
}

.new-song-btn:hover {
  background: linear-gradient(135deg, var(--color-rust-light), var(--color-rust-main));
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
}

.new-song-btn:active {
  transform: translateY(0);
}

/* Responsive Design */
@media (max-width: 768px) {
  .song-creator-overlay {
    width: 95%;
    max-height: 95vh;
  }

  .song-creator-content {
    padding: 16px;
  }

  .progress-bar {
    flex-direction: column;
    gap: 16px;
  }

  .progress-bar::before {
    display: none;
  }

  .button-group {
    flex-direction: column;
  }

  .radio-group {
    flex-direction: column;
    gap: 12px;
  }

  .form-row {
    flex-direction: column;
    gap: 16px;
  }
}

/* Key Selector Shelf */
.key-selector-shelf {
  background: white;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  margin-bottom: 16px;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1),
    0 2px 4px -1px rgba(0, 0, 0, 0.06);
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.2s ease-out, opacity 0.2s ease-out;
  opacity: 0;
}

.key-selector-shelf.open {
  max-height: 300px;
  opacity: 1;
}

.shelf-content {
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.shelf-bottom-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
}

/* Mode Toggle */
.mode-toggle {
  display: flex;
  border: 1px solid #d1d5db;
  border-radius: 8px;
  overflow: hidden;
  align-self: center;
}

.mode-toggle.compact {
  align-self: flex-start;
  font-size: 12px;
}

.mode-btn {
  padding: 12px 24px;
  background: white;
  border: none;
  cursor: pointer;
  font-weight: 500;
  transition: all 0.2s;
  color: #6b7280;
}

.mode-toggle.compact .mode-btn {
  padding: 6px 12px;
  font-size: 12px;
}

.mode-btn.active {
  background: linear-gradient(135deg, var(--color-forest-main), var(--color-forest-deep));
  color: white;
}

.mode-btn:hover:not(.active) {
  background-color: #f3f4f6;
}

/* Key Grid */
.key-grid {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.key-grid.compact {
  gap: 6px;
}

.key-row {
  display: flex;
  gap: 8px;
  justify-content: center;
}

.key-btn {
  width: 60px;
  height: 40px;
  border: 1px solid #d1d5db;
  border-radius: 6px;
  background: white;
  cursor: pointer;
  font-weight: 600;
  font-size: 12px;
  transition: all 0.2s;
  color: #374151;
}

.key-grid.compact .key-btn {
  width: 45px;
  height: 32px;
  font-size: 11px;
}

.key-btn:hover {
  border-color: #9ca3af;
}

.key-btn.selected {
  background: linear-gradient(135deg, var(--color-rust-main), var(--color-rust-dark));
  border-color: var(--color-rust-main);
  color: white;
}

/* Sharps/Flats Toggle */
.sharps-flats-toggle {
  display: flex;
  border: 1px solid #d1d5db;
  border-radius: 6px;
  overflow: hidden;
  align-self: center;
  width: 200px;
}

.sharps-flats-toggle.compact {
  width: 60px;
  align-self: flex-start;
}

.toggle-btn {
  flex: 1;
  padding: 10px 16px;
  background: white;
  border: none;
  cursor: pointer;
  font-weight: 500;
  font-size: 12px;
  transition: all 0.2s;
  color: #6b7280;
}

.sharps-flats-toggle.compact .toggle-btn {
  padding: 4px 8px;
  font-size: 14px;
  font-weight: 600;
}

.toggle-btn.active {
  background: linear-gradient(135deg, var(--color-mountain-main), var(--color-mountain-light));
  color: white;
}

.toggle-btn:hover:not(.active) {
  background-color: #f3f4f6;
}

/* Seven Checkbox */
.seven-checkbox-container {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border: 1px solid #d1d5db;
  border-radius: 6px;
  background: white;
  cursor: pointer;
  user-select: none;
  transition: all 0.2s;
}

.seven-checkbox-container:hover {
  border-color: #9ca3af;
  background-color: #f9fafb;
}

.seven-checkbox {
  margin: 0;
  cursor: pointer;
  width: 18px;
  height: 18px;
}

.seven-checkbox-label {
  font-size: 16px;
  font-weight: 600;
  color: #374151;
  cursor: pointer;
}

/* No Key Button */
.no-key-btn {
  padding: 12px 24px;
  border: 1px solid #d1d5db;
  border-radius: 8px;
  background: white;
  cursor: pointer;
  font-weight: 500;
  color: #6b7280;
  transition: all 0.2s;
  align-self: center;
}

.no-key-btn.compact {
  padding: 6px 12px;
  font-size: 12px;
  align-self: flex-start;
}

/* Delete Song Modal */
.delete-song-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.5);
  z-index: 1100;
  display: flex;
  align-items: center;
  justify-content: center;
}

.delete-modal-overlay {
  background: white;
  border-radius: 12px;
  width: 90%;
  max-width: 450px;
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1),
    0 10px 10px -5px rgba(0, 0, 0, 0.04);
}

.delete-modal-container {
  display: flex;
  flex-direction: column;
}

.delete-modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px 24px;
  border-bottom: 1px solid #e5e7eb;
}

.delete-modal-header h3 {
  margin: 0;
  font-size: 1.25rem;
  font-weight: 600;
  color: #111827;
}

.delete-modal-content {
  padding: 24px;
  text-align: center;
}

.delete-warning-icon {
  margin-bottom: 16px;
}

.delete-warning-icon .material-icons {
  font-size: 48px;
  color: var(--color-amber-main);
}

.delete-error-icon {
  margin-bottom: 16px;
}

.delete-error-icon .material-icons {
  font-size: 48px;
  color: var(--color-crimson-main);
}

.delete-modal-content p {
  margin: 0 0 12px 0;
  color: #374151;
  line-height: 1.5;
}

.delete-warning {
  color: #6b7280;
  font-size: 14px;
}

.delete-modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  padding: 20px 24px;
  border-top: 1px solid #e5e7eb;
  background-color: #f9fafb;
  border-radius: 0 0 12px 12px;
}

.btn-danger {
  background: linear-gradient(135deg, var(--color-crimson-main), var(--color-crimson-light));
  color: white;
  border: none;
  padding: 10px 20px;
  border-radius: 6px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
  box-shadow: var(--shadow-sm);
}

.btn-danger:hover:not(:disabled) {
  background: linear-gradient(135deg, var(--color-crimson-light), #c94d4d);
  box-shadow: var(--shadow-md);
}

.btn-danger:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* Delete Button in Song Header */
.delete-btn {
  color: var(--color-crimson-main) !important;
}

.delete-btn:hover {
  background-color: rgba(160, 51, 51, 0.1) !important;
}

/* Delete Success Notification */
.delete-success-notification {
  position: fixed;
  top: 20px;
  right: 20px;
  background: var(--color-forest-main);
  color: white;
  padding: 16px 24px;
  border-radius: 8px;
  box-shadow: var(--shadow-xl);
  z-index: 1200;
  opacity: 0;
  transform: translateX(100%);
  transition: all 0.3s ease;
}

.delete-success-notification.show {
  opacity: 1;
  transform: translateX(0);
}

.delete-success-notification .notification-content {
  display: flex;
  align-items: center;
  gap: 12px;
}

.delete-success-notification .material-icons {
  font-size: 20px;
}

.delete-success-notification .notification-message {
  font-weight: 500;
  font-size: 14px;
}

.no-key-btn:hover {
  border-color: var(--color-stone);
  color: var(--color-stone);
  background-color: rgba(122, 114, 97, 0.05);
}

/* Chord Charts Page */
.chord-charts-page {
  height: 100%;
  overflow-y: auto;
}

.sections-container {
  padding-bottom: 20px;
}

/* Section Cards */
.section-card {
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  margin-bottom: 16px;
  background: white;
}

.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  background-color: #f9fafb;
  border-bottom: 1px solid #e5e7eb;
  border-radius: 8px 8px 0 0;
}

.section-name-input {
  border: none;
  background: transparent;
  font-weight: 600;
  font-size: 16px;
  color: #111827;
  padding: 4px 8px;
  border-radius: 4px;
  transition: background-color 0.2s;
}

.section-name-input:focus {
  outline: none;
  background-color: white;
  box-shadow: 0 0 0 2px var(--color-rust-main);
}

.delete-section-btn {
  background: none;
  border: none;
  color: var(--color-crimson-main);
  cursor: pointer;
  padding: 4px;
  border-radius: 4px;
  transition: background-color 0.2s;
}

.delete-section-btn:hover {
  background-color: rgba(160, 51, 51, 0.1);
}

/* Bars Grid */
.bars-grid {
  padding: 16px;
}

.bar-row {
  display: flex;
  align-items: center;
  margin-bottom: 12px;
  gap: 8px;
}

.bar-row .bar {
  flex: 1;
  max-width: calc(25% - 6px); /* 25% width minus gap spacing */
}

.measure-number {
  width: 30px;
  font-size: 12px;
  color: #6b7280;
  font-weight: 500;
  text-align: center;
}

.bar {
  position: relative;
  flex: 1;
  height: 50px;
  border: 1px solid #d1d5db;
  border-radius: 8px;
  background: white;
  cursor: pointer;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 0; /* Allow flex items to shrink */
}

.bar:hover {
  border-color: #9ca3af;
}

.bar.half-measure {
  border-color: var(--color-rust-main);
  border-width: 2px;
  background-color: rgba(196, 93, 40, 0.05);
}

.bar.preview-bar {
  border: 2px dashed #d1d5db;
  background: transparent;
  color: #9ca3af;
}

.bar.preview-bar:hover {
  border-color: var(--color-rust-main);
  color: var(--color-rust-main);
  background-color: rgba(196, 93, 40, 0.05);
}

.ghost-chord {
  font-weight: 600;
  font-size: 12px;
  color: #9ca3af;
  font-style: italic;
}

/* Keyboard Legend */
.keyboard-legend {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 8px 12px;
  margin-top: 12px;
  background-color: #f9fafb;
  border: 1px solid #e5e7eb;
  border-radius: 6px;
  font-size: 12px;
  color: #6b7280;
  font-weight: 500;
}

.keyboard-legend .material-icons {
  font-size: 16px;
}

.bar-content {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  padding: 4px;
}

.chord-slots {
  display: flex;
  align-items: center;
  justify-content: space-evenly;
  width: 100%;
  padding: 0 4px;
}

/* Only override chord styles within the song creator modal */
.song-creator-modal .chord,
.chord-charts-page .chord {
  font-weight: 600;
  font-size: 14px;
  color: #111827;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  /* Override explore.css styles that add backgrounds/borders */
  background: none !important;
  border: none !important;
  padding: 0 !important;
  border-radius: 0 !important;
  min-height: auto !important;
  box-shadow: none !important;
  display: inline !important;
  position: static !important;
}

.chord-placeholder {
  font-size: 10px;
  color: #9ca3af;
  border: 1px dashed #d1d5db;
  border-radius: 3px;
  width: 16px;
  height: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.rest-chord {
  font-style: italic;
  color: #6b7280;
  font-size: 11px;
}

.delete-bar-btn {
  position: absolute;
  top: -6px;
  left: -6px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--color-crimson-main);
  color: white;
  border: none;
  cursor: pointer;
  display: none;
  align-items: center;
  justify-content: center;
  font-size: 10px;
}

.bar:hover .delete-bar-btn {
  display: flex;
}

/* Chord Entry Box */
.chord-entry-box {
  background-color: #f9fafb;
  padding: 20px 24px;
  border-bottom: 1px solid #e5e7eb;
}

.empty-message {
  text-align: center;
  color: #6b7280;
  font-style: italic;
}

/* Section Selector */
.section-selector {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
}

.selector-label {
  font-size: 14px;
  font-weight: 500;
  color: #374151;
}

.section-tabs {
  display: flex;
  gap: 8px;
}

.section-tab {
  padding: 6px 12px;
  border: 1px solid #d1d5db;
  border-radius: 16px;
  background: white;
  cursor: pointer;
  font-size: 12px;
  font-weight: 500;
  color: #6b7280;
  transition: all 0.2s;
}

.section-tab.active {
  background: linear-gradient(135deg, var(--color-rust-main), var(--color-rust-dark));
  border-color: var(--color-rust-main);
  color: white;
}

.section-tab:hover:not(.active) {
  border-color: #9ca3af;
}

/* Chord Grid */
.chord-grid-container {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

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

.time-sig-badge,
.key-badge {
  padding: 4px 8px;
  border-radius: 12px;
  font-size: 12px;
  font-weight: 500;
}

.time-sig-badge {
  background-color: rgba(212, 165, 55, 0.12);
  color: var(--color-earth-dark);
  border: 1.5px solid var(--color-earth-main);
}

.key-badge {
  background-color: #f3f4f6;
  color: #374151;
  border: 1px solid #d1d5db;
}

.grid-controls {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}

.swap-btn {
  padding: 8px 16px;
  border: 1px solid #d1d5db;
  border-radius: 20px;
  background: white;
  cursor: pointer;
  font-size: 12px;
  font-weight: 500;
  color: #6b7280;
  transition: all 0.2s;
}

.swap-btn.active {
  background: linear-gradient(135deg, var(--color-forest-main), var(--color-forest-deep));
  border-color: var(--color-forest-main);
  color: white;
}

.swap-btn:hover:not(.active) {
  border-color: #9ca3af;
}

.chord-grid {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.chord-row {
  display: flex;
  gap: 4px;
  justify-content: center;
  position: relative;
}

.chord-row.non-diatonic-row {
  /* Half-offset piano-style layout: offset by half button width */
  /* Button width: 44px, so half-offset = 22px (matches Flutter app's 5.5% of 11%) */
  padding-left: 22px;
}

.chord-row.controls-row {
  justify-content: space-between;
  align-items: center;
}

.chord-btn {
  width: 44px;
  height: 40px;
  border: 1px solid #d1d5db;
  border-radius: 6px;
  background: white;
  cursor: pointer;
  font-weight: 600;
  font-size: 12px;
  color: #374151;
  transition: all 0.2s;
  box-sizing: border-box;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.chord-btn:hover {
  border-color: #9ca3af;
  background-color: #f3f4f6;
}

.chord-btn.secondary {
  background-color: #f9fafb;
  color: #6b7280;
}

/* Spacer for piano keyboard layout (gap between 2nd and 3rd buttons in second row) */
.chord-spacer {
  display: inline-block;
  width: 44px; /* Same width as a chord button */
  height: 1px; /* Minimal height, just for spacing */
}

.rest-btn {
  display: flex;
  align-items: center;
  gap: 4px;
  width: 44px;
  height: 40px;
  padding: 0;
  border: 1px solid #d1d5db;
  border-radius: 6px;
  background: white;
  cursor: pointer;
  font-size: 10px;
  color: #6b7280;
  transition: all 0.2s;
  justify-content: center;
  box-sizing: border-box;
}

.rest-btn:hover {
  border-color: #9ca3af;
  background-color: #f3f4f6;
}

.rest-btn .material-icons {
  font-size: 14px;
}

/* Notifications */
.song-creator-notification {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  color: white;
  padding: 16px 24px;
  border-radius: 8px;
  box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.1),
    0 10px 10px -5px rgba(0, 0, 0, 0.04);
  z-index: 1200;
  opacity: 0;
  transform: translate(-50%, -50%) scale(0.9);
  transition: all 0.3s ease;
}

.song-creator-notification.success {
  background: var(--color-forest-main);
}

.song-creator-notification.error {
  background: var(--color-crimson-main);
}

.song-creator-notification.show {
  opacity: 1;
  transform: translate(-50%, -50%) scale(1);
}

.notification-content {
  display: flex;
  align-items: center;
  gap: 12px;
}

.notification-content .material-icons {
  font-size: 20px;
}

.notification-message {
  font-weight: 500;
  font-size: 14px;
}

/* Material Icons */
.material-icons {
  font-family: "Material Icons";
  font-weight: normal;
  font-style: normal;
  font-size: 24px;
  line-height: 1;
  letter-spacing: normal;
  text-transform: none;
  display: inline-block;
  white-space: nowrap;
  word-wrap: normal;
  direction: ltr;
  -webkit-font-feature-settings: "liga";
  -webkit-font-smoothing: antialiased;
}
