/**
 * Like system specific styles
 * Unified styles for all like-related elements, avoiding duplicate definitions
 */

/* Like animation base styles */
.like-animation {
    position: absolute;
    pointer-events: none;
    z-index: 1000;
    --rotation: 0deg;
    --random-x: 0px;
    transition: all 0.1s ease-out;
}

/* Like floating animation - Optimized version */
@keyframes likeFloat {
    0% {
        transform: translate(-50%, -50%) scale(0.3) rotate(var(--rotation));
        opacity: 0;
        filter: brightness(1) blur(0px);
    }
    15% {
        transform: translate(-50%, -50%) scale(1.3) rotate(var(--rotation));
        opacity: 1;
        filter: brightness(1.2) blur(0px);
    }
    30% {
        transform: translate(-50%, -50%) scale(1.1) rotate(var(--rotation));
        opacity: 1;
        filter: brightness(1.1) blur(0px);
    }
    100% {
        transform: translate(calc(-50% + var(--random-x, 0px)), calc(-50% - 80px)) scale(1) rotate(var(--rotation));
        opacity: 0;
        filter: brightness(0.8) blur(1px);
    }
}

/* Heart icon style optimization */
.like-animation svg {
    filter: drop-shadow(0 0 3px rgba(0,0,0,0.4));
    transition: filter 0.2s ease-out;
}

/* Heart special effects in different colors */
.like-animation[data-color="red"] svg {
    filter: drop-shadow(0 0 4px rgba(255,0,0,0.6));
}

.like-animation[data-color="pink"] svg {
    filter: drop-shadow(0 0 4px rgba(255,105,180,0.6));
}

.like-animation[data-color="light-pink"] svg {
    filter: drop-shadow(0 0 4px rgba(255,182,193,0.6));
}

/* Like button state styles */
.like-button {
    transition: all 0.2s ease-out;
    position: relative;
    overflow: hidden;
}

.like-button:hover {
    transform: scale(1.05);
}

.like-button:active {
    transform: scale(0.95);
}

.like-button.clicked {
    animation: likeButtonClick 0.3s ease-out;
}

/* Like button click animation */
@keyframes likeButtonClick {
    0% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.2);
        filter: brightness(1.2);
    }
    100% {
        transform: scale(1);
        filter: brightness(1);
    }
}

/* Like count update animation */
.action-count.updating {
    animation: countUpdate 0.4s ease-out;
}

@keyframes countUpdate {
    0% {
        transform: scale(1);
    }
    25% {
        transform: scale(1.15);
    }
    50% {
        transform: scale(1.1);
    }
    75% {
        transform: scale(1.05);
    }
    100% {
        transform: scale(1);
    }
}

/* Continuous like effect */
.like-animation.rapid {
    animation-duration: 0.8s;
}

.like-animation.rapid:nth-child(2) {
    animation-delay: 0.05s;
}

.like-animation.rapid:nth-child(3) {
    animation-delay: 0.1s;
}

.like-animation.rapid:nth-child(4) {
    animation-delay: 0.15s;
}

.like-animation.rapid:nth-child(5) {
    animation-delay: 0.2s;
}

/* Special effect animations */
.like-animation.special {
    animation: likeFloatSpecial 1.3s ease-out forwards;
}

@keyframes likeFloatSpecial {
    0% {
        transform: translate(-50%, -50%) scale(0.2) rotate(var(--rotation));
        opacity: 0;
        filter: brightness(0.5) blur(2px);
    }
    20% {
        transform: translate(-50%, -50%) scale(1.6) rotate(var(--rotation));
        opacity: 1;
        filter: brightness(1.3) blur(0px);
    }
    60% {
        transform: translate(calc(-50% + var(--random-x, 0px)), calc(-50% - 40px)) scale(1.3) rotate(var(--rotation));
        opacity: 1;
        filter: brightness(1.1) blur(0px);
    }
    100% {
        transform: translate(calc(-50% + var(--random-x, 0px)), calc(-50% - 100px)) scale(1) rotate(var(--rotation));
        opacity: 0;
        filter: brightness(0.6) blur(2px);
    }
}

/* Like status indicator */
.like-status-indicator {
    position: absolute;
    top: -5px;
    right: -5px;
    width: 12px;
    height: 12px;
    background: #ff4757;
    border-radius: 50%;
    border: 2px solid white;
    opacity: 0;
    transform: scale(0);
    transition: all 0.3s ease-out;
}

.like-status-indicator.active {
    opacity: 1;
    transform: scale(1);
}

/* Responsive design */
@media (max-width: 480px) {
    .like-animation {
        --random-x: calc(var(--random-x) * 0.7);
    }
    
    .like-animation svg {
        filter: drop-shadow(0 0 2px rgba(0,0,0,0.3));
    }
}

@media (max-width: 768px) {
    .like-animation {
        --random-x: calc(var(--random-x) * 0.85);
    }
}

/* High-resolution screen optimization */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
    .like-animation svg {
        filter: drop-shadow(0 0 2px rgba(0,0,0,0.3));
    }
}

/* Animation performance optimization */
.like-animation {
    will-change: transform, opacity;
    backface-visibility: hidden;
    perspective: 1000px;
}

/* Like system status indication */
.like-system-status {
    position: fixed;
    top: 10px;
    right: 10px;
    background: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 8px 12px;
    border-radius: 20px;
    font-size: 12px;
    z-index: 10000;
    opacity: 0;
    transform: translateY(-20px);
    transition: all 0.3s ease-out;
}

.like-system-status.show {
    opacity: 1;
    transform: translateY(0);
}

.like-system-status.success {
    background: rgba(46, 204, 113, 0.9);
}

.like-system-status.error {
    background: rgba(231, 76, 60, 0.9);
}

/* Like statistics display */
.like-stats {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    color: #666;
}

.like-stats .stat-item {
    display: flex;
    align-items: center;
    gap: 4px;
}

.like-stats .stat-icon {
    width: 16px;
    height: 16px;
    opacity: 0.7;
}

/* Like history record */
.like-history {
    max-height: 200px;
    overflow-y: auto;
    border: 1px solid #eee;
    border-radius: 8px;
    padding: 8px;
    background: #f9f9f9;
}

.like-history-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 4px 0;
    border-bottom: 1px solid #eee;
}

.like-history-item:last-child {
    border-bottom: none;
}

.like-history-item .time {
    font-size: 12px;
    color: #999;
}

.like-history-item .video-title {
    flex: 1;
    font-size: 14px;
}

/* Accessibility support */
@media (prefers-reduced-motion: reduce) {
    .like-animation {
        animation-duration: 0.5s !important;
        transition: none !important;
    }
    
    .like-button {
        transition: none !important;
    }
}

/* Dark mode support */
@media (prefers-color-scheme: dark) {
    .like-animation svg {
        filter: drop-shadow(0 0 4px rgba(255,255,255,0.2));
    }
    
    .like-system-status {
        background: rgba(255, 255, 255, 0.1);
        color: #fff;
    }
}
