* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  --primary: #6366f1;
  --primary-light: #818cf8;
  --secondary: #ec4899;
  --accent: #14b8a6;
  --success: #10b981;
  --warning: #f59e0b;
  --danger: #ef4444;
  --bg-main: #ffffff;
  --bg-light: #f8fafc;
  --bg-dark: #1e293b;
  --text-dark: #0f172a;
  --text-light: #64748b;
  --border-color: #e2e8f0;
  --shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
  --shadow-lg: 0 20px 50px rgba(0, 0, 0, 0.15);
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: 'Inter', 'Cairo', sans-serif;
  background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
  min-height: 100vh;
  color: var(--text-dark);
}

/* ====== NAVBAR ====== */
.navbar {
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(20px);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
  padding: 1rem 2rem;
  position: sticky;
  top: 0;
  z-index: 100;
  border-bottom: 1px solid var(--border-color);
}

.navbar-container {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.logo {
  font-size: 1.8rem;
  font-weight: 800;
  background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.nav-links {
  display: flex;
  gap: 2rem;
  align-items: center;
}

.nav-link {
  text-decoration: none;
  color: var(--text-light);
  font-weight: 600;
  font-size: 0.95rem;
  transition: all 0.3s ease;
  position: relative;
}

.nav-link:hover {
  color: var(--primary);
}

.nav-link::after {
  content: '';
  position: absolute;
  bottom: -5px;
  left: 0;
  width: 0;
  height: 2px;
  background: var(--primary);
  transition: width 0.3s ease;
}

.nav-link:hover::after {
  width: 100%;
}

/* ====== MAIN CONTAINER ====== */
.container {
  max-width: 1000px;
  margin: 0 auto;
  padding: 3rem 2rem;
}

/* ====== HEADER SECTION ====== */
.header-section {
  text-align: center;
  margin-bottom: 3rem;
  animation: slideDown 0.6s ease;
}

@keyframes slideDown {
  from {
    opacity: 0;
    transform: translateY(-20px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.header-section h1 {
  font-size: 3rem;
  font-weight: 800;
  margin-bottom: 1rem;
  color: var(--text-dark);
  line-height: 1.2;
}

.header-section .gradient-text {
  background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.header-section p {
  font-size: 1.1rem;
  color: var(--text-light);
  max-width: 600px;
  margin: 0 auto;
}

/* ====== CARD CONTAINER ====== */
.main-card {
  background: white;
  border-radius: 24px;
  padding: 3rem;
  box-shadow: var(--shadow-lg);
  margin-bottom: 2rem;
  overflow: hidden;
  position: relative;
}

.main-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(90deg, var(--primary) 0%, var(--secondary) 100%);
}

/* ====== PROFILE SECTION ====== */
.profile-wrapper {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-bottom: 2.5rem;
  text-align: center;
  animation: slideDown 0.6s ease;
}

.profile-avatar {
  width: 90px;
  height: 90px;
  border-radius: 50%;
  object-fit: cover;
  border: 4px solid #ffffff;
  box-shadow: 0 10px 25px rgba(99, 102, 241, 0.3);
  margin-bottom: 12px;
}

.profile-name {
  font-size: 1.4rem;
  font-weight: 900;
  background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  margin: 0;
  letter-spacing: 0.5px;
}

/* ====== UPLOAD SECTION ====== */
.upload-area {
  border: 3px dashed var(--border-color);
  border-radius: 20px;
  padding: 3rem;
  text-align: center;
  cursor: pointer;
  transition: all 0.3s ease;
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.02) 0%, rgba(236, 72, 153, 0.02) 100%);
}

.upload-area:hover {
  border-color: var(--primary);
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.05) 0%, rgba(236, 72, 153, 0.05) 100%);
  transform: translateY(-2px);
}

.upload-area.dragover {
  border-color: var(--accent);
  background: linear-gradient(135deg, rgba(20, 184, 166, 0.1) 0%, rgba(99, 102, 241, 0.1) 100%);
  transform: scale(1.02);
}

.upload-icon {
  font-size: 4rem;
  background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  margin-bottom: 1.5rem;
  animation: float 3s ease-in-out infinite;
}

@keyframes float {

  0%,
  100% {
    transform: translateY(0px);
  }

  50% {
    transform: translateY(-10px);
  }
}

.upload-title {
  font-size: 1.4rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
  color: var(--text-dark);
}

.upload-desc {
  color: var(--text-light);
  font-size: 1rem;
  margin-bottom: 1rem;
}

#audioFile {
  display: none;
}

/* ====== FILE INFO SECTION ====== */
.file-info-section {
  display: none;
  margin-top: 2rem;
  animation: slideUp 0.4s ease;
}

@keyframes slideUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.file-info-section.show {
  display: block;
}

.file-details {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 1.5rem;
  margin-bottom: 2rem;
}

.detail-box {
  background: var(--bg-light);
  padding: 1.5rem;
  border-radius: 16px;
  text-align: center;
  border: 2px solid var(--border-color);
  transition: all 0.3s ease;
}

.detail-box:hover {
  border-color: var(--primary);
  background: rgba(99, 102, 241, 0.05);
}

.detail-label {
  color: var(--text-light);
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 0.5rem;
  font-weight: 600;
}

.detail-value {
  font-size: 1.3rem;
  font-weight: 700;
  background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

/* ====== WAVEFORM ====== */
.waveform-section {
  display: none;
  margin-top: 2rem;
}

.waveform-section.show {
  display: block;
}

.waveform-title {
  font-size: 0.9rem;
  color: var(--text-light);
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 1rem;
  font-weight: 600;
}

canvas {
  width: 100%;
  height: 150px;
  background: linear-gradient(135deg, var(--bg-light) 0%, rgba(99, 102, 241, 0.05) 100%);
  border-radius: 12px;
  display: block;
}

/* ====== SETTINGS SECTION ====== */
.settings-section {
  margin: 2rem 0;
  padding: 2rem;
  background: var(--bg-light);
  border-radius: 16px;
  display: none;
}

.settings-section.show {
  display: block;
}

.settings-title {
  font-size: 1.2rem;
  font-weight: 700;
  margin-bottom: 1.5rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.settings-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 1.5rem;
  margin-bottom: 1.5rem;
}

.setting-group {
  display: flex;
  flex-direction: column;
}

.setting-label {
  font-weight: 600;
  margin-bottom: 0.75rem;
  color: var(--text-dark);
  font-size: 0.95rem;
}

.setting-select,
.setting-input {
  padding: 0.75rem;
  border: 2px solid var(--border-color);
  border-radius: 10px;
  font-size: 0.95rem;
  transition: all 0.3s ease;
  background: white;
  color: var(--text-dark);
  font-family: inherit;
}

.setting-select:focus,
.setting-input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

.setting-checkbox {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  cursor: pointer;
  padding: 0.75rem;
  border-radius: 10px;
  transition: all 0.3s ease;
}

.setting-checkbox:hover {
  background: rgba(99, 102, 241, 0.1);
}

.setting-checkbox input[type="checkbox"] {
  width: 20px;
  height: 20px;
  cursor: pointer;
  accent-color: var(--primary);
}

/* ====== PROGRESS SECTION ====== */
.progress-section {
  display: none;
  margin: 2rem 0;
}

.progress-section.show {
  display: block;
  animation: slideUp 0.4s ease;
}

.progress-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
}

.progress-status {
  font-weight: 700;
  color: var(--text-dark);
}

.progress-percent {
  background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  font-weight: 700;
}

.progress-bar {
  width: 100%;
  height: 12px;
  background: var(--border-color);
  border-radius: 10px;
  overflow: hidden;
  margin-bottom: 1.5rem;
}

.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--primary) 0%, var(--secondary) 100%);
  width: 0%;
  transition: width 0.3s ease;
  border-radius: 10px;
}

.steps-container {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1rem;
}

.step {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  padding: 1rem;
  background: white;
  border-radius: 12px;
  border: 2px solid var(--border-color);
  transition: all 0.3s ease;
}

.step.active {
  border-color: var(--primary);
  background: rgba(99, 102, 241, 0.05);
}

.step.done {
  border-color: var(--success);
  background: rgba(16, 185, 129, 0.05);
}

.step-icon {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  background: var(--border-color);
  color: var(--text-light);
  transition: all 0.3s ease;
}

.step.active .step-icon {
  background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
  color: white;
  animation: pulse 1.5s infinite;
}

.step.done .step-icon {
  background: var(--success);
  color: white;
}

@keyframes pulse {

  0%,
  100% {
    opacity: 1;
  }

  50% {
    opacity: 0.7;
  }
}

.step-label {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-light);
}

.step.active .step-label {
  color: var(--primary);
}

.step.done .step-label {
  color: var(--success);
}

/* ====== RESULTS SECTION ====== */
.results-section {
  display: none;
  margin-top: 2rem;
}

.results-section.show {
  display: block;
  animation: slideUp 0.4s ease;
}

.result-item {
  background: white;
  border-radius: 20px;
  padding: 2rem;
  margin-bottom: 1.5rem;
  border: 2px solid var(--border-color);
  transition: all 0.3s ease;
  overflow: hidden;
  position: relative;
}

.result-item:hover {
  border-color: var(--primary);
  box-shadow: 0 15px 40px rgba(99, 102, 241, 0.15);
  transform: translateY(-5px);
}

.result-item.vocal {
  border-left: 5px solid var(--secondary);
}

.result-item.inst {
  border-left: 5px solid var(--accent);
}

.result-header {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  margin-bottom: 1.5rem;
  padding-bottom: 1.5rem;
  border-bottom: 2px solid var(--border-color);
}

.result-icon {
  width: 60px;
  height: 60px;
  border-radius: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.8rem;
  flex-shrink: 0;
}

.result-icon.vocal {
  background: linear-gradient(135deg, rgba(236, 72, 153, 0.2) 0%, rgba(236, 72, 153, 0.1) 100%);
  color: var(--secondary);
}

.result-icon.inst {
  background: linear-gradient(135deg, rgba(20, 184, 166, 0.2) 0%, rgba(20, 184, 166, 0.1) 100%);
  color: var(--accent);
}

.result-info h3 {
  font-size: 1.3rem;
  font-weight: 700;
  margin-bottom: 0.25rem;
}

.result-info p {
  color: var(--text-light);
  font-size: 0.95rem;
}

/* ====== AUDIO PLAYER ====== */
.player-container {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  margin-bottom: 1.5rem;
  padding: 1rem;
  background: var(--bg-light);
  border-radius: 14px;
}

.play-btn {
  width: 50px;
  height: 50px;
  border-radius: 50%;
  border: none;
  background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
  color: white;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  transition: all 0.3s ease;
  flex-shrink: 0;
  box-shadow: 0 5px 20px rgba(99, 102, 241, 0.3);
}

.play-btn:hover {
  transform: scale(1.1);
  box-shadow: 0 8px 30px rgba(99, 102, 241, 0.4);
}

.play-btn:active {
  transform: scale(0.95);
}

.timeline-container {
  flex: 1;
}

.time-display {
  display: flex;
  justify-content: space-between;
  font-size: 0.85rem;
  color: var(--text-light);
  margin-bottom: 0.75rem;
  font-weight: 600;
}

.timeline {
  width: 100%;
  height: 6px;
  background: var(--border-color);
  border-radius: 10px;
  cursor: pointer;
  -webkit-appearance: none;
  appearance: none;
  outline: none;
}

.timeline::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
  cursor: pointer;
  box-shadow: 0 2px 10px rgba(99, 102, 241, 0.4);
}

.timeline::-moz-range-thumb {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
  cursor: pointer;
  border: none;
  box-shadow: 0 2px 10px rgba(99, 102, 241, 0.4);
}

audio {
  display: none;
}

/* ====== BUTTONS ====== */
.btn {
  padding: 0.75rem 1.5rem;
  border: none;
  border-radius: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  font-size: 1rem;
  font-family: inherit;
}

.btn-primary {
  background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
  color: white;
  width: 100%;
  padding: 1rem;
  font-size: 1.05rem;
  font-weight: 700;
  box-shadow: 0 8px 20px rgba(99, 102, 241, 0.3);
  border: none;
}

.btn-primary:hover {
  transform: translateY(-3px);
  box-shadow: 0 12px 30px rgba(99, 102, 241, 0.4);
}

.btn-primary:active {
  transform: translateY(-1px);
}

.btn-primary:disabled {
  opacity: 0.7;
  cursor: not-allowed;
  transform: none;
}

.btn-secondary {
  background: white;
  border: 2px solid var(--border-color);
  color: var(--text-dark);
  width: 100%;
}

.btn-secondary:hover {
  border-color: var(--primary);
  color: var(--primary);
  background: rgba(99, 102, 241, 0.05);
}

.btn-sm {
  padding: 0.6rem 1.2rem;
  font-size: 0.9rem;
  width: auto;
}

/* ====== TOAST NOTIFICATIONS ====== */
.toast-container {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  z-index: 2000;
}

.toast {
  background: white;
  border-radius: 12px;
  padding: 1rem 1.5rem;
  display: flex;
  align-items: center;
  gap: 1rem;
  min-width: 300px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
  animation: slideInRight 0.3s ease;
  border-left: 4px solid var(--primary);
}

.toast.success {
  border-left-color: var(--success);
}

.toast.error {
  border-left-color: var(--danger);
}

.toast.warning {
  border-left-color: var(--warning);
}

@keyframes slideInRight {
  from {
    transform: translateX(400px);
    opacity: 0;
  }

  to {
    transform: translateX(0);
    opacity: 1;
  }
}

/* ====== RESPONSIVE ====== */
@media (max-width: 768px) {
  .navbar {
    padding: 1rem;
  }

  .navbar-container {
    flex-direction: column;
    gap: 1rem;
  }

  .nav-links {
    gap: 1rem;
    font-size: 0.85rem;
  }

  .header-section h1 {
    font-size: 1.8rem;
  }

  .container {
    padding: 1.5rem 1rem;
  }

  .main-card {
    padding: 1.5rem;
  }

  .upload-icon {
    font-size: 2.5rem;
  }

  .file-details {
    grid-template-columns: 1fr 1fr;
  }

  .steps-container {
    grid-template-columns: repeat(2, 1fr);
  }

  .toast-container {
    right: 1rem;
    left: 1rem;
  }

  .toast {
    min-width: auto;
  }

  .result-header {
    flex-direction: column;
    align-items: flex-start;
  }

  .player-container {
    flex-wrap: wrap;
  }
}

.loader {
  width: 30px;
  height: 30px;
  border: 3px solid var(--border-color);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

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

/* ====== PAGE TRANSITIONS ====== */
.page {
  display: none;
  animation: fadeIn 0.4s ease;
}

.page.active {
  display: block;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}