/* ============================================
   BIBLIOTECA WEB PREMIUM - EFECTOS AVANZADOS
   Autor: Xavier Aerox
   Versión: 2.0 - Edición Profesional
   ============================================ */

/* === ANIMACIONES DE PARTÍCULAS EN LOGIN === */
@keyframes float {

    0%,
    100% {
        transform: translateY(0px) rotate(0deg);
        opacity: 0.8;
    }

    50% {
        transform: translateY(-20px) rotate(180deg);
        opacity: 0.4;
    }
}

@keyframes pulse-glow {

    0%,
    100% {
        box-shadow: 0 0 20px rgba(79, 70, 229, 0.3);
    }

    50% {
        box-shadow: 0 0 40px rgba(79, 70, 229, 0.6), 0 0 60px rgba(168, 85, 247, 0.4);
    }
}

@keyframes shimmer {
    0% {
        background-position: -200% 0;
    }

    100% {
        background-position: 200% 0;
    }
}

@keyframes gradient-shift {
    0% {
        background-position: 0% 50%;
    }

    50% {
        background-position: 100% 50%;
    }

    100% {
        background-position: 0% 50%;
    }
}

@keyframes slide-up {
    from {
        opacity: 0;
        transform: translateY(30px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes scale-in {
    from {
        opacity: 0;
        transform: scale(0.9);
    }

    to {
        opacity: 1;
        transform: scale(1);
    }
}

@keyframes bounce-in {
    0% {
        opacity: 0;
        transform: scale(0.3);
    }

    50% {
        transform: scale(1.05);
    }

    70% {
        transform: scale(0.9);
    }

    100% {
        opacity: 1;
        transform: scale(1);
    }
}

/* === LOGIN PAGE PREMIUM === */
.login-wrapper {
    position: relative;
    overflow: hidden;
    background: linear-gradient(-45deg, #667eea, #764ba2, #6B8DD6, #8E37D7);
    background-size: 400% 400%;
    animation: gradient-shift 15s ease infinite;
}

/* Partículas flotantes de fondo */
.login-wrapper::before {
    content: '';
    position: absolute;
    width: 100%;
    height: 100%;
    background-image:
        radial-gradient(circle at 20% 80%, rgba(255, 255, 255, 0.1) 0%, transparent 50%),
        radial-gradient(circle at 80% 20%, rgba(255, 255, 255, 0.15) 0%, transparent 50%),
        radial-gradient(circle at 40% 40%, rgba(255, 255, 255, 0.1) 0%, transparent 40%);
    pointer-events: none;
}

.login-wrapper::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.03'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
    pointer-events: none;
    opacity: 0.5;
}

.login-card {
    position: relative;
    z-index: 10;
    backdrop-filter: blur(20px);
    background: rgba(255, 255, 255, 0.95);
    border: 1px solid rgba(255, 255, 255, 0.3);
    animation: scale-in 0.5s ease-out, pulse-glow 3s ease-in-out infinite;
    transition: all 0.3s ease;
}

body.dark-mode .login-card {
    background: rgba(31, 41, 55, 0.95);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.login-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
}

.login-card h1 {
    background: linear-gradient(135deg, var(--primary) 0%, var(--accent) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* === 3D TILT EFFECT MEJORADO === */
.book-card {
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    transform-style: preserve-3d;
    perspective: 1000px;
    position: relative;
    overflow: visible;
}

.book-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, transparent 0%, rgba(255, 255, 255, 0.1) 100%);
    opacity: 0;
    transition: opacity 0.3s;
    pointer-events: none;
    border-radius: inherit;
}

.book-card:hover::before {
    opacity: 1;
}

.book-card:hover {
    z-index: 50;
    box-shadow:
        0 20px 25px -5px rgba(0, 0, 0, 0.15),
        0 10px 10px -5px rgba(0, 0, 0, 0.08),
        0 0 0 1px rgba(79, 70, 229, 0.1);
}

/* === GLASSMORPHISM PREMIUM === */
.glass-panel {
    background: rgba(255, 255, 255, 0.7);
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    border: 1px solid rgba(255, 255, 255, 0.3);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
}

body.dark-mode .glass-panel {
    background: rgba(31, 41, 55, 0.7);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

/* === SIDEBAR PREMIUM === */
.sidebar {
    background: linear-gradient(180deg, #1a1f35 0%, #0d1117 100%);
    box-shadow: 4px 0 20px rgba(0, 0, 0, 0.3);
    position: relative;
    overflow: hidden;
}

.sidebar::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 200px;
    background: linear-gradient(180deg, rgba(99, 102, 241, 0.1) 0%, transparent 100%);
    pointer-events: none;
}

.sidebar-brand {
    position: relative;
    padding: 1rem;
    margin-bottom: 2rem;
}

.sidebar-brand::after {
    content: '';
    position: absolute;
    bottom: -1rem;
    left: 1.5rem;
    right: 1.5rem;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
}

.nav-item {
    position: relative;
    border-radius: 0.75rem;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    overflow: hidden;
}

.nav-item::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 3px;
    background: linear-gradient(180deg, var(--primary) 0%, var(--accent) 100%);
    transform: scaleY(0);
    transition: transform 0.3s;
}

.nav-item:hover::before,
.nav-item.active::before {
    transform: scaleY(1);
}

.nav-item.active {
    background: linear-gradient(90deg, rgba(99, 102, 241, 0.2) 0%, transparent 100%);
}

.nav-item:hover {
    background: rgba(255, 255, 255, 0.08);
    transform: translateX(5px);
}

.nav-item i {
    transition: transform 0.3s, color 0.3s;
}

.nav-item:hover i {
    transform: scale(1.2);
    color: var(--primary-light);
}

/* === BOTONES PREMIUM === */
.btn {
    position: relative;
    overflow: hidden;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s;
}

.btn:hover::before {
    left: 100%;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    box-shadow: 0 4px 15px rgba(79, 70, 229, 0.3);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(79, 70, 229, 0.4);
}

.btn-primary:active {
    transform: translateY(0);
}

/* === INPUTS PREMIUM === */
.form-input {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    background: var(--bg-secondary);
}

.form-input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(79, 70, 229, 0.1), 0 1px 2px rgba(0, 0, 0, 0.05);
    background: var(--bg-card);
}

/* === THEME TOGGLE PREMIUM === */
.theme-toggle-btn {
    position: relative;
    overflow: hidden;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.theme-toggle-btn::before {
    content: '';
    position: absolute;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle, var(--primary) 0%, transparent 70%);
    opacity: 0;
    transition: opacity 0.3s;
}

.theme-toggle-btn:hover::before {
    opacity: 0.1;
}

.theme-toggle-btn:hover {
    transform: rotate(20deg) scale(1.1);
}

.theme-toggle-btn i {
    transition: transform 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.theme-toggle-btn:hover i {
    transform: rotate(360deg);
}

/* === BOOK COVER PREMIUM === */
.book-cover-placeholder {
    position: relative;
    overflow: hidden;
}

.book-cover-placeholder::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: linear-gradient(45deg, transparent 30%, rgba(255, 255, 255, 0.1) 50%, transparent 70%);
    animation: shimmer 3s infinite;
}

.book-cover-placeholder i {
    position: relative;
    z-index: 1;
    text-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
}

/* === BADGES PREMIUM === */
.badge {
    position: relative;
    overflow: hidden;
    transition: all 0.3s;
}

.badge::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: shimmer 2s infinite;
}

/* === SCROLLBAR PERSONALIZADA === */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: var(--bg-secondary);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, var(--primary) 0%, var(--primary-dark) 100%);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--primary-light);
}

/* === TOOLTIP PREMIUM === */
[data-tooltip] {
    position: relative;
    cursor: pointer;
}

[data-tooltip]::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%) translateY(-5px);
    padding: 0.5rem 1rem;
    background: rgba(0, 0, 0, 0.9);
    color: white;
    font-size: 0.75rem;
    border-radius: 0.5rem;
    white-space: nowrap;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s;
    z-index: 1000;
}

[data-tooltip]:hover::after {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) translateY(-10px);
}

/* === LOADING SKELETON === */
.skeleton {
    background: linear-gradient(90deg, var(--bg-secondary) 25%, var(--bg-card) 50%, var(--bg-secondary) 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
    border-radius: 0.5rem;
}

/* === ESTADÍSTICAS ANIMADAS === */
.stat-number {
    display: inline-block;
    background: linear-gradient(135deg, var(--primary) 0%, var(--accent) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    font-weight: 800;
}

/* === ANIMACIONES DE ENTRADA === */
.fade-in {
    animation: slide-up 0.5s ease-out forwards;
}

.fade-in-delay-1 {
    animation-delay: 0.1s;
}

.fade-in-delay-2 {
    animation-delay: 0.2s;
}

.fade-in-delay-3 {
    animation-delay: 0.3s;
}

.fade-in-delay-4 {
    animation-delay: 0.4s;
}

/* === HOVER EFFECTS PREMIUM === */
.hover-lift {
    transition: transform 0.3s, box-shadow 0.3s;
}

.hover-lift:hover {
    transform: translateY(-8px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.15);
}

/* === FOCUS VISIBLE ACCESIBILIDAD === */
*:focus-visible {
    outline: 2px solid var(--primary);
    outline-offset: 2px;
}

/* === RECOMENDACIONES HERO PREMIUM === */
.recommendations-hero {
    position: relative;
    overflow: hidden;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 50%, #f093fb 100%);
    background-size: 200% 200%;
    animation: gradient-shift 10s ease infinite;
}

.recommendations-hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url("data:image/svg+xml,%3Csvg width='100' height='100' viewBox='0 0 100 100' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M11 18c3.866 0 7-3.134 7-7s-3.134-7-7-7-7 3.134-7 7 3.134 7 7 7zm48 25c3.866 0 7-3.134 7-7s-3.134-7-7-7-7 3.134-7 7 3.134 7 7 7zm-43-7c1.657 0 3-1.343 3-3s-1.343-3-3-3-3 1.343-3 3 1.343 3 3 3zm63 31c1.657 0 3-1.343 3-3s-1.343-3-3-3-3 1.343-3 3 1.343 3 3 3zM34 90c1.657 0 3-1.343 3-3s-1.343-3-3-3-3 1.343-3 3 1.343 3 3 3zm56-76c1.657 0 3-1.343 3-3s-1.343-3-3-3-3 1.343-3 3 1.343 3 3 3zM12 86c2.21 0 4-1.79 4-4s-1.79-4-4-4-4 1.79-4 4 1.79 4 4 4zm28-65c2.21 0 4-1.79 4-4s-1.79-4-4-4-4 1.79-4 4 1.79 4 4 4zm23-11c2.76 0 5-2.24 5-5s-2.24-5-5-5-5 2.24-5 5 2.24 5 5 5zm-6 60c2.21 0 4-1.79 4-4s-1.79-4-4-4-4 1.79-4 4 1.79 4 4 4zm29 22c2.76 0 5-2.24 5-5s-2.24-5-5-5-5 2.24-5 5 2.24 5 5 5zM32 63c2.76 0 5-2.24 5-5s-2.24-5-5-5-5 2.24-5 5 2.24 5 5 5zm57-13c2.76 0 5-2.24 5-5s-2.24-5-5-5-5 2.24-5 5 2.24 5 5 5zm-9-21c1.105 0 2-.895 2-2s-.895-2-2-2-2 .895-2 2 .895 2 2 2zM60 91c1.105 0 2-.895 2-2s-.895-2-2-2-2 .895-2 2 .895 2 2 2zM35 41c1.105 0 2-.895 2-2s-.895-2-2-2-2 .895-2 2 .895 2 2 2z' fill='%23ffffff' fill-opacity='0.05' fill-rule='evenodd'/%3E%3C/svg%3E");
    pointer-events: none;
}

/* === PANEL CARD PREMIUM === */
.panel-card {
    background: var(--bg-card);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.panel-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
}

/* === ACTIVE READING WIDGET PREMIUM === */
.active-reading-widget {
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.1) 0%, rgba(168, 85, 247, 0.1) 100%);
    border: 1px solid rgba(99, 102, 241, 0.2);
    border-radius: 1rem;
    transition: all 0.3s;
}

.active-reading-widget:hover {
    border-color: rgba(99, 102, 241, 0.4);
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.15) 0%, rgba(168, 85, 247, 0.15) 100%);
}

/* === SUCCESS ANIMATION === */
@keyframes success-check {
    0% {
        transform: scale(0) rotate(-45deg);
    }

    50% {
        transform: scale(1.2) rotate(-45deg);
    }

    100% {
        transform: scale(1) rotate(-45deg);
    }
}

.success-icon {
    animation: success-check 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

/* === PULSE NOTIFICATION === */
@keyframes pulse-notification {

    0%,
    100% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.05);
    }
}

.notification-pulse {
    animation: pulse-notification 2s ease-in-out infinite;
}

/* === RESPONSIVE IMPROVEMENTS === */
@media (max-width: 768px) {
    .login-card {
        margin: 1rem;
        padding: 2rem;
    }

    .sidebar {
        backdrop-filter: blur(20px);
    }

    .book-card:hover {
        transform: none;
    }
}

/* === PRINT STYLES === */
@media print {

    .sidebar,
    .toast-container,
    .btn {
        display: none !important;
    }

    .book-card {
        break-inside: avoid;
        box-shadow: none;
        border: 1px solid #ddd;
    }
}

/* ============================================
   MEJORAS PREMIUM ADICIONALES v2.1
   ============================================ */

/* === PAGE TRANSITION ANIMATIONS === */
@keyframes page-slide-in {
    from {
        opacity: 0;
        transform: translateX(30px);
    }

    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes page-fade-scale {
    from {
        opacity: 0;
        transform: scale(0.95);
    }

    to {
        opacity: 1;
        transform: scale(1);
    }
}

@keyframes content-cascade {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.page-transition-enter {
    animation: page-slide-in 0.4s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

.page-transition-exit {
    animation: page-slide-in 0.3s cubic-bezier(0.4, 0, 0.2, 1) reverse forwards;
}

.main-content {
    animation: page-fade-scale 0.5s ease-out;
}

.main-content>* {
    animation: content-cascade 0.4s ease-out;
    animation-fill-mode: both;
}

.main-content>*:nth-child(1) {
    animation-delay: 0.05s;
}

.main-content>*:nth-child(2) {
    animation-delay: 0.1s;
}

.main-content>*:nth-child(3) {
    animation-delay: 0.15s;
}

.main-content>*:nth-child(4) {
    animation-delay: 0.2s;
}

.main-content>*:nth-child(5) {
    animation-delay: 0.25s;
}

/* === ENHANCED SHINE EFFECT FOR BADGES === */
@keyframes badge-shine {
    0% {
        left: -100%;
    }

    20%,
    100% {
        left: 150%;
    }
}

.badge,
.book-category-badge,
.nav-badge {
    position: relative;
    overflow: hidden;
}

.badge::after,
.book-category-badge::after,
.nav-badge::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 50%;
    height: 100%;
    background: linear-gradient(90deg,
            transparent,
            rgba(255, 255, 255, 0.4),
            transparent);
    animation: badge-shine 3s ease-in-out infinite;
}

.badge:hover::after,
.book-category-badge:hover::after {
    animation: badge-shine 0.6s ease-in-out;
}

/* === SPECIAL NEW BADGE GLOW === */
.nav-badge {
    animation: pulse-notification 2s ease-in-out infinite, badge-shine 4s ease-in-out infinite;
    box-shadow: 0 0 10px rgba(244, 114, 182, 0.5);
}

/* === RIPPLE EFFECT FOR BUTTONS === */
@keyframes ripple {
    0% {
        transform: scale(0);
        opacity: 0.6;
    }

    100% {
        transform: scale(4);
        opacity: 0;
    }
}

.btn-ripple {
    position: relative;
    overflow: hidden;
}

.btn-ripple::after {
    content: '';
    position: absolute;
    width: 100px;
    height: 100px;
    background: rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    transform: scale(0);
    pointer-events: none;
}

.btn-ripple:active::after {
    animation: ripple 0.6s linear;
}

/* === INTERACTIVE SOUND INDICATOR (Visual Feedback) === */
@keyframes sound-wave {

    0%,
    100% {
        transform: scaleY(0.5);
    }

    50% {
        transform: scaleY(1);
    }
}

.sound-indicator {
    display: flex;
    align-items: center;
    gap: 2px;
    height: 20px;
}

.sound-indicator span {
    width: 3px;
    height: 100%;
    background: var(--primary);
    border-radius: 2px;
    animation: sound-wave 0.5s ease-in-out infinite;
}

.sound-indicator span:nth-child(1) {
    animation-delay: 0s;
}

.sound-indicator span:nth-child(2) {
    animation-delay: 0.1s;
}

.sound-indicator span:nth-child(3) {
    animation-delay: 0.2s;
}

.sound-indicator span:nth-child(4) {
    animation-delay: 0.1s;
}

.sound-indicator span:nth-child(5) {
    animation-delay: 0s;
}

/* === CONFETTI CELEBRATION EFFECT === */
@keyframes confetti-fall {
    0% {
        transform: translateY(-100%) rotate(0deg);
        opacity: 1;
    }

    100% {
        transform: translateY(100vh) rotate(720deg);
        opacity: 0;
    }
}

.confetti-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 9999;
    overflow: hidden;
}

.confetti {
    position: absolute;
    width: 10px;
    height: 10px;
    animation: confetti-fall 3s linear forwards;
}

/* === FLOATING PARTICLES BACKGROUND === */
@keyframes float-particle {

    0%,
    100% {
        transform: translateY(0) translateX(0);
    }

    25% {
        transform: translateY(-20px) translateX(10px);
    }

    50% {
        transform: translateY(-10px) translateX(-10px);
    }

    75% {
        transform: translateY(-30px) translateX(5px);
    }
}

.floating-particles {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 0;
    overflow: hidden;
}

.floating-particle {
    position: absolute;
    width: 4px;
    height: 4px;
    background: var(--primary);
    border-radius: 50%;
    opacity: 0.3;
    animation: float-particle 8s ease-in-out infinite;
}

/* === TYPEWRITER EFFECT === */
@keyframes typewriter {
    from {
        width: 0;
    }

    to {
        width: 100%;
    }
}

@keyframes blink-caret {
    50% {
        border-color: transparent;
    }
}

.typewriter-text {
    display: inline-block;
    overflow: hidden;
    white-space: nowrap;
    border-right: 2px solid var(--primary);
    animation:
        typewriter 2s steps(30) forwards,
        blink-caret 0.75s step-end infinite;
}

/* === CARD FLIP EFFECT === */
.card-flip {
    perspective: 1000px;
}

.card-flip-inner {
    position: relative;
    transition: transform 0.6s;
    transform-style: preserve-3d;
}

.card-flip:hover .card-flip-inner {
    transform: rotateY(180deg);
}

.card-flip-front,
.card-flip-back {
    position: absolute;
    width: 100%;
    height: 100%;
    backface-visibility: hidden;
    border-radius: var(--radius-xl);
}

.card-flip-back {
    transform: rotateY(180deg);
    background: var(--gradient-primary);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* === MORPHING BUTTON === */
.btn-morph {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.btn-morph:hover {
    border-radius: 50px;
    padding-left: 2rem;
    padding-right: 2rem;
}

.btn-morph:active {
    transform: scale(0.95);
}

/* === GRADIENT BORDER ANIMATION === */
@keyframes gradient-border {

    0%,
    100% {
        background-position: 0% 50%;
    }

    50% {
        background-position: 100% 50%;
    }
}

.gradient-border {
    position: relative;
    background: var(--bg-card);
    border-radius: var(--radius-xl);
}

.gradient-border::before {
    content: '';
    position: absolute;
    top: -2px;
    left: -2px;
    right: -2px;
    bottom: -2px;
    background: linear-gradient(45deg, var(--primary), var(--accent), var(--success), var(--primary));
    background-size: 400% 400%;
    border-radius: inherit;
    z-index: -1;
    animation: gradient-border 6s ease infinite;
}

/* === NUMBER COUNTER ANIMATION === */
@keyframes count-up {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.count-animate {
    animation: count-up 0.5s ease-out forwards;
}

/* === HOVER GLOW EFFECT === */
.hover-glow {
    transition: box-shadow 0.3s ease;
}

.hover-glow:hover {
    box-shadow:
        0 0 20px rgba(99, 102, 241, 0.4),
        0 0 40px rgba(99, 102, 241, 0.2),
        0 0 60px rgba(99, 102, 241, 0.1);
}

/* === MAGNETIC BUTTON EFFECT (via JS) === */
.btn-magnetic {
    transition: transform 0.2s ease-out;
}

/* === STAGGER ANIMATION FOR LISTS === */
.stagger-list>* {
    opacity: 0;
    animation: slide-up 0.5s ease-out forwards;
}

.stagger-list>*:nth-child(1) {
    animation-delay: 0.05s;
}

.stagger-list>*:nth-child(2) {
    animation-delay: 0.1s;
}

.stagger-list>*:nth-child(3) {
    animation-delay: 0.15s;
}

.stagger-list>*:nth-child(4) {
    animation-delay: 0.2s;
}

.stagger-list>*:nth-child(5) {
    animation-delay: 0.25s;
}

.stagger-list>*:nth-child(6) {
    animation-delay: 0.3s;
}

.stagger-list>*:nth-child(7) {
    animation-delay: 0.35s;
}

.stagger-list>*:nth-child(8) {
    animation-delay: 0.4s;
}

.stagger-list>*:nth-child(9) {
    animation-delay: 0.45s;
}

.stagger-list>*:nth-child(10) {
    animation-delay: 0.5s;
}

/* === BLUR IN ANIMATION === */
@keyframes blur-in {
    from {
        filter: blur(10px);
        opacity: 0;
    }

    to {
        filter: blur(0);
        opacity: 1;
    }
}

.blur-in {
    animation: blur-in 0.6s ease-out forwards;
}

/* === 3D CARD TILT ENHANCED === */
.tilt-3d {
    transform-style: preserve-3d;
    transform: perspective(1000px);
}

.tilt-3d:hover {
    transform: perspective(1000px) rotateX(5deg) rotateY(-5deg);
}

.tilt-3d>* {
    transform: translateZ(20px);
}

/* === ELASTIC BOUNCE === */
@keyframes elastic-bounce {
    0% {
        transform: scale(0);
    }

    50% {
        transform: scale(1.15);
    }

    70% {
        transform: scale(0.9);
    }

    100% {
        transform: scale(1);
    }
}

.elastic-enter {
    animation: elastic-bounce 0.5s cubic-bezier(0.68, -0.55, 0.265, 1.55) forwards;
}

/* === REVEAL ON SCROLL (via Intersection Observer) === */
.reveal-on-scroll {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}

.reveal-on-scroll.revealed {
    opacity: 1;
    transform: translateY(0);
}

/* === NEON GLOW TEXT === */
.neon-text {
    color: var(--primary);
    text-shadow:
        0 0 5px var(--primary),
        0 0 10px var(--primary),
        0 0 20px var(--primary),
        0 0 40px var(--primary);
    animation: neon-flicker 2s infinite alternate;
}

@keyframes neon-flicker {

    0%,
    19%,
    21%,
    23%,
    25%,
    54%,
    56%,
    100% {
        text-shadow:
            0 0 5px var(--primary),
            0 0 10px var(--primary),
            0 0 20px var(--primary);
    }

    20%,
    24%,
    55% {
        text-shadow: none;
    }
}

/* === UNDERLINE ANIMATION === */
.underline-animate {
    position: relative;
    display: inline-block;
}

.underline-animate::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--gradient-primary);
    transition: width 0.3s ease;
}

.underline-animate:hover::after {
    width: 100%;
}

/* === AURORA BACKGROUND === */
@keyframes aurora {

    0%,
    100% {
        background-position: 0% 50%;
    }

    50% {
        background-position: 100% 50%;
    }
}

.aurora-bg {
    background: linear-gradient(-45deg,
            rgba(99, 102, 241, 0.1),
            rgba(168, 85, 247, 0.1),
            rgba(244, 114, 182, 0.1),
            rgba(99, 102, 241, 0.1));
    background-size: 400% 400%;
    animation: aurora 15s ease infinite;
}

/* === REDUCED MOTION ACCESSIBILITY === */
@media (prefers-reduced-motion: reduce) {

    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }

    .floating-particles,
    .confetti-container {
        display: none;
    }
}
/* === SOUND & VISUAL FEEDBACK === */
@keyframes visual-pulse {
    0% { transform: translate(-50%, -50%) scale(0); opacity: 0.5; }
    100% { transform: translate(-50%, -50%) scale(3); opacity: 0; }
}

@keyframes ripple-expand {
    0% { transform: translate(-50%, -50%) scale(0); opacity: 1; }
    100% { transform: translate(-50%, -50%) scale(4); opacity: 0; }
}

/* === CONFETTI ANIMATION === */
.confetti-container { position: fixed; top: 0; left: 0; width: 100%; height: 100%; pointer-events: none; z-index: 99999; overflow: hidden; }
.confetti { position: absolute; width: 10px; height: 10px; top: -10px; opacity: 0.8; animation: fall linear forwards; }
@keyframes fall { to { transform: translateY(100vh) rotate(720deg); } }
