/**
 * Rhythm Chopper — Auto-slice stems into rhythmic patterns
 */

/* Modal Container */
.rhythm-chopper-modal {
  position: fixed;
  inset: 0;
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  animation: rc-fade-in 0.3s ease forwards;
}

@keyframes rc-fade-in {
  to { opacity: 1; }
}

.rc-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.9);
  backdrop-filter: blur(20px);
}

.rc-content {
  position: relative;
  background: linear-gradient(145deg, #0a1a2e 0%, #051020 50%, #030810 100%);
  border: 1px solid rgba(34, 211, 238, 0.4);
  border-radius: 24px;
  padding: 2rem;
  width: 90%;
  max-width: 550px;
  box-shadow: 
    0 0 80px rgba(34, 211, 238, 0.2),
    0 0 40px rgba(6, 182, 212, 0.15),
    inset 0 1px 0 rgba(255, 255, 255, 0.08);
  transform: scale(0.9) translateY(20px);
  animation: rc-slide-up 0.4s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes rc-slide-up {
  to { 
    transform: scale(1) translateY(0); 
  }
}

/* Header */
.rc-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.5rem;
}

.rc-header h2 {
  font-size: 1.4rem;
  font-weight: 700;
  color: #22d3ee;
  /* Gradient animation removed (Jobs audit: decorative) */
}

/* rc-gradient animation - REMOVED (Jobs audit: decorative) */

.rc-close {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.1);
  width: 36px;
  height: 36px;
  border-radius: 50%;
  color: #666;
  font-size: 1.2rem;
  cursor: pointer;
  transition: all 0.2s;
}

.rc-close:hover {
  background: rgba(255, 255, 255, 0.15);
  color: #fff;
  transform: rotate(90deg);
}

/* Stem Info */
.rc-stem-info {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.75rem 1rem;
  background: rgba(0, 0, 0, 0.3);
  border-radius: 12px;
  margin-bottom: 1.5rem;
}

.rc-stem-name {
  font-weight: 600;
  color: #f0f0f5;
}

.rc-stem-bpm {
  font-size: 0.85rem;
  color: #22d3ee;
  font-family: 'Space Mono', monospace;
}

/* Slice Visualization */
.rc-slices-container {
  margin-bottom: 1.5rem;
  padding: 1rem;
  background: rgba(0, 0, 0, 0.3);
  border-radius: 12px;
  border: 1px solid rgba(34, 211, 238, 0.2);
}

.rc-slices {
  display: flex;
  height: 60px;
  gap: 2px;
}

.rc-slice {
  flex: 1;
  background: rgba(34, 211, 238, 0.3);
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.15s;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
}

.rc-slice.active {
  background: linear-gradient(180deg, #22d3ee 0%, #0891b2 100%);
}

.rc-slice.muted {
  background: rgba(255, 255, 255, 0.05);
}

.rc-slice:hover {
  transform: scaleY(1.1);
}

.rc-slice.playing {
  background: #fff !important;
  box-shadow: 0 0 20px rgba(255, 255, 255, 0.5);
}

.slice-num {
  font-size: 0.6rem;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.7);
}

.rc-slice.muted .slice-num {
  color: rgba(255, 255, 255, 0.2);
}

/* Pattern Selection */
.rc-patterns {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.5rem;
  margin-bottom: 1rem;
}

.rc-pattern {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.3rem;
  padding: 0.7rem 0.4rem;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.2s;
}

.rc-pattern:hover {
  background: rgba(34, 211, 238, 0.1);
  border-color: rgba(34, 211, 238, 0.3);
  transform: translateY(-2px);
}

.rc-pattern.active {
  background: rgba(34, 211, 238, 0.2);
  border-color: #22d3ee;
  box-shadow: 0 0 20px rgba(34, 211, 238, 0.3);
}

.pattern-icon {
  font-size: 1rem;
  letter-spacing: -2px;
}

.pattern-name {
  font-size: 0.7rem;
  color: #888;
}

.rc-pattern.active .pattern-name {
  color: #fff;
}

/* BPM Control */
.rc-bpm-control {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  margin-bottom: 1.5rem;
  padding: 0.75rem;
  background: rgba(0, 0, 0, 0.2);
  border-radius: 10px;
}

.rc-bpm-control label {
  font-size: 0.85rem;
  color: #888;
}

.bpm-btn {
  width: 32px;
  height: 32px;
  border: 1px solid rgba(34, 211, 238, 0.3);
  border-radius: 6px;
  background: rgba(34, 211, 238, 0.1);
  color: #22d3ee;
  font-size: 1.2rem;
  cursor: pointer;
  transition: all 0.2s;
}

.bpm-btn:hover {
  background: rgba(34, 211, 238, 0.2);
  border-color: #22d3ee;
}

.bpm-input {
  width: 70px;
  padding: 0.5rem;
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid rgba(34, 211, 238, 0.3);
  border-radius: 6px;
  color: #22d3ee;
  font-size: 1rem;
  font-family: 'Space Mono', monospace;
  text-align: center;
}

.bpm-input:focus {
  outline: none;
  border-color: #22d3ee;
}

/* Action Buttons */
.rc-actions {
  display: flex;
  gap: 0.75rem;
}

.rc-btn {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 1rem;
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.05);
  color: #ddd;
  font-weight: 600;
  font-size: 0.95rem;
  cursor: pointer;
  transition: all 0.25s;
}

.rc-btn:hover {
  background: rgba(255, 255, 255, 0.1);
  transform: translateY(-2px);
}

.rc-btn.primary {
  background: linear-gradient(135deg, #22d3ee 0%, #0891b2 100%);
  border: none;
  color: #000;
}

.rc-btn.primary:hover {
  box-shadow: 0 0 35px rgba(34, 211, 238, 0.5);
}

.rc-btn.playing {
  background: rgba(239, 68, 68, 0.2);
  border-color: #ef4444;
  color: #ef4444;
}

/* Loading & Processing */
.rc-loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 3rem;
  gap: 1rem;
}

.rc-loading-spinner {
  width: 40px;
  height: 40px;
  border: 3px solid rgba(34, 211, 238, 0.2);
  border-top-color: #22d3ee;
  border-radius: 50%;
  animation: rc-spin 0.7s linear infinite;
}

@keyframes rc-spin {
  to { transform: rotate(360deg); }
}

.rc-loading-text {
  font-size: 0.9rem;
  color: #888;
}

.rc-processing {
  position: absolute;
  inset: 0;
  background: rgba(5, 16, 32, 0.97);
  border-radius: 24px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  z-index: 10;
}

.rc-processing.hidden {
  display: none;
}

.rc-processing .processing-spinner {
  width: 56px;
  height: 56px;
  border: 3px solid rgba(34, 211, 238, 0.2);
  border-top-color: #22d3ee;
  border-radius: 50%;
  animation: rc-spin 0.7s linear infinite;
}

.rc-processing .processing-text {
  font-size: 1rem;
  color: #22d3ee;
  font-weight: 500;
}

/* Mobile */
@media (max-width: 500px) {
  .rc-content {
    padding: 1.5rem;
    margin: 1rem;
  }
  
  .rc-patterns {
    grid-template-columns: repeat(4, 1fr);
    gap: 0.4rem;
  }
  
  .rc-pattern {
    padding: 0.5rem 0.25rem;
  }
  
  .pattern-name {
    font-size: 0.6rem;
  }
  
  .rc-actions {
    flex-direction: column;
  }
}
