* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Cairo', 'Segoe UI', sans-serif;
  background:
    radial-gradient(circle at top, rgba(255, 80, 80, 0.08), transparent 40%),
    radial-gradient(circle at bottom, rgba(255, 255, 255, 0.03), transparent 50%),
    #000000;
  min-height: 100vh;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 20px;
  color: #ffffff;
  overflow-x: hidden;
  position: relative;
}

/* خلفية جسيمات متحركة */
.particles-bg {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-image: 
    radial-gradient(1px 1px at 10% 20%, rgba(255, 255, 255, 0.1), transparent),
    radial-gradient(1px 1px at 30% 60%, rgba(255, 255, 255, 0.08), transparent),
    radial-gradient(1px 1px at 50% 10%, rgba(255, 255, 255, 0.06), transparent),
    radial-gradient(1px 1px at 70% 80%, rgba(255, 255, 255, 0.08), transparent),
    radial-gradient(1px 1px at 90% 40%, rgba(255, 255, 255, 0.06), transparent);
  background-size: 200px 200px;
  background-repeat: repeat;
  animation: particlesFloat 30s linear infinite;
  pointer-events: none;
  z-index: 0;
}

@keyframes particlesFloat {
  0% { transform: translateY(0) rotate(0deg); }
  100% { transform: translateY(-50px) rotate(2deg); }
}

.container {
  position: relative;
  z-index: 1;
  background:
    linear-gradient(155deg, rgba(255,255,255,0.04), rgba(255,255,255,0.015)),
    rgba(6, 6, 6, 0.96);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-radius: 40px;
  padding: 35px 35px;
  max-width: 1200px;
  width: 100%;
  box-shadow:
    0 42px 120px rgba(0, 0, 0, 0.95),
    inset 0 1px 0 rgba(255, 255, 255, 0.06),
    0 0 0 1px rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.05);
}

/* الهيدر */
.header {
  margin-bottom: 25px;
  text-align: center;
}

.logo-container {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 15px;
  margin-bottom: 5px;
}

.logo-icon {
  font-size: 2.5rem;
  animation: pulseIcon 2s ease-in-out infinite;
}

@keyframes pulseIcon {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.1); }
}

.main-title {
  font-weight: 900;
  font-size: 2.8rem;
  background: linear-gradient(135deg, #ffffff 0%, #cccccc 40%, #aaaaaa 70%, #ffffff 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  text-shadow: none;
  letter-spacing: 1px;
}

.main-title .highlight {
  background: linear-gradient(135deg, #ffd700, #ff6b6b);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  position: relative;
}

.main-title .highlight::after {
  content: '';
  position: absolute;
  bottom: -5px;
  left: 0;
  width: 100%;
  height: 3px;
  background: linear-gradient(90deg, #ffd700, #ff6b6b);
  border-radius: 10px;
  filter: blur(2px);
}

.subtitle {
  color: rgba(255, 255, 255, 0.3);
  font-size: 1rem;
  font-weight: 300;
  letter-spacing: 2px;
}

/* منطقة رفع الملف */
.upload-area {
  border: 2px dashed rgba(255, 255, 255, 0.1);
  border-radius: 30px;
  padding: 30px 20px;
  text-align: center;
  cursor: pointer;
  transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  background: rgba(255, 255, 255, 0.02);
  margin-bottom: 20px;
  position: relative;
  overflow: hidden;
}

.upload-area::before {
  content: '';
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: conic-gradient(from 0deg, transparent, rgba(255, 255, 255, 0.02), transparent, rgba(255, 255, 255, 0.02), transparent);
  animation: rotateBorder 15s linear infinite;
  pointer-events: none;
}

@keyframes rotateBorder {
  100% { transform: rotate(360deg); }
}

.upload-area:hover {
  border-color: rgba(255, 255, 255, 0.3);
  background: rgba(255, 255, 255, 0.04);
  transform: scale(1.01);
  box-shadow: 0 0 60px rgba(255, 255, 255, 0.02);
}

.upload-content {
  position: relative;
  z-index: 1;
}

.upload-icon {
  font-size: 2.5rem;
  margin-bottom: 8px;
  display: block;
}

.upload-area span {
  font-size: 1.1rem;
  color: rgba(255, 255, 255, 0.5);
  font-weight: 400;
  display: block;
}

.upload-area small {
  color: rgba(255, 255, 255, 0.2);
  font-size: 0.8rem;
  display: block;
  margin-top: 6px;
}

.upload-area input[type="file"] {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
  z-index: 2;
}

/* عناصر التحكم */
.controls {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 10px;
  background: rgba(255, 255, 255, 0.02);
  padding: 12px 18px;
  border-radius: 50px;
  margin-bottom: 20px;
  border: 1px solid rgba(255, 255, 255, 0.03);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
}

.controls-group {
  display: flex;
  align-items: center;
  gap: 8px;
}

.btn {
  font-family: 'Cairo', sans-serif;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.05);
  color: #ffffff;
  font-size: 0.9rem;
  font-weight: 600;
  padding: 8px 18px;
  border-radius: 40px;
  cursor: pointer;
  transition: all 0.3s ease;
  letter-spacing: 0.5px;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
  backdrop-filter: blur(10px);
  display: flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
}

.btn:hover {
  transform: translateY(-2px);
  background: rgba(255, 255, 255, 0.08);
  box-shadow: 0 8px 30px rgba(255, 255, 255, 0.05);
}

.btn-play {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(255, 255, 255, 0.08);
}

.btn-play:hover {
  background: rgba(255, 255, 255, 0.12);
}

.btn-stop {
  background: rgba(255, 50, 50, 0.05);
  border-color: rgba(255, 50, 50, 0.1);
}

.btn-stop:hover {
  background: rgba(255, 50, 50, 0.12);
}

.btn-download {
  background: rgba(0, 255, 136, 0.05);
  border-color: rgba(0, 255, 136, 0.08);
}

.btn-download:hover {
  background: rgba(0, 255, 136, 0.12);
}

.btn-fullscreen {
  background: rgba(255, 255, 255, 0.03);
  border-color: rgba(255, 255, 255, 0.05);
}

.btn-fullscreen:hover {
  background: rgba(255, 255, 255, 0.08);
}

.volume-group {
  flex: 1;
  min-width: 100px;
  gap: 10px;
}

.volume-icon {
  font-size: 1rem;
  opacity: 0.5;
}

.controls input[type="range"] {
  flex: 1;
  min-width: 50px;
  height: 3px;
  -webkit-appearance: none;
  appearance: none;
  background: linear-gradient(90deg, rgba(255, 255, 255, 0.1), rgba(255, 255, 255, 0.3));
  border-radius: 10px;
  outline: none;
}

.controls input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #ffffff;
  cursor: pointer;
  box-shadow: 0 0 30px rgba(255, 255, 255, 0.2);
  border: 2px solid rgba(255, 255, 255, 0.3);
}

#volumeLabel {
  min-width: 40px;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.4);
  font-size: 0.8rem;
  font-family: 'Cairo', sans-serif;
}

/* حاوية القماش */
.canvas-container {
  position: relative;
  border-radius: 24px;
  overflow: hidden;
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, 0.04),
    inset 0 0 80px rgba(0, 0, 0, 0.55),
    0 18px 60px rgba(0, 0, 0, 0.65);
  margin-bottom: 15px;
  background: #000000;
}

#waveCanvas {
  width: 100%;
  height: 350px;
  background: #000000;
  display: block;
  position: relative;
  z-index: 2;
  border-radius: 24px;
}

.canvas-overlay {
  position: absolute;
  bottom: 12px;
  left: 15px;
  right: 15px;
  display: flex;
  justify-content: space-between;
  pointer-events: none;
  z-index: 3;
}

.visualizer-info {
  display: flex;
  gap: 15px;
  font-family: 'Cairo', sans-serif;
  font-size: 0.75rem;
  color: rgba(255, 255, 255, 0.08);
  letter-spacing: 1px;
}

.visualizer-info span {
  background: rgba(15, 15, 15, 0.7);
  padding: 3px 10px;
  border-radius: 15px;
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.06);
  color: rgba(255, 255, 255, 0.82);
}

/* شريط الحالة */
.status-bar {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  padding-top: 12px;
  border-top: 1px solid rgba(255, 255, 255, 0.02);
}

.file-info {
  font-size: 0.85rem;
  color: rgba(255, 255, 255, 0.3);
  font-weight: 300;
  letter-spacing: 0.5px;
  font-family: 'Cairo', sans-serif;
}

.recording-status {
  font-size: 0.85rem;
  color: #ffb07c;
  font-weight: 500;
  text-shadow: 0 0 20px rgba(255, 176, 124, 0.05);
  font-family: 'Cairo', sans-serif;
}

/* استجابة للشاشات الصغيرة */
@media (max-width: 768px) {
  .container {
    padding: 20px 15px;
    border-radius: 25px;
  }
  
  .main-title {
    font-size: 2rem;
  }
  
  .controls {
    gap: 6px;
    padding: 10px 12px;
    border-radius: 30px;
  }
  
  .btn {
    padding: 6px 12px;
    font-size: 0.75rem;
  }
  
  #waveCanvas {
    height: 220px;
  }
  
  .visualizer-info {
    font-size: 0.6rem;
    gap: 8px;
  }
  
  .status-bar {
    flex-direction: column;
    align-items: center;
    text-align: center;
  }
}

@media (max-width: 480px) {
  .main-title {
    font-size: 1.5rem;
  }
  
  .logo-icon {
    font-size: 1.8rem;
  }
  
  .controls {
    flex-direction: column;
    align-items: stretch;
    border-radius: 20px;
  }
  
  .controls-group {
    justify-content: center;
  }
  
  .volume-group {
    min-width: unset;
  }
  
  #waveCanvas {
    height: 180px;
  }
}