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

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

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

@keyframes slideDown {
    from { opacity: 0; transform: translateY(-30px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes scaleIn {
    from { opacity: 0; transform: scale(0.9); }
    to { opacity: 1; transform: scale(1); }
}

@keyframes bounce {
    0%, 20%, 53%, 80%, 100% { transform: translateY(0); }
    40% { transform: translateY(-20px); }
    60% { transform: translateY(-10px); }
}

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

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

@keyframes glow {
    0%, 100% { box-shadow: 0 0 20px rgba(168, 85, 247, 0.3); }
    50% { box-shadow: 0 0 40px rgba(168, 85, 247, 0.6); }
}

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

@keyframes ripple {
    0% { transform: scale(0); opacity: 1; }
    100% { transform: scale(4); opacity: 0; }
}

.animate-fade-in { animation: fadeIn 0.5s ease forwards; }
.animate-slide-up { animation: slideUp 0.5s ease forwards; }
.animate-scale-in { animation: scaleIn 0.4s ease forwards; }
.animate-bounce { animation: bounce 1s ease; }
.animate-pulse { animation: pulse 2s ease-in-out infinite; }
.animate-float { animation: float 3s ease-in-out infinite; }
.animate-glow { animation: glow 2s ease-in-out infinite; }
.animate-spin { animation: spin 1s linear infinite; }

.story-card {
    opacity: 0;
    animation: slideUp 0.6s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

.story-card:nth-child(1) { animation-delay: 0.1s; }
.story-card:nth-child(2) { animation-delay: 0.15s; }
.story-card:nth-child(3) { animation-delay: 0.2s; }
.story-card:nth-child(4) { animation-delay: 0.25s; }
.story-card:nth-child(5) { animation-delay: 0.3s; }
.story-card:nth-child(6) { animation-delay: 0.35s; }
.story-card:nth-child(7) { animation-delay: 0.4s; }
.story-card:nth-child(8) { animation-delay: 0.45s; }

.story-card:hover {
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.story-card:hover .story-card-image img {
    transition: transform 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.pill {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.pill:hover {
    transform: translateY(-2px);
}

.nav-action-btn,
.toolbar-btn,
.mode-btn,
.size-btn {
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.nav-action-btn::after,
.toolbar-btn::after,
.mode-btn::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
    transform: translate(-50%, -50%);
    transition: width 0.6s ease, height 0.6s ease;
}

.nav-action-btn:active::after,
.toolbar-btn:active::after,
.mode-btn:active::after {
    width: 200px;
    height: 200px;
}

.modal {
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.modal-box {
    transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.modal.show .modal-box {
    animation: scaleIn 0.4s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

.song-item {
    transition: all 0.3s ease;
}

.song-item:hover {
    transform: translateX(5px);
}

.admin-story-item {
    transition: all 0.3s ease;
}

.admin-story-item:hover {
    transform: translateX(5px);
    background: var(--bg-elevated);
}

.suggestion-card {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.suggestion-card:hover {
    transform: translateY(-5px);
}

.social-btn {
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.social-btn:hover {
    animation: bounce 0.5s ease;
}

.footer-links a {
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.progress-fill {
    transition: width 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.highlight {
    animation: pulse 1s ease-in-out 3;
}

.about-avatar img {
    animation: float 4s ease-in-out infinite;
}

.avatar-ring {
    animation: spin 10s linear infinite;
}

.hero-card-stack {
    transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.hero-card {
    transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes loadingSkeleton {
    0% { background-position: -200% 0; }
    100% { background-position: 200% 0; }
}

.skeleton {
    background: linear-gradient(
        90deg,
        var(--bg-tertiary) 25%,
        var(--bg-elevated) 50%,
        var(--bg-tertiary) 75%
    );
    background-size: 200% 100%;
    animation: loadingSkeleton 1.5s ease-in-out infinite;
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
    
    .ambient-orb {
        display: none;
    }
    
    .splash-ring {
        animation: none;
    }
    
    .avatar-ring {
        animation: none;
    }
}

.series-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.5rem;
}

.series-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    overflow: hidden;
    transition: all 0.3s ease;
}

.series-card:hover {
    transform: translateY(-5px);
    border-color: var(--accent-primary);
    box-shadow: var(--shadow-lg);
}

.series-cover {
    position: relative;
    height: 180px;
    overflow: hidden;
}

.series-cover img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.series-badge {
    position: absolute;
    top: 12px;
    right: 12px;
    padding: 6px 12px;
    background: var(--gradient-primary);
    border-radius: var(--radius-full);
    font-size: 0.8rem;
    font-weight: 600;
    color: white;
}

.series-info {
    padding: 1.25rem;
}

.series-info h3 {
    font-size: 1.25rem;
    margin-bottom: 1rem;
}

.series-parts {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.part-btn {
    padding: 8px 16px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-full);
    color: var(--text-secondary);
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.part-btn:hover {
    background: var(--gradient-primary);
    border-color: transparent;
    color: white;
}

.analytics-item {
    padding: 12px 16px;
    background: var(--bg-tertiary);
    border-radius: var(--radius-md);
    margin-bottom: 8px;
    font-size: 0.95rem;
}

*[class*="animate"],
.story-card,
.control-btn,
.navbar,
.hero {
    will-change: transform;
    transform-style: preserve-3d;
    backface-visibility: hidden;
    -webkit-font-smoothing: antialiased;
}

.story-grid,
.navbar,
.hero,
.site-footer,
.modal-box {
    transform: translateZ(0);
    will-change: transform, opacity;
}

@media (hover: none) and (pointer: coarse) {
    .story-card:active {
        transform: scale(0.98);
        transition: transform 0.1s ease;
    }
    
    .control-btn:active,
    .pill:active {
        transform: scale(0.95);
    }
}

.reveal {
    opacity: 0;
    transform: translateY(30px);
    transition: all 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

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

.reveal-fade-up {
    opacity: 0;
    transform: translateY(50px);
    transition: all 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

.reveal-fade-up.revealed {
    opacity: 1;
    transform: translateY(0);
}

.reveal-scale {
    opacity: 0;
    transform: scale(0.8);
    transition: all 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.reveal-scale.revealed {
    opacity: 1;
    transform: scale(1);
}

.swipe-indicator {
    position: fixed;
    top: 50%;
    transform: translateY(-50%);
    width: 50px;
    height: 100px;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
    z-index: 1000;
}

.swipe-indicator.left {
    left: 10px;
}

.swipe-indicator.right {
    right: 10px;
}

.swipe-indicator.visible {
    opacity: 1;
}

.swipe-indicator i {
    font-size: 24px;
    color: var(--accent-primary);
    animation: swipe-bounce 1s ease-in-out infinite;
}

@keyframes swipe-bounce-left {
    0%, 100% { transform: translateX(0); }
    50% { transform: translateX(-10px); }
}

@keyframes swipe-bounce-right {
    0%, 100% { transform: translateX(0); }
    50% { transform: translateX(10px); }
}

.glass-effect {
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 
        0 8px 32px rgba(0, 0, 0, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

.neon-glow {
    text-shadow: 
        0 0 5px var(--accent-primary),
        0 0 10px var(--accent-primary),
        0 0 20px var(--accent-primary);
}

.neon-border {
    box-shadow: 
        0 0 5px var(--accent-primary),
        0 0 10px var(--accent-primary),
        inset 0 0 5px rgba(168, 85, 247, 0.3);
}

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

@keyframes floating {
    0%, 100% { transform: translateY(0px); }
    50% { transform: translateY(-15px); }
}

.shimmer {
    background: linear-gradient(
        90deg,
        rgba(255, 255, 255, 0) 0%,
        rgba(255, 255, 255, 0.1) 50%,
        rgba(255, 255, 255, 0) 100%
    );
    background-size: 200% 100%;
    animation: shimmer-effect 1.5s infinite;
}

@keyframes shimmer-effect {
    0% { background-position: -200% 0; }
    100% { background-position: 200% 0; }
}
