/* Animations fluides et interactives pour Shegger Beatz */

/* Variables d'animation */
:root {
    --animation-duration: 0.4s;
    --animation-timing: cubic-bezier(0.4, 0, 0.2, 1);
    --hover-scale: 1.02;
}

/* Animation de chargement de page */
body {
    opacity: 0;
    animation: fadeIn 0.5s ease-out forwards;
}

body.loaded {
    opacity: 1;
}

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

/* Animations au scroll */
.fade-in,
.slide-up,
.slide-left,
.slide-right,
.zoom-in {
    opacity: 0;
    transition: all var(--animation-duration) var(--animation-timing);
}

.fade-in.animate-in {
    opacity: 1;
}

.slide-up {
    transform: translateY(20px);
}

.slide-up.animate-in {
    opacity: 1;
    transform: translateY(0);
}

.slide-left {
    transform: translateX(-20px);
}

.slide-left.animate-in {
    opacity: 1;
    transform: translateX(0);
}

.slide-right {
    transform: translateX(20px);
}

.slide-right.animate-in {
    opacity: 1;
    transform: translateX(0);
}

.zoom-in {
    transform: scale(0.97);
}

.zoom-in.animate-in {
    opacity: 1;
    transform: scale(1);
}

/* Animation séquentielle */
.stagger-animation {
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.5s var(--animation-timing);
}

.stagger-animation.animate-in {
    opacity: 1;
    transform: translateY(0);
}

/* Effet ripple pour les boutons */
.ripple {
    position: absolute;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.6);
    transform: scale(0);
    animation: ripple-animation 0.6s ease-out;
    pointer-events: none;
}

@keyframes ripple-animation {
    to {
        transform: scale(4);
        opacity: 0;
    }
}

/* Animations hover pour les cartes */
.beat-card,
.service-card,
.collab-card,
.card-3d {
    transition: all 0.3s var(--animation-timing);
}

.beat-card:hover,
.service-card:hover,
.collab-card:hover,
.card-3d:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.3);
}

/* Animation des images */
img {
    transition: all 0.5s ease-out;
}

img:hover {
    transform: scale(1.05);
}

/* Barre de progression de lecture */
.reading-progress {
    position: fixed;
    top: 0;
    left: 0;
    height: 3px;
    background: linear-gradient(90deg, #FF6B35, #FF8C61);
    z-index: 9999;
    transition: width 0.1s ease-out;
    box-shadow: 0 2px 10px rgba(255, 107, 53, 0.5);
}

/* Tooltips personnalisés */
.custom-tooltip {
    position: fixed;
    background: rgba(0, 0, 0, 0.9);
    color: white;
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 14px;
    pointer-events: none;
    z-index: 10000;
    opacity: 0;
    transform: translateY(5px);
    transition: all 0.3s var(--animation-timing);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.custom-tooltip.show {
    opacity: 1;
    transform: translateY(0);
}

/* Animation des boutons */
button,
.btn-primary,
.btn-secondary,
a[class*="btn"] {
    position: relative;
    overflow: hidden;
    transition: all 0.3s var(--animation-timing);
}

button:hover,
.btn-primary:hover,
.btn-secondary:hover,
a[class*="btn"]:hover {
    transform: translateY(-1px);
    box-shadow: 0 5px 15px rgba(255, 107, 53, 0.3);
}

button:active,
.btn-primary:active,
.btn-secondary:active,
a[class*="btn"]:active {
    transform: translateY(0);
}

/* Animation du header */
nav {
    transition: all 0.3s ease-in-out !important;
}

/* Animation des liens de navigation */
.nav-link {
    position: relative;
    transition: all 0.3s ease;
}

.nav-link::before {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 50%;
    width: 0;
    height: 2px;
    background: #FF6B35;
    transition: all 0.3s var(--animation-timing);
    transform: translateX(-50%);
}

.nav-link:hover::before {
    width: 100%;
}

/* Animation des icônes */
i {
    transition: all 0.3s var(--animation-timing);
}

button:hover i,
.btn-primary:hover i,
a:hover i {
    transform: scale(1.2);
}

/* Animation de rotation pour les icônes play */
.play-btn:hover i,
.play-collab-btn:hover i {
    transform: rotate(360deg) scale(1.2);
    transition: transform 0.6s var(--animation-timing);
}

/* Animation des barres de progression audio */
.progress-bar {
    transition: width 0.1s linear;
}

.progress-container:hover .progress-bar {
    box-shadow: 0 0 10px rgba(255, 107, 53, 0.6);
}

/* Animation des formulaires */
input,
textarea,
select {
    transition: all 0.3s var(--animation-timing);
}

input:focus,
textarea:focus,
select:focus {
    transform: scale(1.02);
    box-shadow: 0 0 20px rgba(255, 107, 53, 0.3);
}

/* Animation de pulsation pour les éléments importants */
@keyframes pulse {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.05);
    }
}

.pulse-animation {
    animation: pulse 2s infinite;
}

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

.bounce-animation {
    animation: bounce 1s infinite;
}

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

.rotate-animation {
    animation: rotate 2s linear infinite;
}

/* Animation de glissement */
@keyframes slideIn {
    from {
        transform: translateX(-100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

.slide-in-animation {
    animation: slideIn 0.5s var(--animation-timing);
}

/* Animation de fondu */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.fade-in-up {
    animation: fadeInUp 0.6s var(--animation-timing);
}

/* Animation de zoom */
@keyframes zoomIn {
    from {
        opacity: 0;
        transform: scale(0.8);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.zoom-in-animation {
    animation: zoomIn 0.5s var(--animation-timing);
}

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

.gradient-animation {
    background-size: 200% 200%;
    animation: gradientShift 3s ease infinite;
}

/* Animation de brillance */
@keyframes shine {
    0% {
        background-position: -200% center;
    }
    100% {
        background-position: 200% center;
    }
}

.shine-effect {
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    background-size: 200% 100%;
    animation: shine 2s infinite;
}

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

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

/* Animation de balancement */
@keyframes swing {
    0%, 100% {
        transform: rotate(0deg);
    }
    25% {
        transform: rotate(5deg);
    }
    75% {
        transform: rotate(-5deg);
    }
}

.swing-animation {
    animation: swing 2s ease-in-out infinite;
}

/* Effet de lueur au hover */
.glow-on-hover {
    transition: all 0.3s ease;
}

.glow-on-hover:hover {
    box-shadow: 0 0 30px rgba(255, 107, 53, 0.6),
                0 0 60px rgba(255, 107, 53, 0.4),
                0 0 90px rgba(255, 107, 53, 0.2);
}

/* Animation de typing pour les titres */
@keyframes typing {
    from {
        width: 0;
    }
    to {
        width: 100%;
    }
}

.typing-animation {
    overflow: hidden;
    white-space: nowrap;
    animation: typing 3s steps(40, end);
}

/* Smooth scroll */
html {
    scroll-behavior: smooth;
}

/* Performance optimizations */
* {
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Réduction de mouvement pour l'accessibilité */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}
