/* Composition Wizard - 3-screen wizard for new compositions */

.composition-wizard-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.6);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10000;
  opacity: 0;
  animation: wizardFadeIn 0.2s ease-out forwards;
}

@keyframes wizardFadeIn {
  to {
    opacity: 1;
  }
}

.composition-wizard-dialog {
  background: white;
  border-radius: 16px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
  width: 480px;
  max-width: 90vw;
  max-height: 90vh;
  overflow: hidden;
  transform: scale(0.9);
  animation: wizardSlideUp 0.2s ease-out forwards;
  display: flex;
  flex-direction: column;
}

@keyframes wizardSlideUp {
  to {
    transform: scale(1);
  }
}

/* Header */
.wizard-header {
  padding: 28px 28px 20px;
  text-align: center;
}

.wizard-header h2 {
  margin: 0;
  font-size: 22px;
  font-weight: 600;
  color: #1f2937;
  letter-spacing: -0.02em;
}

.wizard-header-with-back {
  text-align: left;
}

.wizard-header-with-back h2 {
  text-align: center;
  margin-top: 8px;
}

.wizard-back-button {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: none;
  border: none;
  padding: 4px 8px;
  margin: -4px -8px;
  font-size: 15px;
  color: #6b7280;
  cursor: pointer;
  border-radius: 6px;
  transition: all 0.15s ease;
}

.wizard-back-button:hover {
  background: #f3f4f6;
  color: #374151;
}

.wizard-back-arrow {
  font-size: 18px;
}

/* Body */
.wizard-body {
  padding: 0 28px 20px;
  overflow-y: auto;
  flex: 1;
}

/* Options container */
.wizard-options {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.wizard-options-list {
  /* Default single column */
}

.wizard-options-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
}

/* Option buttons */
.wizard-option {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px 20px;
  border: 2px solid #e5e7eb;
  border-radius: 10px;
  background: white;
  cursor: pointer;
  transition: all 0.15s ease;
  font-family: inherit;
  font-size: 16px;
  color: #1f2937;
}

.wizard-option:hover {
  border-color: #667eea;
  background: #f8f9ff;
}

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

.wizard-option-full {
  width: 100%;
}

.wizard-option-compact {
  padding: 14px 16px;
  font-size: 15px;
}

.wizard-option-text {
  font-weight: 500;
}

/* Screen 3: Confirm screen */
.wizard-body-confirm {
  padding-bottom: 28px;
}

.wizard-key-section {
  margin-bottom: 20px;
}

.wizard-key-label {
  display: block;
  font-size: 14px;
  font-weight: 500;
  color: #6b7280;
  margin-bottom: 8px;
}

.wizard-key-selector {
  position: relative;
}

.wizard-key-select {
  width: 100%;
  padding: 14px 40px 14px 16px;
  font-size: 18px;
  font-weight: 500;
  color: #1f2937;
  background: white;
  border: 2px solid #e5e7eb;
  border-radius: 10px;
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3E%3Cpath stroke='%236b7280' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='M6 8l4 4 4-4'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  background-size: 20px;
}

.wizard-key-select:focus {
  outline: none;
  border-color: #667eea;
  box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.2);
}

/* Play button */
.wizard-play-section {
  text-align: center;
  margin-bottom: 24px;
}

.wizard-play-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 24px;
  font-size: 15px;
  font-weight: 500;
  color: #667eea;
  background: white;
  border: 2px solid #667eea;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.15s ease;
  font-family: inherit;
}

.wizard-play-button:hover {
  background: #f0f4ff;
}

.wizard-play-button:focus {
  outline: none;
  box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.2);
}

/* Scale display */
.wizard-scale-section {
  text-align: center;
}

.wizard-scale-divider {
  height: 1px;
  background: #e5e7eb;
  margin-bottom: 20px;
}

.wizard-scale-notes {
  font-size: 18px;
  font-weight: 500;
  color: #374151;
  letter-spacing: 0.05em;
  font-family: 'NotationFont', 'SF Mono', 'Monaco', monospace;
}

/* Footer */
.wizard-footer {
  padding: 16px 28px;
  background: #f9fafb;
  border-top: 1px solid #e5e7eb;
  display: flex;
  justify-content: flex-end;
  gap: 12px;
}

/* Buttons */
.wizard-button {
  padding: 10px 24px;
  border: none;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
  font-family: inherit;
}

.wizard-button-cancel {
  background: white;
  color: #6b7280;
  border: 1px solid #d1d5db;
}

.wizard-button-cancel:hover {
  background: #f9fafb;
  color: #374151;
  border-color: #9ca3af;
}

.wizard-button-create {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  box-shadow: 0 2px 8px rgba(102, 126, 234, 0.3);
}

.wizard-button-create:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

.wizard-button-create:active {
  transform: translateY(0);
}

/* Close animation */
.composition-wizard-overlay.closing {
  animation: wizardFadeOut 0.15s ease-out forwards;
}

.composition-wizard-overlay.closing .composition-wizard-dialog {
  animation: wizardSlideDown 0.15s ease-out forwards;
}

@keyframes wizardFadeOut {
  to {
    opacity: 0;
  }
}

@keyframes wizardSlideDown {
  to {
    transform: scale(0.95);
    opacity: 0;
  }
}

/* Dark mode support */
@media (prefers-color-scheme: dark) {
  .composition-wizard-dialog {
    background: #1f2937;
  }

  .wizard-header h2 {
    color: #f3f4f6;
  }

  .wizard-back-button {
    color: #9ca3af;
  }

  .wizard-back-button:hover {
    background: #374151;
    color: #e5e7eb;
  }

  .wizard-option {
    background: #111827;
    border-color: #374151;
    color: #f3f4f6;
  }

  .wizard-option:hover {
    background: #1e293b;
    border-color: #667eea;
  }

  .wizard-key-label {
    color: #9ca3af;
  }

  .wizard-key-select {
    background-color: #111827;
    border-color: #374151;
    color: #f3f4f6;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3E%3Cpath stroke='%239ca3af' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='M6 8l4 4 4-4'/%3E%3C/svg%3E");
  }

  .wizard-play-button {
    background: #111827;
    color: #818cf8;
    border-color: #818cf8;
  }

  .wizard-play-button:hover {
    background: #1e293b;
  }

  .wizard-scale-divider {
    background: #374151;
  }

  .wizard-scale-notes {
    color: #e5e7eb;
  }

  .wizard-footer {
    background: #111827;
    border-top-color: #374151;
  }

  .wizard-button-cancel {
    background: #111827;
    color: #9ca3af;
    border-color: #4b5563;
  }

  .wizard-button-cancel:hover {
    background: #1f2937;
    color: #e5e7eb;
    border-color: #6b7280;
  }
}

/* Mobile responsiveness */
@media (max-width: 520px) {
  .composition-wizard-dialog {
    width: 100%;
    max-width: 100%;
    height: 100%;
    max-height: 100%;
    border-radius: 0;
  }

  .wizard-header {
    padding: 20px 20px 16px;
  }

  .wizard-header h2 {
    font-size: 20px;
  }

  .wizard-body {
    padding: 0 20px 20px;
  }

  .wizard-options-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
  }

  .wizard-option {
    padding: 14px 16px;
    font-size: 15px;
  }

  .wizard-option-compact {
    padding: 12px 10px;
    font-size: 14px;
  }

  .wizard-footer {
    padding: 16px 20px;
  }
}
