/* Post Likes System - Estilos */

/* Contenedor principal del botón de like */
.post-likes-container {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    background: #fff;
    border-radius: 50px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
}

.post-likes-container:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    transform: translateY(-2px);
}

/* Botón de like */
.post-like-button {
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    position: relative;
}

.post-like-button:hover {
    transform: scale(1.1);
}

.post-like-button:active {
    transform: scale(0.95);
}

/* Ícono del corazón */
.heart-icon {
    width: 28px;
    height: 28px;
    fill: #d1d5db;
    stroke: #9ca3af;
    stroke-width: 1.5;
    transition: all 0.3s ease;
}

.post-like-button:hover .heart-icon {
    fill: #fecaca;
    stroke: #f87171;
}

/* Estado cuando ya se dio like */
.post-like-button.liked .heart-icon {
    fill: #e91e63;
    stroke: #e91e63;
    animation: heartBeat 0.5s ease;
}

/* Animación de latido del corazón */
@keyframes heartBeat {
    0%, 100% {
        transform: scale(1);
    }
    25% {
        transform: scale(1.3);
    }
    50% {
        transform: scale(1.1);
    }
    75% {
        transform: scale(1.25);
    }
}

/* Animación cuando se da like */
.post-like-button.liking .heart-icon {
    animation: heartPop 0.6s ease;
}

@keyframes heartPop {
    0% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.4) rotate(-10deg);
    }
    100% {
        transform: scale(1) rotate(0deg);
    }
}

/* Contador de likes */
.post-likes-count {
    font-size: 16px;
    font-weight: 600;
    color: #374151;
    min-width: 20px;
    text-align: center;
    transition: all 0.3s ease;
}

.post-likes-container.updating .post-likes-count {
    animation: countUpdate 0.4s ease;
}

@keyframes countUpdate {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.2);
        color: #e91e63;
    }
}

/* Estado de carga */
.post-like-button.loading {
    pointer-events: none;
    opacity: 0.6;
}

.post-like-button.loading .heart-icon {
    animation: pulse 1s ease infinite;
}

@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.5;
    }
}

/* ===== ESTILOS PARA EL RANKING ===== */

.post-likes-ranking {
    max-width: 800px;
    margin: 30px auto;
    padding: 20px;
}

.likes-ranking-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.ranking-item {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px 20px;
    margin-bottom: 12px;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.ranking-item::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 4px;
    background: linear-gradient(180deg, #e91e63, #f06292);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.ranking-item:hover {
    transform: translateX(8px);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
}

.ranking-item:hover::before {
    opacity: 1;
}

/* Números de ranking especiales para top 3 */
.rank-number {
    font-size: 24px;
    font-weight: 700;
    min-width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: #f3f4f6;
    color: #6b7280;
}

.rank-1 .rank-number {
    background: linear-gradient(135deg, #ffd700, #ffed4e);
    color: #92400e;
    font-size: 28px;
    box-shadow: 0 4px 12px rgba(255, 215, 0, 0.3);
}

.rank-2 .rank-number {
    background: linear-gradient(135deg, #c0c0c0, #e5e5e5);
    color: #374151;
    font-size: 26px;
    box-shadow: 0 4px 12px rgba(192, 192, 192, 0.3);
}

.rank-3 .rank-number {
    background: linear-gradient(135deg, #cd7f32, #e39755);
    color: #ffffff;
    font-size: 26px;
    box-shadow: 0 4px 12px rgba(205, 127, 50, 0.3);
}

/* Contenido del ranking */
.ranking-content {
    flex: 1;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
}

.ranking-title {
    font-size: 16px;
    font-weight: 600;
    color: #1f2937;
    text-decoration: none;
    transition: color 0.3s ease;
    flex: 1;
}

.ranking-title:hover {
    color: #e91e63;
}

.ranking-likes {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 14px;
    background: #fce7f3;
    border-radius: 20px;
    font-size: 14px;
    font-weight: 600;
    color: #e91e63;
    white-space: nowrap;
}

.small-heart {
    width: 16px;
    height: 16px;
    fill: #e91e63;
}

/* Mensaje cuando no hay likes */
.no-likes-message {
    text-align: center;
    padding: 40px 20px;
    color: #6b7280;
    font-size: 16px;
    background: #f9fafb;
    border-radius: 12px;
    border: 2px dashed #d1d5db;
}

/* Responsivo */
@media (max-width: 768px) {
    .post-likes-ranking {
        padding: 10px;
    }
    
    .ranking-item {
        padding: 12px 16px;
        gap: 12px;
    }
    
    .rank-number {
        font-size: 18px;
        min-width: 36px;
        height: 36px;
    }
    
    .rank-1 .rank-number {
        font-size: 22px;
    }
    
    .rank-2 .rank-number,
    .rank-3 .rank-number {
        font-size: 20px;
    }
    
    .ranking-title {
        font-size: 14px;
    }
    
    .ranking-likes {
        font-size: 12px;
        padding: 4px 10px;
    }
    
    .small-heart {
        width: 14px;
        height: 14px;
    }
}

/* Efectos de partículas (opcional) */
.post-like-button.celebrating::after {
    content: '✨';
    position: absolute;
    font-size: 20px;
    animation: celebrate 0.6s ease forwards;
    pointer-events: none;
}

@keyframes celebrate {
    0% {
        opacity: 1;
        transform: translate(0, 0) scale(0);
    }
    50% {
        opacity: 1;
        transform: translate(-10px, -20px) scale(1);
    }
    100% {
        opacity: 0;
        transform: translate(-20px, -40px) scale(0.5);
    }
}

/* Accesibilidad */
.post-like-button:focus {
    outline: 2px solid #e91e63;
    outline-offset: 2px;
    border-radius: 50%;
}

/* Modo oscuro (opcional) */
@media (prefers-color-scheme: dark) {
    .post-likes-container {
        background: #1f2937;
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
    }
    
    .post-likes-count {
        color: #f3f4f6;
    }
    
    .ranking-item {
        background: #1f2937;
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
    }
    
    .ranking-title {
        color: #f3f4f6;
    }
    
    .ranking-title:hover {
        color: #f472b6;
    }
    
    .no-likes-message {
        background: #1f2937;
        color: #9ca3af;
        border-color: #374151;
    }
}
