/* ========== TUNESTAMIL OPTIMIZED STYLES ========== */

/* Base Font and Body Styles */
body { 
  font-family: 'Poppins', 'Inter', sans-serif; 
}

/* Full Player Performance Optimizations */
.full-player-sheet {
  will-change: transform;
  contain: layout style paint;
  transform: translateZ(0);
}
.full-player-sheet.full-player-visible {
  transform: translateY(0) !important;
}
#bg-artwork {
  will-change: auto;
  transform: translateZ(0);
  backface-visibility: hidden;
}

/* Reduce animations on mobile for better performance */
@media (max-width: 768px) {
  .transition-all {
    transition: none !important;
  }
  .backdrop-blur-xl, .backdrop-blur-md, .backdrop-blur-sm {
    backdrop-filter: none !important;
  }
}

/* Glass Effect - Performance Optimized */
.glass { 
  background: rgba(17 24 39 / .85); 
  backdrop-filter: blur(8px); 
  border: 1px solid rgba(255 255 255 / .1);
}

/* Card Hover Effects - Reduced for performance */
.card-hover:hover { 
  transform: translateY(-2px); 
  box-shadow: 0 10px 20px rgba(0 0 0 / .2);
}

/* Modern Player Controls */
.control-btn {
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}
.control-btn:hover {
  transform: scale(1.1);
  box-shadow: 0 8px 20px rgba(79 70 229 / .4);
}

/* Custom Range Sliders */
input[type=range] { 
  -webkit-appearance: none; 
  appearance: none; 
  width: 100%; 
  height: 6px; 
  background: linear-gradient(to right, #4f46e5 0%, #4f46e5 var(--progress, 0%), #374151 var(--progress, 0%), #374151 100%);
  border-radius: 3px; 
  outline: none; 
  transition: all 0.3s ease;
}
input[type=range]:hover {
  box-shadow: 0 0 0 4px rgba(79 70 229 / .2);
}
input[type=range]::-webkit-slider-thumb { 
  -webkit-appearance: none; 
  appearance: none; 
  width: 18px; 
  height: 18px; 
  background: linear-gradient(135deg, #4f46e5, #7c3aed);
  border-radius: 50%; 
  cursor: pointer; 
  box-shadow: 0 2px 8px rgba(0 0 0 / .3);
  transition: all 0.3s ease;
}
input[type=range]::-webkit-slider-thumb:hover {
  transform: scale(1.2);
  box-shadow: 0 4px 12px rgba(79 70 229 / .5);
}
input[type=range]::-moz-range-thumb { 
  width: 18px; 
  height: 18px; 
  background: linear-gradient(135deg, #4f46e5, #7c3aed);
  border-radius: 50%; 
  cursor: pointer; 
  border: none; 
  box-shadow: 0 2px 8px rgba(0 0 0 / .3);
}

/* Modern Player Slider Styles */
.slider {
  -webkit-appearance: none;
  appearance: none;
  height: 4px;
  background: rgba(255, 255, 255, 0.2);
  border-radius: 2px;
  outline: none;
  transition: all 0.3s ease;
}

.slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 16px;
  height: 16px;
  background: white;
  border-radius: 50%;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
  transition: all 0.3s ease;
}

.slider::-webkit-slider-thumb:hover {
  transform: scale(1.2);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
}

.slider::-moz-range-thumb {
  width: 16px;
  height: 16px;
  background: white;
  border-radius: 50%;
  cursor: pointer;
  border: none;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

/* Custom Scrollbar for Full Player */
.custom-scrollbar::-webkit-scrollbar {
  width: 6px;
}

.custom-scrollbar::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.1);
  border-radius: 3px;
}

.custom-scrollbar::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.3);
  border-radius: 3px;
}

.custom-scrollbar::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.5);
}

/* Animations */
@keyframes pulse-glow {
  0%, 100% { box-shadow: 0 0 0 0 rgba(79 70 229 / .7); }
  50% { box-shadow: 0 0 0 10px rgba(79 70 229 / 0); }
}
.playing { animation: pulse-glow 2s infinite; }

@keyframes playing-bars {
  0%, 100% { transform: scaleY(0.3); }
  50% { transform: scaleY(1); }
}
.playing-indicator::before,
.playing-indicator::after {
  content: '';
  position: absolute;
  width: 2px;
  height: 12px;
  background: currentColor;
  border-radius: 1px;
  animation: playing-bars 0.6s ease-in-out infinite alternate;
}
.playing-indicator::before {
  left: 3px;
  animation-delay: 0.1s;
}
.playing-indicator::after {
  right: 3px;
  animation-delay: 0.3s;
}

/* Gradient Text */
.gradient-text {
  background: linear-gradient(135deg, #4f46e5, #7c3aed, #ec4899);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* Custom Scrollbar */
::-webkit-scrollbar { width: 8px; }
::-webkit-scrollbar-track { background: #1f2937; border-radius: 4px; }
::-webkit-scrollbar-thumb { background: linear-gradient(135deg, #4f46e5, #7c3aed); border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: linear-gradient(135deg, #3730a3, #6d28d9); }

/* Light Theme Styles */
.light-theme {
  background: linear-gradient(135deg, #f8fafc, #e2e8f0, #cbd5e1);
  color: #1f2937;
}
.light-theme .glass {
  background: rgba(255 255 255 / .8);
  border: 1px solid rgba(0 0 0 / .1);
}
.light-theme .text-gray-100 { color: #1f2937; }
.light-theme .text-gray-300 { color: #4b5563; }
.light-theme .text-gray-400 { color: #6b7280; }
.light-theme .text-gray-500 { color: #9ca3af; }
.light-theme .bg-gray-800\/40 { background-color: rgba(255 255 255 / .6); }
.light-theme .bg-gray-800\/60 { background-color: rgba(255 255 255 / .8); }
.light-theme .border-gray-700 { border-color: rgba(0 0 0 / .1); }
.light-theme .border-gray-700\/50 { border-color: rgba(0 0 0 / .08); }
.light-theme ::-webkit-scrollbar-track { background: #e5e7eb; }

/* Line clamp utilities */
.line-clamp-1 {
  overflow: hidden;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 1;
  line-clamp: 1;
}
.line-clamp-2 {
  overflow: hidden;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  line-clamp: 2;
}

/* Player specific styles */
.mini-player-visible {
  transform: translateY(0) !important;
  opacity: 1 !important;
}

.full-player-visible {
  transform: translateY(0) !important;
}

/* Search Type Button Styles */
.search-type-btn {
  color: #9ca3af;
}
.search-type-btn.active {
  background-color: rgba(79, 70, 229, 0.2);
  color: white;
}
.search-type-btn:hover:not(.active) {
  background-color: rgba(255, 255, 255, 0.05);
  color: #d1d5db;
}

/* Mobile-Specific Optimizations */
@media (max-width: 768px) {
  /* Larger touch targets for mobile */
  .control-btn {
    min-width: 44px;
    min-height: 44px;
    padding: 12px;
  }
  
  /* Mobile search bar */
  .search-input {
    font-size: 16px; /* Prevents zoom on iOS */
    padding: 16px 20px;
  }
  
  /* Mobile friendly mini player */
  .mini-player {
    height: 80px;
    padding: 8px 12px;
  }
  
  /* Mini player responsive adjustments */
  #mini-player .control-btn {
    min-width: 38px;
    min-height: 38px;
    padding: 8px;
  }
  #mini-player #mini-img {
    width: 40px;
    height: 40px;
  }
  #mini-player #mini-name {
    font-size: 14px;
  }
  #mini-player #mini-artist {
    font-size: 11px;
  }
  
  /* Larger progress bars for mobile */
  input[type=range] {
    height: 8px;
  }
  input[type=range]::-webkit-slider-thumb {
    width: 24px;
    height: 24px;
  }
  
  /* Mobile song cards */
  .song-card {
    padding: 16px;
    margin-bottom: 12px;
  }
  
  /* Mobile full player sheet */
  .full-player-sheet {
    border-radius: 20px 20px 0 0;
    padding-top: 16px;
    padding-bottom: 24px;
  }
  
  /* Full player mobile optimizations */
  #now-playing-sheet .w-80.h-80 {
    width: 250px;
    height: 250px;
    margin-top: 10px;
  }
  #now-playing-sheet #np-play {
    padding: 16px;
  }
  #now-playing-sheet #np-play i {
    width: 26px;
    height: 26px;
  }
  #now-playing-sheet #np-prev,
  #now-playing-sheet #np-next {
    padding: 12px;
  }
  #now-playing-sheet #np-prev i,
  #now-playing-sheet #np-next i {
    width: 20px;
    height: 20px;
  }
  #now-playing-sheet #np-shuffle,
  #now-playing-sheet #np-repeat {
    padding: 10px;
  }
  #now-playing-sheet #np-shuffle i,
  #now-playing-sheet #np-repeat i {
    width: 16px;
    height: 16px;
  }
  
  /* Hide hover effects on mobile */
  .card-hover:hover {
    transform: none;
    box-shadow: none;
  }
  
  /* Mobile friendly buttons */
  .mobile-btn {
    min-height: 48px;
    padding: 12px 20px;
    font-size: 16px;
  }
  
  /* Disable text selection on controls */
  .control-btn, .mobile-btn {
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
    -webkit-touch-callout: none;
  }
  
  /* Search type responsive */
  .search-type-btn {
    padding: 0.5rem 0.75rem;
    font-size: 0.75rem;
  }
  .search-type-btn i {
    margin-right: 0;
  }
}

/* Touch optimizations */
@media (hover: none) and (pointer: coarse) {
  .control-btn:hover {
    transform: none;
    box-shadow: none;
  }
  
  .control-btn:active {
    transform: scale(0.95);
    opacity: 0.8;
  }
}

/* glass-morphic extra */
.glass {
  background: rgba(17, 24, 39, 0.7);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
}

.glass-strong {
  background: rgba(17, 24, 39, 0.9);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.glass-nav {
  background: rgba(17, 24, 39, 0.6);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

/* Enhanced Gradient Text */
.gradient-text-gold {
  background: linear-gradient(135deg, #fbbf24, #d97706);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

/* Card Hover Glow */
.hover-glow {
  transition: all 0.3s ease;
}
.hover-glow:hover {
  box-shadow: 0 0 15px rgba(79, 70, 229, 0.3);
  transform: translateY(-2px);
}

/* subtle zoom on song cards */
.song-card {
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  border: 1px solid transparent;
}
.song-card:hover {
  transform: translateY(-4px);
  background: rgba(255, 255, 255, 0.03);
  border-color: rgba(255, 255, 255, 0.1);
}