* {
  box-sizing: border-box;
}

body {
  margin: 0;
  padding: 24px;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Helvetica', 'Arial', sans-serif;
  background: linear-gradient(180deg, #e91e92 0%, #1a0015 50%, #000000 100%);
  min-height: 100vh;
  color: #ffffff;
}

header h1 {
  margin: 0 0 4px;
  letter-spacing: 0.5px;
  color: #ffffff;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.5);
  font-size: 2.5em;
  font-weight: 700;
}

header p {
  margin: 0 0 16px;
  color: rgba(255, 255, 255, 0.8);
}

.card {
  background: rgba(20, 20, 30, 0.85);
  border: 1px solid rgba(233, 30, 146, 0.3);
  border-radius: 16px;
  padding: 20px;
  margin-bottom: 20px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
  backdrop-filter: blur(10px);
}

.card h2 {
  margin-top: 0;
  margin-bottom: 12px;
  color: #ffffff;
  font-weight: 600;
  font-size: 1.5em;
}

.card h3 {
  color: #ff69b4;
  font-weight: 600;
  font-size: 1.1em;
  margin-top: 16px;
  margin-bottom: 12px;
}

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 10px;
}

label {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 14px;
  color: rgba(255, 255, 255, 0.9);
}

input[type="text"],
input[type="number"],
input[type="file"],
select {
  background: rgba(0, 0, 0, 0.4);
  border: 1px solid rgba(233, 30, 146, 0.4);
  border-radius: 8px;
  padding: 10px;
  color: #ffffff;
  transition: border-color 0.2s ease;
}

input[type="text"]:focus,
input[type="number"]:focus,
input[type="file"]:focus,
select:focus {
  outline: none;
  border-color: #e91e92;
  box-shadow: 0 0 0 2px rgba(233, 30, 146, 0.2);
}

input[type="file"] {
  padding: 8px;
}

button {
  background: linear-gradient(135deg, #e91e92, #ff69b4);
  color: #fff;
  border: none;
  border-radius: 10px;
  padding: 12px 20px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
  box-shadow: 0 4px 12px rgba(233, 30, 146, 0.3);
}

button:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(233, 30, 146, 0.5);
  background: linear-gradient(135deg, #ff1a8f, #ff79c4);
}

.actions {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 12px;
  flex-wrap: wrap;
}

.inline {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
}
.download-options,
.export-options {
  display: flex;
  gap: 16px;
  margin: 12px 0;
  flex-wrap: wrap;
  align-items: center;
}

.download-options label,
.export-options label {
  display: flergba(0, 0, 0, 0.3);
  border-radius: 8px;
  border: 1px solid rgba(233, 30, 146, 0.3);
}

.manual-map-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
  background: rgba(20, 20, 30, 0.6);
  border-radius: 8px;
  border: 1px solid rgba(233, 30, 146, 0.2)
.export-options select {
  width: 200px;
}

.manual-map-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 400px;
  overflow-y: auto;
  padding: 12px;
  background: #f5f5f5;
  border-radius: 4px;
}

.manual-map-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px;
  background: white;
  border-radius: 4px;
  border: 1px solid #ddd;
}

.manual-map-item .filename {
  flex: 1;
  font-weight: 500;
  overflow: hidden;
  text-overflow: ellipsis;
  color: #ffffff;
}

.manual-map-item select {
  width: 180px;
}

.manual-map-item .remove-btn {
  padding: 6px 12px;
  background: linear-gradient(135deg, #ff1744, #f50057);
  color: white;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  font-size: 12px;
  font-weight: 600;
  transition: all 0.2s ease;
}

.manual-map-item .remove-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(255, 23, 68, 0.4);
}

/* Mutes Section */
.mutes {
  min-height: 60px;
}

.sections .section-row,
.mutes .mute-row {
  display: grid;
  grid-template-columns: 200px 1fr;
  align-items: center;
  gap: 16px;
  padding: 10px 0;
  border-bottom: 1px solid #202533;
}

.sections .section-row label:first-child {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
}

.sections .section-row label:last-child {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: #9aa5b5;
}

.sections .section-row label:last-child input[type="number"] {
  width: 80px;
}

.sections .section-row input[type="checkbox"] {
  margin: 0;
  cursor: pointer;
}

.sections .section-row:last-child,
.mutes .mute-row:last-child {
  border-bottom: none;
}

.mute-role {
  min-width: 120px;
  font-weight: 600;
  font-size: 14px;
}

.mute-sections {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
  gap: 8px;
  align-items: center;
}

.mute-sections label {
  display: flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
  font-size: 13px;
  cursor: pointer;
}

.mute-sections input[type="checkbox"] {
  margin: 0;
  cursor: pointer;
  accent-color: #e91e92;
}

#log {
  background: rgba(0, 0, 0, 0.5);
  border: 1px solid rgba(233, 30, 146, 0.3);
  border-radius: 8px;
  padding: 12px;
  min-height: 120px;
  max-height: 240px;
  overflow: auto;
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
  color: rgba(255, 255, 255, 0.9);
}

/* Timeline Styles - Rebuilt from scratch */
.timeline-container {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.timeline-info {
  padding: 12px;
  background: rgba(20, 20, 30, 0.6);
  border-radius: 10px;
  border: 1px solid rgba(233, 30, 146, 0.3);
}

.timeline-info label {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  cursor: pointer;
}

.timeline-palette {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.palette-label,
.arrangement-label {
  font-size: 13px;
  font-weight: 600;
  color: #ff69b4;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.palette-items {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  padding: 20px;
  background: rgba(20, 20, 30, 0.5);
  border-radius: 12px;
  border: 2px dashed rgba(233, 30, 146, 0.4);
  min-height: 80px;
}

.timeline-arrangement {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.arrangement-track {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  padding: 20px;
  background: rgba(0, 0, 0, 0.4);
  border-radius: 12px;
  border: 2px solid rgba(233, 30, 146, 0.3);
  min-height: 120px;
  position: relative;
}

.arrangement-track.drag-over {
  background: rgba(233, 30, 146, 0.15);
  border-color: #e91e92;
  box-shadow: 0 0 20px rgba(233, 30, 146, 0.3);
}

.arrangement-track:empty::before {
  content: 'Drag sections here to build your arrangement';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  color: rgba(255, 255, 255, 0.4);
  font-size: 14px;
  pointer-events: none;
  white-space: nowrap;
}

.section-block {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 16px 28px;
  background: linear-gradient(135deg, #e91e92, #ff69b4);
  border-radius: 10px;
  cursor: grab;
  user-select: none;
  box-shadow: 0 4px 16px rgba(233, 30, 146, 0.4);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  min-width: 140px;
  border: 2px solid rgba(255, 255, 255, 0.3);
  font-weight: 600;
  font-size: 14px;
  color: #ffffff;
  text-align: center;
}

.section-block:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(233, 30, 146, 0.6);
}

.section-block:active {
  cursor: grabbing;
}

.section-block.dragging {
  opacity: 0.5;
  cursor: grabbing;
}

.section-block.in-timeline {
  background: linear-gradient(135deg, #c71585, #ff1493);
  border-color: rgba(255, 255, 255, 0.4);
}

.section-block.in-timeline::after {
  content: '→';
  position: absolute;
  right: -18px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 20px;
  color: rgba(255, 105, 180, 0.8);
}

.section-block.in-timeline:last-child::after {
  content: '';
}

.section-name {
  font-weight: 600;
  font-size: 14px;
  color: #fff;
  margin-bottom: 4px;
}

.section-bars {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: rgba(255, 255, 255, 0.8);
}

.section-bars input {
  width: 50px;
  padding: 4px 6px;
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 4px;
  color: #fff;
  text-align: center;
  font-size: 12px;
}

.section-bars input:focus {
  outline: none;
  border-color: rgba(255, 255, 255, 0.5);
}

.section-remove {
  position: absolute;
  top: -8px;
  right: -8px;
  width: 24px;
  height: 24px;
  background: linear-gradient(135deg, #ff1744, #f50057);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 12px;
  color: #fff;
  font-weight: bold;
  opacity: 0;
  transition: all 0.2s ease;
  border: 2px solid rgba(255, 255, 255, 0.3);
}

.section-block.in-timeline:hover .section-remove {
  opacity: 1;
}

.section-remove:hover {
  transform: scale(1.1);
  box-shadow: 0 4px 12px rgba(255, 23, 68, 0.5);
}

.clear-btn {
  align-self: flex-start;
  background: linear-gradient(135deg, #ff1744, #f50057);
  padding: 10px 18px;
  font-size: 13px;
}

.clear-btn:hover {
  background: linear-gradient(135deg, #ff0033, #ff1159);
  box-shadow: 0 6px 20px rgba(255, 23, 68, 0.4);
}

.timeline-disabled {
  opacity: 0.5;
  pointer-events: none;
}
