/* =====================================================
   YTDownloader Pro - Advanced Animations & Effects
   Version: 2.0.0 - Ultra Smooth Professional Animations
   ===================================================== */

/* ===== PARTICLE SYSTEM ===== */
.particles {
  position: absolute;
  width: 100%;
  height: 100%;
  overflow: hidden;
  pointer-events: none;
}

.particle {
  position: absolute;
  width: 4px;
  height: 4px;
  background: radial-gradient(circle, var(--brand-primary), transparent);
  border-radius: 50%;
  opacity: 0.3;
  animation: particleFloat 8s linear infinite;
}

@keyframes particleFloat {
  0% {
    transform: translateY(100vh) translateX(0px) scale(0);
    opacity: 0;
  }
  10% {
    opacity: 0.3;
  }
  90% {
    opacity: 0.3;
  }
  100% {
    transform: translateY(-10px) translateX(100px) scale(1);
    opacity: 0;
  }
}

/* ===== LOADING ANIMATIONS ===== */
.loading-screen {
  background: radial-gradient(ellipse at center, var(--bg-secondary) 0%, var(--bg-primary) 100%);
}

.loading-logo {
  animation: logoReveal 2s ease-out;
}

@keyframes logoReveal {
  0% {
    transform: scale(0.5) rotateY(180deg);
    opacity: 0;
  }
  50% {
    transform: scale(1.1) rotateY(90deg);
  }
  100% {
    transform: scale(1) rotateY(0deg);
    opacity: 1;
  }
}

.loading-spinner {
  position: relative;
  overflow: hidden;
}

.loading-spinner::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 0, 0, 0.3), transparent);
  animation: shimmer 2s infinite;
}

/* ===== HERO ANIMATIONS ===== */
.hero-title {
  animation: titleReveal 1.5s ease-out;
}

@keyframes titleReveal {
  0% {
    transform: translateY(50px);
    opacity: 0;
    filter: blur(10px);
  }
  100% {
    transform: translateY(0);
    opacity: 1;
    filter: blur(0px);
  }
}

.hero-subtitle {
  animation: subtitleReveal 1.5s ease-out 0.3s both;
}

@keyframes subtitleReveal {
  0% {
    transform: translateY(30px);
    opacity: 0;
  }
  100% {
    transform: translateY(0);
    opacity: 1;
  }
}

.hero-stats {
  animation: statsReveal 1.5s ease-out 0.6s both;
}

@keyframes statsReveal {
  0% {
    transform: translateY(30px) scale(0.9);
    opacity: 0;
  }
  100% {
    transform: translateY(0) scale(1);
    opacity: 1;
  }
}

.stat-item {
  animation: statItemPop 0.6s ease-out both;
}

.stat-item:nth-child(1) { animation-delay: 0.8s; }
.stat-item:nth-child(2) { animation-delay: 1s; }
.stat-item:nth-child(3) { animation-delay: 1.2s; }

@keyframes statItemPop {
  0% {
    transform: scale(0) rotate(180deg);
    opacity: 0;
  }
  50% {
    transform: scale(1.1) rotate(0deg);
  }
  100% {
    transform: scale(1) rotate(0deg);
    opacity: 1;
  }
}

/* ===== CARD ANIMATIONS ===== */
.download-interface {
  animation: cardSlideIn 1s ease-out 0.9s both;
}

@keyframes cardSlideIn {
  0% {
    transform: translateY(50px) scale(0.95);
    opacity: 0;
    filter: blur(10px);
  }
  100% {
    transform: translateY(0) scale(1);
    opacity: 1;
    filter: blur(0px);
  }
}

.premium-card {
  position: relative;
  overflow: hidden;
}

.premium-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.1), transparent);
  transition: left 0.6s ease;
}

.premium-card:hover::before {
  left: 100%;
}

.premium-card:hover {
  transform: translateY(-4px) scale(1.01);
  box-shadow: var(--shadow-xl), 0 0 30px rgba(255, 0, 0, 0.2);
}

/* ===== BUTTON ANIMATIONS ===== */
.btn-primary, .btn-secondary {
  position: relative;
  overflow: hidden;
  transform: translateZ(0);
}

.btn-primary::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
  background: rgba(255, 255, 255, 0.2);
  border-radius: 50%;
  transform: translate(-50%, -50%);
  transition: width 0.6s ease, height 0.6s ease;
}

.btn-primary:hover::before {
  width: 300px;
  height: 300px;
}

.btn-primary:active {
  transform: translateY(-2px) scale(0.98);
}

/* ===== TAB ANIMATIONS ===== */
.tab-btn {
  position: relative;
  overflow: hidden;
}

.tab-btn::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 50%;
  width: 0;
  height: 3px;
  background: var(--gradient-brand);
  transform: translateX(-50%);
  transition: width 0.3s ease;
}

.tab-btn.active::after {
  width: 80%;
}

.tab-content {
  animation: tabContentSlide 0.5s ease-out;
}

@keyframes tabContentSlide {
  0% {
    transform: translateX(20px);
    opacity: 0;
  }
  100% {
    transform: translateX(0);
    opacity: 1;
  }
}

/* ===== INPUT ANIMATIONS ===== */
.url-input {
  position: relative;
  background: var(--bg-elevated);
  transition: all 0.3s ease;
}

.url-input:focus {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(255, 0, 0, 0.15), 0 0 0 3px rgba(255, 0, 0, 0.1);
}

.input-wrapper {
  position: relative;
}

.input-wrapper::before {
  content: '';
  position: absolute;
  bottom: 0;
  left: 50%;
  width: 0;
  height: 2px;
  background: var(--gradient-brand);
  transform: translateX(-50%);
  transition: width 0.3s ease;
}

.input-wrapper:focus-within::before {
  width: 100%;
}

/* ===== MODAL ANIMATIONS ===== */
.modal {
  animation: modalBackdropFade 0.3s ease-out;
}

.modal.hidden {
  animation: modalBackdropFadeOut 0.3s ease-out;
}

@keyframes modalBackdropFade {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@keyframes modalBackdropFadeOut {
  from {
    opacity: 1;
  }
  to {
    opacity: 0;
  }
}

.modal-content {
  animation: modalSlideUp 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

@keyframes modalSlideUp {
  0% {
    transform: translateY(50px) scale(0.9);
    opacity: 0;
  }
  100% {
    transform: translateY(0) scale(1);
    opacity: 1;
  }
}

/* ===== TOAST ANIMATIONS ===== */
.toast {
  animation: toastSlideIn 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
  transform-origin: right center;
}

.toast.show {
  animation: toastSlideIn 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.toast.removing {
  animation: toastSlideOut 0.3s ease-in forwards;
}

@keyframes toastSlideIn {
  0% {
    transform: translateX(100%) scale(0.8);
    opacity: 0;
  }
  100% {
    transform: translateX(0) scale(1);
    opacity: 1;
  }
}

@keyframes toastSlideOut {
  0% {
    transform: translateX(0) scale(1);
    opacity: 1;
  }
  100% {
    transform: translateX(100%) scale(0.8);
    opacity: 0;
  }
}

/* ===== PROGRESS ANIMATIONS ===== */
.progress-fill {
  position: relative;
  overflow: hidden;
}

.progress-fill::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
  animation: progressShimmer 2s infinite;
}

@keyframes progressShimmer {
  0% {
    left: -100%;
  }
  100% {
    left: 100%;
  }
}

/* ===== FEATURE CARD ANIMATIONS ===== */
.feature-card {
  animation: featureCardReveal 0.6s ease-out both;
}

.feature-card:nth-child(1) { animation-delay: 0.1s; }
.feature-card:nth-child(2) { animation-delay: 0.2s; }
.feature-card:nth-child(3) { animation-delay: 0.3s; }
.feature-card:nth-child(4) { animation-delay: 0.4s; }
.feature-card:nth-child(5) { animation-delay: 0.5s; }
.feature-card:nth-child(6) { animation-delay: 0.6s; }

@keyframes featureCardReveal {
  0% {
    transform: translateY(30px) rotateX(15deg);
    opacity: 0;
  }
  100% {
    transform: translateY(0) rotateX(0deg);
    opacity: 1;
  }
}

.feature-icon {
  transition: all 0.3s ease;
}

.feature-card:hover .feature-icon {
  transform: scale(1.1) rotate(5deg);
  box-shadow: var(--shadow-brand), 0 0 20px rgba(255, 0, 0, 0.3);
}

/* ===== UPLOAD ZONE ANIMATIONS ===== */
.upload-zone {
  transition: all 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.upload-zone.dragover {
  transform: translateY(-4px) scale(1.02);
  box-shadow: var(--shadow-lg), 0 0 30px rgba(255, 0, 0, 0.2);
  border-color: var(--brand-primary);
}

.upload-icon {
  transition: all 0.3s ease;
}

.upload-zone:hover .upload-icon,
.upload-zone.dragover .upload-icon {
  transform: scale(1.1) translateY(-5px);
  color: var(--brand-secondary);
}

/* ===== QUEUE ITEM ANIMATIONS ===== */
.queue-item {
  animation: queueItemSlideIn 0.4s ease-out;
  transition: all 0.3s ease;
}

@keyframes queueItemSlideIn {
  0% {
    transform: translateX(-30px);
    opacity: 0;
  }
  100% {
    transform: translateX(0);
    opacity: 1;
  }
}

.queue-item.status-converting {
  background: rgba(255, 170, 0, 0.1);
  border-left: 3px solid var(--warning);
}

.queue-item.status-completed {
  background: rgba(0, 255, 136, 0.1);
  border-left: 3px solid var(--success);
}

.queue-item.status-error {
  background: rgba(255, 68, 68, 0.1);
  border-left: 3px solid var(--error);
}

/* ===== NAVIGATION ANIMATIONS ===== */
.navbar {
  animation: navSlideDown 0.6s ease-out;
}

@keyframes navSlideDown {
  0% {
    transform: translateY(-100%);
    opacity: 0;
  }
  100% {
    transform: translateY(0);
    opacity: 1;
  }
}

.brand-icon {
  transition: all 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.brand:hover .brand-icon {
  transform: scale(1.2) rotate(360deg);
  filter: drop-shadow(0 0 10px var(--brand-primary));
}

/* ===== SCROLL ANIMATIONS ===== */
@keyframes fadeInUp {
  0% {
    transform: translateY(30px);
    opacity: 0;
  }
  100% {
    transform: translateY(0);
    opacity: 1;
  }
}

@keyframes fadeInDown {
  0% {
    transform: translateY(-30px);
    opacity: 0;
  }
  100% {
    transform: translateY(0);
    opacity: 1;
  }
}

@keyframes fadeInLeft {
  0% {
    transform: translateX(-30px);
    opacity: 0;
  }
  100% {
    transform: translateX(0);
    opacity: 1;
  }
}

@keyframes fadeInRight {
  0% {
    transform: translateX(30px);
    opacity: 0;
  }
  100% {
    transform: translateX(0);
    opacity: 1;
  }
}

@keyframes scaleIn {
  0% {
    transform: scale(0.8);
    opacity: 0;
  }
  100% {
    transform: scale(1);
    opacity: 1;
  }
}

/* ===== MICRO-INTERACTIONS ===== */
.nav-btn, .action-btn, .btn-icon {
  transition: all 0.2s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.nav-btn:hover, .action-btn:hover, .btn-icon:hover {
  transform: translateY(-1px) scale(1.05);
}

.nav-btn:active, .action-btn:active, .btn-icon:active {
  transform: translateY(0) scale(0.98);
}

/* ===== GLASSMORPHISM EFFECTS ===== */
.glass {
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
}

/* ===== THEME TRANSITION ===== */
* {
  transition: background-color 0.3s ease, color 0.3s ease, border-color 0.3s ease;
}

/* ===== RESPONSIVE ANIMATIONS ===== */
@media (prefers-reduced-motion: reduce) {
  * {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

@media (max-width: 768px) {
  .hero-title {
    animation-duration: 1s;
  }
  
  .premium-card:hover {
    transform: translateY(-2px) scale(1.005);
  }
  
  .feature-card:hover .feature-icon {
    transform: scale(1.05) rotate(2deg);
  }
}

/* ===== CUSTOM SCROLLBAR ===== */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: var(--bg-secondary);
  border-radius: 4px;
}

::-webkit-scrollbar-thumb {
  background: var(--glass-border);
  border-radius: 4px;
  transition: background 0.3s ease;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--brand-primary);
}

/* ===== SELECTION ===== */
::selection {
  background: var(--brand-primary);
  color: white;
}

::-moz-selection {
  background: var(--brand-primary);
  color: white;
}
