/* ==========================================================================
   AudioWave Studio - Modern Dark Glassmorphism CSS Design System
   ========================================================================== */

:root {
  --bg-dark: #07090e;
  --bg-card: rgba(18, 24, 38, 0.65);
  --bg-card-hover: rgba(28, 37, 58, 0.8);
  --bg-card-active: rgba(30, 41, 67, 0.95);
  --border-card: rgba(255, 255, 255, 0.08);
  --border-card-active: rgba(0, 242, 254, 0.4);

  --accent-cyan: #00f2fe;
  --accent-blue: #4facfe;
  --accent-purple: #7f00ff;
  --accent-pink: #ff007f;
  
  --text-primary: #f1f5f9;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;

  --gradient-glow: linear-gradient(135deg, #00f2fe 0%, #4facfe 50%, #7f00ff 100%);
  --gradient-card: linear-gradient(180deg, rgba(255, 255, 255, 0.03) 0%, rgba(0, 0, 0, 0.2) 100%);

  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --radius-xl: 28px;

  --shadow-glow: 0 0 25px rgba(0, 242, 254, 0.25);
  --shadow-card: 0 10px 30px -10px rgba(0, 0, 0, 0.5);

  --font-main: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-heading: 'Outfit', sans-serif;
}

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

body {
  background-color: var(--bg-dark);
  background-image: 
    radial-gradient(circle at 15% 15%, rgba(0, 242, 254, 0.08) 0%, transparent 40%),
    radial-gradient(circle at 85% 85%, rgba(127, 0, 255, 0.08) 0%, transparent 40%),
    radial-gradient(circle at 50% 50%, rgba(79, 172, 254, 0.04) 0%, transparent 60%);
  background-attachment: fixed;
  color: var(--text-primary);
  font-family: var(--font-main);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
  line-height: 1.5;
}

/* Scrollbar */
::-webkit-scrollbar {
  width: 8px;
}
::-webkit-scrollbar-track {
  background: rgba(0, 0, 0, 0.2);
}
::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.15);
  border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
  background: rgba(0, 242, 254, 0.5);
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

.hidden {
  display: none !important;
}

/* App Container */
.app-container {
  max-width: 1280px;
  width: 100%;
  margin: 0 auto;
  padding: 6rem 1.5rem 8rem 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

/* Cache complètement le cartouche AudioWave Studio & sélection de dossier */
.app-header {
  display: none !important;
}

.logo-area {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.logo-icon {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-md);
  background: var(--gradient-glow);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #000;
  box-shadow: var(--shadow-glow);
}

.logo-area h1 {
  font-family: var(--font-heading);
  font-size: 1.75rem;
  font-weight: 700;
  background: linear-gradient(135deg, #ffffff 0%, #cbd5e1 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  letter-spacing: -0.5px;
}

.subtitle {
  font-size: 0.875rem;
  color: var(--text-secondary);
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.static-path-box {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background: rgba(0, 0, 0, 0.35);
  padding: 0.4rem 0.75rem;
  border-radius: var(--radius-md);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.path-label {
  font-size: 0.8rem;
  color: var(--text-muted);
  white-space: nowrap;
}

.static-path-box input {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: var(--radius-sm);
  color: var(--accent-cyan);
  font-family: monospace;
  font-size: 0.85rem;
  padding: 0.35rem 0.6rem;
  width: 140px;
  outline: none;
  transition: all 0.2s ease;
}

.static-path-box input:focus {
  border-color: var(--accent-cyan);
  background: rgba(0, 242, 254, 0.1);
  box-shadow: 0 0 10px rgba(0, 242, 254, 0.2);
}

.btn-sm {
  padding: 0.4rem 0.8rem;
  font-size: 0.825rem;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1.25rem;
  font-size: 0.925rem;
  font-weight: 600;
  border-radius: var(--radius-md);
  border: none;
  cursor: pointer;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  text-decoration: none;
  user-select: none;
}

.btn-primary {
  background: var(--gradient-glow);
  color: #050b14;
  box-shadow: 0 4px 15px rgba(0, 242, 254, 0.3);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(0, 242, 254, 0.45);
  filter: brightness(1.1);
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-primary);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.15);
  border-color: rgba(255, 255, 255, 0.2);
  transform: translateY(-2px);
}

.btn-glass {
  background: rgba(255, 255, 255, 0.05);
  color: var(--accent-cyan);
  border: 1px solid rgba(0, 242, 254, 0.3);
  backdrop-filter: blur(10px);
}

.btn-glass:hover {
  background: rgba(0, 242, 254, 0.12);
  border-color: var(--accent-cyan);
  box-shadow: 0 0 15px rgba(0, 242, 254, 0.2);
}

.btn-lg {
  padding: 0.875rem 1.75rem;
  font-size: 1rem;
}

/* Toolbar & Search */
.toolbar-section {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
}

.search-box {
  position: relative;
  flex: 1;
  min-width: 280px;
  max-width: 500px;
}

.search-box svg {
  position: absolute;
  left: 1.1rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  transition: color 0.2s;
}

.search-box input {
  width: 100%;
  padding: 0.75rem 1rem 0.75rem 2.8rem;
  background: rgba(18, 24, 38, 0.6);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-size: 0.95rem;
  outline: none;
  transition: all 0.25s ease;
  backdrop-filter: blur(10px);
}

.search-box input:focus {
  border-color: var(--accent-blue);
  box-shadow: 0 0 15px rgba(79, 172, 254, 0.2);
  background: rgba(24, 32, 50, 0.85);
}

.search-box input:focus + svg {
  color: var(--accent-cyan);
}

.toolbar-stats {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.badge {
  background: rgba(0, 242, 254, 0.1);
  color: var(--accent-cyan);
  padding: 0.35rem 0.85rem;
  border-radius: 20px;
  font-size: 0.85rem;
  font-weight: 600;
  border: 1px solid rgba(0, 242, 254, 0.2);
}

.info-tag {
  color: var(--text-muted);
  font-size: 0.875rem;
  background: rgba(255, 255, 255, 0.03);
  padding: 0.35rem 0.85rem;
  border-radius: 20px;
  border: 1px solid rgba(255, 255, 255, 0.05);
}

/* Drag & Drop Zone */
.drop-zone {
  border: 2px dashed rgba(0, 242, 254, 0.3);
  border-radius: var(--radius-lg);
  padding: 2.5rem;
  text-align: center;
  background: rgba(0, 242, 254, 0.02);
  transition: all 0.3s ease;
  display: none;
}

.drop-zone.active {
  display: block;
  background: rgba(0, 242, 254, 0.08);
  border-color: var(--accent-cyan);
  box-shadow: var(--shadow-glow);
}

.drop-icon {
  color: var(--accent-cyan);
  margin-bottom: 1rem;
  animation: pulse 2s infinite ease-in-out;
}

@keyframes pulse {
  0%, 100% { transform: translateY(0); opacity: 0.8; }
  50% { transform: translateY(-6px); opacity: 1; }
}

/* Empty State */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 4rem 2rem;
  text-align: center;
  background: var(--bg-card);
  backdrop-filter: blur(16px);
  border: 1px dashed rgba(255, 255, 255, 0.12);
  border-radius: var(--radius-xl);
  margin-top: 1rem;
}

.empty-illustration {
  width: 96px;
  height: 96px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.03);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  margin-bottom: 1.5rem;
  border: 1px solid rgba(255, 255, 255, 0.05);
}

.empty-state h2 {
  font-family: var(--font-heading);
  font-size: 1.5rem;
  margin-bottom: 0.5rem;
}

.empty-state p {
  color: var(--text-secondary);
  max-width: 480px;
  margin-bottom: 2rem;
  font-size: 0.95rem;
}

.empty-actions {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
  justify-content: center;
}

/* Vertical Track List */
.track-list-container {
  width: 100%;
}

.track-list {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

/* Track Card Item */
.track-card {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 1.25rem;
  padding: 1rem 1.25rem;
  background: var(--bg-card);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-lg);
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  position: relative;
  overflow: hidden;
}

.track-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 4px;
  height: 100%;
  background: var(--gradient-glow);
  opacity: 0;
  transition: opacity 0.3s ease;
}

.track-card:hover {
  background: var(--bg-card-hover);
  border-color: rgba(255, 255, 255, 0.15);
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.4);
}

.track-card.active {
  background: var(--bg-card-active);
  border-color: var(--border-card-active);
  box-shadow: var(--shadow-glow), 0 10px 30px rgba(0, 0, 0, 0.5);
}

.track-card.active::before {
  opacity: 1;
}

/* Card Left: Cover & Play button */
.track-left {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.track-cover {
  width: 52px;
  height: 52px;
  border-radius: var(--radius-md);
  background: var(--gradient-card);
  border: 1px solid rgba(255, 255, 255, 0.1);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.3rem;
  position: relative;
  flex-shrink: 0;
  overflow: hidden;
}

.play-overlay-btn {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--accent-cyan);
  color: #050b14;
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.25s ease;
  box-shadow: 0 4px 12px rgba(0, 242, 254, 0.4);
  flex-shrink: 0;
}

.play-overlay-btn:hover {
  transform: scale(1.1);
  background: #ffffff;
  box-shadow: 0 0 20px rgba(0, 242, 254, 0.7);
}

.track-card.active .play-overlay-btn {
  background: var(--accent-pink);
  color: #fff;
  box-shadow: 0 4px 15px rgba(255, 0, 127, 0.5);
}

/* Card Center: Info & Waveform */
.track-center {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  min-width: 0; /* Ensures truncation works */
}

.track-info-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.track-title {
  font-family: var(--font-heading);
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.track-meta-tags {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.tag-format {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  padding: 0.15rem 0.5rem;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-secondary);
  letter-spacing: 0.5px;
}

.tag-size {
  font-size: 0.75rem;
  color: var(--text-muted);
}

/* Waveform Canvas Wrapper */
.waveform-wrapper {
  position: relative;
  width: 100%;
  height: 48px;
  background: rgba(0, 0, 0, 0.25);
  border-radius: var(--radius-sm);
  overflow: hidden;
  cursor: pointer;
  border: 1px solid rgba(255, 255, 255, 0.04);
  transition: border-color 0.2s ease;
}

.waveform-wrapper:hover {
  border-color: rgba(0, 242, 254, 0.3);
}

.waveform-canvas {
  width: 100%;
  height: 100%;
  display: block;
}

/* Hover time indicator overlay */
.waveform-hover-time {
  position: absolute;
  top: 4px;
  transform: translateX(-50%);
  background: rgba(7, 9, 14, 0.9);
  color: var(--accent-cyan);
  font-size: 0.725rem;
  font-weight: 600;
  padding: 2px 6px;
  border-radius: 4px;
  border: 1px solid rgba(0, 242, 254, 0.3);
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.15s ease;
  z-index: 10;
  white-space: nowrap;
}

.waveform-wrapper:hover .waveform-hover-time {
  opacity: 1;
}

/* Card Right: Duration & Actions */
.track-right {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.35rem;
  flex-shrink: 0;
}

.track-duration {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-secondary);
  font-mono: monospace;
}

.track-card.active .track-duration {
  color: var(--accent-cyan);
}

.track-current-time {
  font-size: 0.75rem;
  color: var(--text-muted);
}

/* Global Floating Player Bar */
.global-player {
  position: fixed;
  bottom: 1.5rem;
  left: 50%;
  transform: translateX(-50%);
  width: calc(100% - 3rem);
  max-width: 1100px;
  background: rgba(12, 17, 29, 0.85);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: var(--radius-xl);
  padding: 0.85rem 1.75rem;
  display: grid;
  grid-template-columns: 240px 1fr 280px 180px;
  align-items: center;
  gap: 1.5rem;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.7), var(--shadow-glow);
  z-index: 1000;
  animation: slideUp 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes slideUp {
  from { transform: translate(-50%, 100%); opacity: 0; }
  to { transform: translate(-50%, 0); opacity: 1; }
}

.gp-track-info {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  min-width: 0;
}

.gp-cover {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-md);
  background: var(--gradient-glow);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  flex-shrink: 0;
}

.gp-details {
  min-width: 0;
}

.gp-title {
  font-size: 0.925rem;
  font-weight: 600;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.gp-meta {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.gp-controls {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
}

.gp-btn {
  background: transparent;
  border: none;
  color: var(--text-secondary);
  cursor: pointer;
  padding: 0.4rem;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
}

.gp-btn:hover {
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.08);
}

.gp-btn-main {
  width: 44px;
  height: 44px;
  background: var(--accent-cyan);
  color: #050b14;
  box-shadow: 0 0 15px rgba(0, 242, 254, 0.4);
}

.gp-btn-main:hover {
  background: #ffffff;
  color: #050b14;
  transform: scale(1.05);
}

.gp-progress-area {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  width: 100%;
}

.time-stamp {
  font-size: 0.75rem;
  color: var(--text-muted);
  font-mono: monospace;
  min-width: 38px;
}

.gp-slider-container {
  flex: 1;
  height: 6px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 3px;
  position: relative;
  cursor: pointer;
  overflow: hidden;
}

.gp-slider-fill {
  height: 100%;
  width: 0%;
  background: var(--gradient-glow);
  border-radius: 3px;
  transition: width 0.1s linear;
}

.gp-volume-area {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.5rem;
}

.gp-btn-sub {
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 0.35rem;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.gp-btn-sub:hover {
  color: var(--text-primary);
}

.volume-range {
  width: 80px;
  accent-color: var(--accent-cyan);
  cursor: pointer;
}

/* Responsive */
@media (max-width: 900px) {
  .global-player {
    grid-template-columns: 1fr auto;
    row-gap: 0.75rem;
    padding: 0.85rem 1.25rem;
  }
  .gp-progress-area {
    grid-column: 1 / -1;
  }
  .gp-volume-area {
    display: none;
  }
  .track-card {
    grid-template-columns: auto 1fr;
  }
  .track-right {
    display: none;
  }
}

@media (max-width: 600px) {
  .app-header {
    flex-direction: column;
    align-items: flex-start;
  }
  .header-actions {
    width: 100%;
  }
  .btn {
    flex: 1;
    justify-content: center;
  }
}
