/* Favorite Button Styles */
.favorite-btn {
    background-color: rgba(200, 200, 200, 0.2);
    border: none;
    cursor: pointer;
    padding: 8px;
    border-radius: 50%;
    transition: all 0.3s ease;
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 40px;
    min-height: 40px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
    backdrop-filter: blur(5px);
    z-index: 10;
}

/* Position variants for Elementor */
.favorite-btn-overlay {
    position: absolute;
    top: 10px;
    right: 10px;
}

.favorite-btn-corner {
    position: absolute;
    top: 15px;
    right: 15px;
}

.carousel-container .favorite-btn-corner {
    top: 8px;
    right: 22px;
}

@media screen and (max-width: 768px) {
    .carousel-container .favorite-btn-corner {
        top: 8px;
        right: 40px;
    }
}

.favorite-btn-title {
    float: right;
    margin-left: 10px;
    position: relative;
    top: -5px;
}

.favorite-btn:hover {
    transform: scale(1.1);
}

.favorite-btn:active {
    transform: scale(0.95);
}

.favorite-btn.processing {
    cursor: not-allowed;
    opacity: 0.6;
}

.favorite-btn.processing:hover {
    transform: none;
}

.favorite-btn.processing .heart-icon {
    color: #e91e63;
}

/* Heart Icon */
.heart-icon {
    font-size: 20px;
    color: #e91e63;
    transition: all 0.2s ease;
    line-height: 0;
    pointer-events: none;
}

.favorite-btn:not(.favorited) .heart-icon {
    color: #ccc;
}

.favorite-btn.favorited .heart-icon {
    animation: heartPulse 0.6s ease-in-out;
}

/* Heart pulse animation */
@keyframes heartPulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.3); }
    100% { transform: scale(1); }
}

/* Favorites count */
.favorites-count {
    font-size: 12px;
    color: #666;
    margin-left: 4px;
    font-weight: bold;
}

.favorite-btn.favorited .favorites-count {
    color: #e91e63;
}

/* Login required state */
.favorite-btn.login-required {
    opacity: 0.5;
}

.favorite-btn.login-required:hover {
    opacity: 0.7;
}

/* Notifications */
.favorite-notification {
    background: #333;
    color: white;
    padding: 12px 16px;
    border-radius: 4px;
    font-size: 14px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.2);
    max-width: 300px;
}

.favorite-notification-success {
    background: #4caf50;
}

.favorite-notification-error {
    background: #f44336;
}

.favorite-notification-info {
    background: #2196f3;
}

/* Favorites List Styles */
.favorites-list {
    display: grid;
    gap: 20px;
    margin: 20px 0;
}

.favorite-item {
    border: 1px solid #ddd;
    padding: 15px;
    border-radius: 8px;
    background: #f9f9f9;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
}

.favorite-item h3 {
    margin: 0 0 10px 0;
    flex-grow: 1;
}

.favorite-item h3 a {
    color: #333;
    text-decoration: none;
}

.favorite-item h3 a:hover {
    color: #e91e63;
}

.favorite-item .favorite-btn {
    margin-left: 15px;
    flex-shrink: 0;
}

/* Post listing integration */
.post-item {
    position: relative;
}

.post-item .favorite-btn {
    position: absolute;
    top: 10px;
    right: 10px;
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(5px);
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

/* Responsive design */
@media (max-width: 768px) {
    .favorite-btn {
        min-width: 35px;
        min-height: 35px;
        padding: 6px;
    }

    .heart-icon {
        font-size: 18px;
    }

    .favorite-notification {
        right: 10px;
        top: 10px;
        left: 10px;
        max-width: none;
    }

    .favorite-item {
        flex-direction: column;
        gap: 10px;
    }

    .favorite-item .favorite-btn {
        margin-left: 0;
        align-self: flex-end;
    }
}

/* Dark mode support */
@media (prefers-color-scheme: dark) {
    .favorite-btn:hover {
        background-color: rgba(255, 182, 193, 0.1);
    }

    .favorite-btn:not(.favorited) .heart-icon {
        color: #fff;
    }

    .favorite-item {
        background: #2a2a2a;
        border-color: #444;
    }

    .favorite-item h3 a {
        color: #fff;
    }
}

/* Animation for adding/removing from lists */
.favorite-item-removing {
    animation: fadeOut 0.3s ease-out forwards;
}

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