/* ============================================
   🎨 PREMIUM ANIMATIONS & INTERACTIONS
   ============================================ */

/* Prevent white flash on page load - CRITICAL */
html {
    background-color: #0a0a0a !important;
}

body {
    background-color: #0a0a0a !important;
    color: #fff !important;
}

/* Smooth Page Transitions - Enhanced (only for content) */
.page-transition {
    animation: smoothFadeIn 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes smoothFadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Link transitions */
a {
    transition: color 0.3s ease, opacity 0.3s ease, transform 0.2s ease;
}

/* 3D Card Hover Effects */
.album-card-item,
.track-card,
.playlist-card,
.blog-card,
.artist-card,
.genre-card,
.modern-track-row {
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    will-change: transform;
}

.album-card-item:hover,
.track-card:hover,
.playlist-card:hover,
.blog-card:hover,
.artist-card:hover,
.genre-card:hover {
    transform: translateY(-8px) scale(1.02);
    box-shadow: 0 20px 40px rgba(29, 185, 84, 0.2),
                0 10px 20px rgba(0, 0, 0, 0.4);
}

/* Smooth row transitions */
.modern-track-row {
    transition: background-color 0.3s ease,
                transform 0.2s ease,
                box-shadow 0.3s ease;
}

.modern-track-row:hover {
    transform: translateX(4px);
}

/* Currently Playing Album - Permanent Green Glow */
.album-card-item.currently-playing {
    transform: translateY(-8px) scale(1.05);
    border: 2px solid rgba(29, 185, 84, 0.8);
    box-shadow: 0 0 0 3px rgba(29, 185, 84, 0.2),
                0 20px 40px rgba(29, 185, 84, 0.4),
                0 10px 20px rgba(0, 0, 0, 0.5);
    animation: playingPulse 2s ease-in-out infinite;
    position: relative;
}

/* Add playing indicator badge */
.album-card-item.currently-playing .album-cover-wrapper::before {
    /* Green pulse dot removed for cleaner professional look */
    display: none;
}

/* Show play button initially when playing */
.album-card-item.currently-playing .album-play-overlay {
    opacity: 1 !important;
    transition: opacity 0.3s ease;
}

/* Hide play button after user interaction (controlled by JS) */
.album-card-item.currently-playing.hide-controls .album-play-overlay {
    opacity: 0 !important;
}

/* Show on hover even when hidden */
.album-card-item.currently-playing:hover .album-play-overlay {
    opacity: 1 !important;
}

@keyframes nowPlayingBadgePulse {
    0%, 100% {
        transform: scale(1);
        opacity: 1;
    }
    50% {
        transform: scale(1.2);
        opacity: 0.8;
    }
}

@keyframes playingPulse {
    0%, 100% {
        box-shadow: 0 0 0 3px rgba(29, 185, 84, 0.2),
                    0 20px 40px rgba(29, 185, 84, 0.4),
                    0 10px 20px rgba(0, 0, 0, 0.5);
    }
    50% {
        box-shadow: 0 0 0 5px rgba(29, 185, 84, 0.3),
                    0 25px 50px rgba(29, 185, 84, 0.6),
                    0 15px 30px rgba(0, 0, 0, 0.6);
    }
}

/* Floating Animation */
@keyframes float {
    0%, 100% {
        transform: translateY(0px);
    }
    50% {
        transform: translateY(-10px);
    }
}

.floating {
    animation: float 3s ease-in-out infinite;
}

/* Pulsing Glow Effect */
@keyframes pulseGlow {
    0%, 100% {
        box-shadow: 0 0 20px rgba(29, 185, 84, 0.3);
    }
    50% {
        box-shadow: 0 0 40px rgba(29, 185, 84, 0.6),
                    0 0 60px rgba(29, 185, 84, 0.4);
    }
}

.pulse-glow {
    animation: pulseGlow 2s ease-in-out infinite;
}

/* Ripple Click Effect */
.ripple {
    position: relative;
    overflow: hidden;
}

.ripple::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.5);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

.ripple:active::after {
    width: 300px;
    height: 300px;
}

/* Scroll Reveal Animations */
.reveal {
    opacity: 0;
    transform: translateY(40px);
    transition: all 0.6s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.reveal.active {
    opacity: 1;
    transform: translateY(0);
}

.reveal-left {
    opacity: 0;
    transform: translateX(-40px);
    transition: all 0.6s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.reveal-left.active {
    opacity: 1;
    transform: translateX(0);
}

.reveal-right {
    opacity: 0;
    transform: translateX(40px);
    transition: all 0.6s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.reveal-right.active {
    opacity: 1;
    transform: translateX(0);
}

/* Staggered Animation */
.stagger-item {
    opacity: 0;
    transform: translateY(30px);
    animation: staggerFadeIn 0.5s ease-out forwards;
}

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

.stagger-item:nth-child(1) { animation-delay: 0.1s; }
.stagger-item:nth-child(2) { animation-delay: 0.2s; }
.stagger-item:nth-child(3) { animation-delay: 0.3s; }
.stagger-item:nth-child(4) { animation-delay: 0.4s; }
.stagger-item:nth-child(5) { animation-delay: 0.5s; }
.stagger-item:nth-child(6) { animation-delay: 0.6s; }

/* Shimmer Loading Effect */
@keyframes shimmer {
    0% {
        background-position: -1000px 0;
    }
    100% {
        background-position: 1000px 0;
    }
}

.shimmer {
    background: linear-gradient(
        90deg,
        rgba(255, 255, 255, 0.05) 0%,
        rgba(255, 255, 255, 0.1) 50%,
        rgba(255, 255, 255, 0.05) 100%
    );
    background-size: 1000px 100%;
    animation: shimmer 2s infinite;
}

/* Smooth Button Transitions */
.btn,
button,
.button {
    position: relative;
    overflow: hidden;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.btn::before,
button::before,
.button::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

.btn:hover::before,
button:hover::before,
.button:hover::before {
    width: 300px;
    height: 300px;
}

/* Gradient Text Animation */
@keyframes gradientShift {
    0% {
        background-position: 0% 50%;
    }
    50% {
        background-position: 100% 50%;
    }
    100% {
        background-position: 0% 50%;
    }
}

.gradient-text {
    background: linear-gradient(
        45deg,
        #1db954,
        #1ed760,
        #1db954,
        #1ed760
    );
    background-size: 300% 300%;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: gradientShift 3s ease infinite;
}

/* Glassmorphism Effect */
.glass {
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
}

/* Neon Glow Effect */
.neon {
    text-shadow:
        0 0 10px rgba(29, 185, 84, 0.8),
        0 0 20px rgba(29, 185, 84, 0.6),
        0 0 30px rgba(29, 185, 84, 0.4),
        0 0 40px rgba(29, 185, 84, 0.2);
}

/* Rotation on Hover */
.rotate-hover {
    transition: transform 0.3s ease;
}

.rotate-hover:hover {
    transform: rotate(5deg) scale(1.05);
}

/* Bounce Effect */
@keyframes bounce {
    0%, 20%, 50%, 80%, 100% {
        transform: translateY(0);
    }
    40% {
        transform: translateY(-20px);
    }
    60% {
        transform: translateY(-10px);
    }
}

.bounce {
    animation: bounce 2s infinite;
}

/* Slide In Animations */
@keyframes slideInLeft {
    from {
        transform: translateX(-100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes slideInRight {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes slideInUp {
    from {
        transform: translateY(100%);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.slide-in-left {
    animation: slideInLeft 0.6s ease-out;
}

.slide-in-right {
    animation: slideInRight 0.6s ease-out;
}

.slide-in-up {
    animation: slideInUp 0.6s ease-out;
}

/* Scale In */
@keyframes scaleIn {
    from {
        transform: scale(0.8);
        opacity: 0;
    }
    to {
        transform: scale(1);
        opacity: 1;
    }
}

.scale-in {
    animation: scaleIn 0.4s ease-out;
}

/* Spin Animation */
@keyframes spin {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

.spin {
    animation: spin 1s linear infinite;
}

/* Heartbeat Effect */
@keyframes heartbeat {
    0%, 100% {
        transform: scale(1);
    }
    10%, 30% {
        transform: scale(1.1);
    }
    20%, 40% {
        transform: scale(1);
    }
}

.heartbeat {
    animation: heartbeat 1.5s ease-in-out infinite;
}

/* Smooth Scrollbar */
::-webkit-scrollbar {
    width: 12px;
    height: 12px;
}

::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 10px;
}

::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, #1db954, #1ed760);
    border-radius: 10px;
    border: 2px solid transparent;
    background-clip: padding-box;
}

::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(180deg, #1ed760, #1db954);
    background-clip: padding-box;
}

/* Smooth Selection */
::selection {
    background: rgba(29, 185, 84, 0.3);
    color: #fff;
}

::-moz-selection {
    background: rgba(29, 185, 84, 0.3);
    color: #fff;
}

/* Loader Animation */
@keyframes rotate {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

.loader {
    width: 48px;
    height: 48px;
    border: 4px solid rgba(29, 185, 84, 0.2);
    border-top-color: #1db954;
    border-radius: 50%;
    animation: rotate 1s linear infinite;
}

/* Fade Animations */
.fade-in {
    animation: fadeIn 0.5s ease-out;
}

@keyframes fadeOut {
    from {
        opacity: 1;
    }
    to {
        opacity: 0;
    }
}

.fade-out {
    animation: fadeOut 0.5s ease-out;
}

/* Utility Classes */
.transition-all {
    transition: all 0.3s ease;
}

.transition-fast {
    transition: all 0.15s ease;
}

.transition-slow {
    transition: all 0.6s ease;
}

.hover-scale:hover {
    transform: scale(1.05);
}

.hover-brightness:hover {
    filter: brightness(1.2);
}

.hover-shadow:hover {
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

/* Now Playing Pulse Animation */
@keyframes nowPlayingPulse {
    0%, 100% {
        opacity: 1;
        transform: scale(1);
    }
    50% {
        opacity: 0.5;
        transform: scale(0.8);
    }
}

/* Slide In Left Animation */
@keyframes slideInLeft {
    from {
        opacity: 0;
        transform: translateX(-100px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* Now Playing Track Card Styles */
.now-playing-track-card {
    position: relative;
    animation: slideInLeft 0.5s ease;
}

.now-playing-track-card::before {
    content: '';
    position: absolute;
    inset: -2px;
    border-radius: 12px;
    background: linear-gradient(135deg, #1db954, #1ed760, #1db954);
    background-size: 200% 200%;
    animation: gradientShift 3s ease infinite;
    z-index: -1;
}

@keyframes gradientShift {
    0%, 100% {
        background-position: 0% 50%;
    }
    50% {
        background-position: 100% 50%;
    }
}

/* ============================================
   🎭 SKELETON LOADING FOR PJAX TRANSITIONS
   ============================================ */

/* Skeleton container for track lists */
.skeleton-track-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 20px;
}

/* Skeleton track row */
.skeleton-track-row {
    display: grid;
    grid-template-columns: 40px 1fr auto auto auto auto;
    gap: 16px;
    align-items: center;
    padding: 12px 16px;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 8px;
    height: 64px;
}

/* Skeleton elements */
.skeleton-box {
    background: linear-gradient(
        90deg,
        rgba(255, 255, 255, 0.05) 0%,
        rgba(255, 255, 255, 0.1) 50%,
        rgba(255, 255, 255, 0.05) 100%
    );
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
    border-radius: 4px;
}

/* Number column skeleton */
.skeleton-number {
    width: 24px;
    height: 20px;
}

/* Title column skeleton (with thumbnail) */
.skeleton-title {
    display: flex;
    gap: 12px;
    align-items: center;
}

.skeleton-thumb {
    width: 40px;
    height: 40px;
    border-radius: 4px;
    flex-shrink: 0;
}

.skeleton-title-info {
    display: flex;
    flex-direction: column;
    gap: 6px;
    flex: 1;
}

.skeleton-title-text {
    height: 16px;
    width: 200px;
    max-width: 100%;
}

.skeleton-artist-text {
    height: 14px;
    width: 140px;
    max-width: 100%;
}

/* Other column skeletons */
.skeleton-album,
.skeleton-likes,
.skeleton-plays,
.skeleton-duration {
    height: 16px;
    width: 80px;
}

/* Skeleton for action icons */
.skeleton-actions {
    display: flex;
    gap: 8px;
}

.skeleton-icon {
    width: 32px;
    height: 32px;
    border-radius: 50%;
}

/* Responsive skeleton layout */
@media (max-width: 1024px) {
    .skeleton-track-row {
        grid-template-columns: 40px 1fr auto auto auto;
    }
}

@media (max-width: 768px) {
    .skeleton-track-row {
        grid-template-columns: 40px 1fr auto;
        padding: 8px 12px;
        height: 56px;
    }

    .skeleton-title-text {
        width: 150px;
    }

    .skeleton-artist-text {
        width: 100px;
    }
}

/* Fade transition for skeleton to content */
.skeleton-fade-out {
    animation: fadeOut 0.3s ease-out forwards;
}

.content-fade-in {
    animation: fadeIn 0.3s ease-in forwards;
}
