* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
}

:root {
  --sky-blue: #00c4ff;
  --sky-pink: #ff005e;
  --sky-green: #00ffb3;
  --sky-blue-light: rgba(0, 196, 255, 0.1);
  --sky-pink-light: rgba(255, 0, 94, 0.1);
  --sky-green-light: rgba(0, 255, 179, 0.1);
  --light-bg: #ffffff;
  --card-bg: #f8f9fa;
  --card-hover: #f1f3f4;
  --text-primary: #202124;
  --text-secondary: #5f6368;
  --text-tertiary: #9aa0a6;
  --border-light: #dadce0;
  --shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
  --shadow-hover: 0 8px 25px rgba(0, 0, 0, 0.12);
}

body {
  background: var(--light-bg);
  color: var(--text-primary);
  line-height: 1.6;
  padding: 50px;
}

.container {
  max-width: 1000px;
  margin: 0 auto;
  padding: 20px;
}

/* Hero Section */
.hero-section {
  text-align: center;
  margin-bottom: 20px;
  padding: 10px 0;
}

.hero-section h1 {
  font-size: 1.8rem;
  margin-bottom: 10px;
  background: linear-gradient(90deg, var(--sky-blue), var(--sky-pink), var(--sky-green));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  font-weight: 700;
  letter-spacing: -0.5px;
}

.hero-section p {
  font-size: 1rem;
  color: var(--text-secondary);
  max-width: 800px;
  margin: 0 auto;
  line-height: 1.5;
}

.gradient-bar {
  height: 3px;
  width: 300px;
  background: linear-gradient(90deg, var(--sky-blue), var(--sky-pink), var(--sky-green));
  margin: 10px auto 15px;
  border-radius: 2px;
}

/* Upload Section */
.upload-section {
  margin: 30px 0;
  text-align: center;
}

.upload-box {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: var(--card-bg);
  border: 2px dashed var(--sky-blue);
  border-radius: 12px;
  padding: 40px 20px;
  cursor: pointer;
  transition: all 0.3s ease;
  min-height: 200px;
  box-shadow: var(--shadow);
  position: relative;
  overflow: hidden;
}

.upload-box::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 3px;
  background: linear-gradient(90deg, var(--sky-blue), var(--sky-pink), var(--sky-green));
}

.upload-box:hover {
  background: var(--sky-blue-light);
  box-shadow: var(--shadow-hover);
  transform: translateY(-3px);
}

.upload-icon {
  font-size: 48px;
  margin-bottom: 15px;
  color: var(--sky-blue);
  transition: all 0.3s ease;
}

.upload-box:hover .upload-icon {
  color: var(--sky-pink);
  transform: scale(1.1);
}

.upload-content p {
  margin: 5px 0;
  font-size: 1.1rem;
}

.upload-content strong {
  color: var(--text-primary);
}

.upload-content small {
  color: var(--text-tertiary);
  font-size: 0.9rem;
}

#audioFile {
  display: none;
}

/* Upload Button Style */
.upload-button {
  display: inline-block;
  margin-top: 15px;
  padding: 12px 30px;
  background: linear-gradient(90deg, var(--sky-blue), var(--sky-pink));
  color: white;
  border: none;
  border-radius: 6px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: var(--shadow);
  position: relative;
  overflow: hidden;
  z-index: 1;
}

.upload-button::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, var(--sky-pink), var(--sky-green), var(--sky-blue));
  transition: left 0.5s ease;
  z-index: -1;
}

.upload-button:hover::before {
  left: 0;
}

.upload-button:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-hover);
}

/* Player Section */
.player-section {
  margin: 40px 0;
  text-align: center;
  display: none;
}

#waveform {
  width: 100%;
  height: 150px;
  margin: 20px 0;
  border: 1px solid var(--border-light);
  border-radius: 8px;
  box-shadow: var(--shadow);
  background: var(--light-bg);
  position: relative;
  overflow: hidden;
}

.waveform-container {
  width: 100%;
  height: 100%;
}

.waveform-loading {
  display: flex;
  justify-content: center;
  align-items: center;
  height: 150px;
  color: var(--sky-blue);
  font-size: 1rem;
}

.time-controls {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin: 20px 0;
  gap: 15px;
}

.time-input-group {
  display: flex;
  flex-direction: column;
  align-items: center;
  flex: 1;
}

.time-input-group label {
  font-size: 14px;
  color: var(--text-secondary);
  margin-bottom: 5px;
  font-weight: 600;
}

.time-input {
  width: 100%;
  padding: 10px;
  border: 2px solid var(--border-light);
  border-radius: 6px;
  text-align: center;
  font-size: 16px;
  font-weight: 600;
  color: var(--text-primary);
  transition: all 0.3s ease;
}

.time-input:focus {
  outline: none;
  border-color: var(--sky-blue);
  box-shadow: 0 0 0 3px var(--sky-blue-light);
}

.time-display {
  font-size: 14px;
  color: var(--text-secondary);
  margin-top: 5px;
}

.controls {
  display: flex;
  justify-content: space-between;
  margin: 15px 0;
  font-size: 14px;
  color: var(--text-secondary);
}

.buttons {
  display: flex;
  justify-content: center;
  gap: 15px;
  margin-top: 20px;
}

.buttons button {
  padding: 12px 25px;
  border: none;
  background: var(--sky-blue);
  color: white;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.3s ease;
  font-weight: 600;
  box-shadow: var(--shadow);
  position: relative;
  overflow: hidden;
  z-index: 1;
}

.buttons button::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, var(--sky-pink), var(--sky-green), var(--sky-blue));
  transition: left 0.5s ease;
  z-index: -1;
}

.buttons button:hover::before {
  left: 0;
}

.buttons button:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-hover);
}

.buttons button:disabled {
  background: var(--text-tertiary);
  cursor: not-allowed;
  transform: none;
  box-shadow: var(--shadow);
}

.buttons button:disabled::before {
  display: none;
}

/* Steps Section */
.steps-section {
  margin: 50px 0;
}

.section-title {
  font-size: 1.8rem;
  text-align: center;
  margin: 40px 0 30px;
  position: relative;
  color: var(--text-primary);
  font-weight: 600;
}

.section-title::after {
  content: '';
  display: block;
  width: 80px;
  height: 4px;
  background: linear-gradient(90deg, var(--sky-blue), var(--sky-pink), var(--sky-green));
  margin: 15px auto 0;
  border-radius: 2px;
}

.steps-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 20px;
}

.step-card {
  background: var(--light-bg);
  padding: 25px 20px;
  border-radius: 12px;
  text-align: center;
  transition: all 0.3s ease;
  border: 1px solid var(--border-light);
  box-shadow: var(--shadow);
  position: relative;
  overflow: hidden;
}

.step-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 3px;
  background: linear-gradient(90deg, var(--sky-blue), var(--sky-pink), var(--sky-green));
}

.step-card:hover {
  transform: translateY(-5px);
  box-shadow: var(--shadow-hover);
}

.step-icon {
  font-size: 2.5rem;
  margin-bottom: 15px;
  color: var(--sky-blue);
  height: 60px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s ease;
}

.step-card:hover .step-icon {
  color: var(--sky-pink);
  transform: scale(1.05);
}

.step-card h3 {
  margin-bottom: 12px;
  color: var(--text-primary);
  font-size: 1.2rem;
  font-weight: 600;
}

.step-card p {
  color: var(--text-secondary);
  font-size: 0.9rem;
  line-height: 1.4;
}

/* FAQ Section */
.faq-section {
  margin: 50px 0;
}

.faq-container {
  max-width: 800px;
  margin: 0 auto;
}

.faq-item {
  background: var(--light-bg);
  margin-bottom: 12px;
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid var(--border-light);
  box-shadow: var(--shadow);
  transition: all 0.3s ease;
}

.faq-item:hover {
  background: var(--card-hover);
}

.faq-question {
  padding: 18px 20px;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 1rem;
  font-weight: 500;
  color: var(--text-primary);
  transition: all 0.3s ease;
}

.faq-question:hover {
  color: var(--sky-blue);
}

.faq-question i {
  transition: transform 0.3s ease;
  color: var(--sky-pink);
}

.faq-answer {
  padding: 0 20px;
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.4s ease, padding 0.4s ease;
  color: var(--text-secondary);
  line-height: 1.5;
  font-size: 0.9rem;
}

.faq-item.active .faq-answer {
  padding: 0 20px 18px;
  max-height: 500px;
}

.faq-item.active .faq-question i {
  transform: rotate(45deg);
}

/* Animation for page load */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.fade-in {
  animation: fadeInUp 0.5s ease forwards;
}

/* Dual Marker Styles - Simple and Professional */
.markers-container {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  pointer-events: none;
  z-index: 10;
}

.start-marker, .end-marker {
  position: absolute;
  top: 0;
  width: 6px;
  height: 100%;
  cursor: ew-resize;
  pointer-events: auto;
  z-index: 11;
  border-radius: 3px;
  transition: all 0.2s ease;
}

.start-marker {
  background: #00ff00;
  left: 0;
  box-shadow: 0 0 5px rgba(0, 255, 0, 0.7);
}

.end-marker {
  background: #ff0000;
  right: 0;
  box-shadow: 0 0 5px rgba(255, 0, 0, 0.7);
}

.start-marker:hover, .end-marker:hover {
  width: 8px;
  transform: scaleX(1.2);
}

.selection-highlight {
  position: absolute;
  top: 0;
  height: 100%;
  background: rgba(0, 196, 255, 0.3);
  pointer-events: none;
  z-index: 9;
  border-left: 2px solid #00ff00;
  border-right: 2px solid #ff0000;
}

.marker-instruction {
  display: flex;
  justify-content: center;
  gap: 20px;
  margin: 10px 0;
  font-size: 0.9rem;
  color: var(--text-secondary);
}

.marker-color {
  display: inline-block;
  width: 12px;
  height: 12px;
  border-radius: 2px;
  margin-right: 5px;
}

.marker-color.start {
  background: #00ff00;
}

.marker-color.end {
  background: #ff0000;
}

.control-hint {
  text-align: center;
  color: var(--text-tertiary);
  font-size: 0.8rem;
  margin-top: 5px;
  font-style: italic;
}

/* Enhanced Selection Styles */
.waveform-container {
  position: relative;
  cursor: crosshair;
}

.selection-info {
  background: rgba(0, 196, 255, 0.1);
  border: 1px solid var(--sky-blue);
  border-radius: 6px;
  padding: 10px;
  margin: 10px 0;
  text-align: center;
}

.selection-info p {
  margin: 5px 0;
  font-size: 0.9rem;
  color: var(--text-secondary);
}

.enhanced-controls {
  display: flex;
  justify-content: center;
  gap: 10px;
  margin: 15px 0;
}

.enhanced-controls button {
  padding: 8px 15px;
  font-size: 0.9rem;
}

/* Drag selection visual feedback */
.waveform-dragging {
  cursor: grabbing !important;
}

/* Time input enhancements */
.time-input-group {
  position: relative;
}

.time-input:valid {
  border-color: var(--sky-green);
}

.time-input:invalid {
  border-color: var(--sky-pink);
}

.input-hint {
  font-size: 0.7rem;
  color: var(--text-tertiary);
  margin-top: 2px;
}

/* Responsive Design */
@media (max-width: 768px) {
  .container {
    padding: 0 10px;
  }
  
  .hero-section h1 {
    font-size: 1.7rem;
  }
  
  .section-title {
    font-size: 1.5rem;
    margin: 30px 0 20px;
  }
  
  .steps-grid {
    grid-template-columns: 1fr;
    gap: 15px;
  }
  
  .buttons {
    flex-direction: column;
    gap: 10px;
  }
  
  .buttons button {
    width: 100%;
  }
  
  .upload-box {
    padding: 30px 15px;
    min-height: 180px;
  }
  
  .upload-icon {
    font-size: 40px;
  }
  
  .upload-button {
    width: 100%;
    padding: 15px;
  }
  
  .time-controls {
    flex-direction: column;
    gap: 10px;
  }
  
  .time-input-group {
    width: 100%;
  }
  
  .marker-instruction {
    flex-direction: column;
    gap: 10px;
    text-align: center;
  }
  
  .enhanced-controls {
    flex-direction: column;
    gap: 5px;
  }
  
  .enhanced-controls button {
    width: 100%;
  }
  
  .start-marker, .end-marker {
    width: 5px;
  }
  
  .start-marker:hover, .end-marker:hover {
    width: 6px;
  }
}

@media (max-width: 480px) {
  .hero-section h1 {
    font-size: 1.5rem;
  }
  
  .hero-section p {
    font-size: 1rem;
  }
  
  .section-title {
    font-size: 1.3rem;
  }
  
  #waveform {
    height: 140px;
  }
}

/* Notification Styles */
.custom-notification {
  position: fixed;
  top: 20px;
  right: 20px;
  padding: 15px 20px;
  background: #4CAF50;
  color: white;
  border-radius: 6px;
  z-index: 10000;
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
  font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
  max-width: 400px;
  word-wrap: break-word;
  opacity: 0;
  transform: translateX(100px);
  transition: all 0.3s ease;
}

.custom-notification.show {
  opacity: 1;
  transform: translateX(0);
}

/* Mobile optimizations */
@media (max-width: 768px) {
  .selection-info {
    padding: 8px;
    font-size: 0.8rem;
  }
  
  .control-hint {
    font-size: 0.75rem;
    padding: 0 10px;
  }
}

/* Waveform region overrides */
wavesurfer-region {
  z-index: 8 !important;
}

wavesurfer-region[data-id="start-marker"] {
  border-left: 3px solid #00ff00 !important;
  border-right: none !important;
  background: rgba(0, 255, 0, 0.3) !important;
}

wavesurfer-region[data-id="end-marker"] {
  border-left: none !important;
  border-right: 3px solid #ff0000 !important;
  background: rgba(255, 0, 0, 0.3) !important;
}

wavesurfer-region[data-id="selection"] {
  background: rgba(0, 196, 255, 0.2) !important;
  border: none !important;
}