/**
 * Favorites System CSS
 * Styles for favorites modal and buttons
 */

/* Favorite Button Styles */
.favorite-btn {
    transition: all 0.3s ease;
}

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

.favorite-btn.btn-danger {
    animation: heartPulse 0.3s ease;
}

@keyframes heartPulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.2); }
    100% { transform: scale(1); }
}

/* Favorite Modal Overlay */
.favorite-modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1060;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.favorite-modal-overlay.active {
    display: flex;
}

/* Modal Content */
.favorite-modal-content {
    background: white;
    border-radius: 16px;
    width: 100%;
    max-width: 400px;
    max-height: 80vh;
    overflow: hidden;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    animation: modalSlideIn 0.3s ease;
}

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

/* Modal Header */
.favorite-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    border-bottom: 1px solid #eee;
}

.favorite-modal-header h4 {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
    color: #333;
}

.favorite-modal-close {
    width: 32px;
    height: 32px;
    border: none;
    background: #f5f5f5;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #666;
    transition: all 0.2s;
}

.favorite-modal-close:hover {
    background: #e0e0e0;
    color: #333;
}

/* Modal Body */
.favorite-modal-body {
    padding: 15px;
    max-height: 300px;
    overflow-y: auto;
}

.favorite-modal-body::-webkit-scrollbar {
    width: 6px;
}

.favorite-modal-body::-webkit-scrollbar-track {
    background: #f1f1f1;
}

.favorite-modal-body::-webkit-scrollbar-thumb {
    background: #ccc;
    border-radius: 3px;
}

/* Lists Container */
.favorite-lists {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

/* List Item Button */
.favorite-list-item {
    display: flex;
    align-items: center;
    width: 100%;
    padding: 12px 15px;
    border: 1px solid #eee;
    border-radius: 10px;
    background: white;
    cursor: pointer;
    transition: all 0.2s;
    text-align: left;
}

.favorite-list-item:hover {
    background: #f8f9fa;
    border-color: var(--primary-color, #007bff);
}

.favorite-list-info {
    flex: 1;
    min-width: 0;
}

.favorite-list-name {
    display: block;
    font-weight: 500;
    color: #333;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.favorite-list-count {
    display: block;
    font-size: 12px;
    color: #888;
    margin-top: 2px;
}

.favorite-list-default {
    font-size: 11px;
    background: var(--primary-color, #007bff);
    color: white;
    padding: 2px 8px;
    border-radius: 4px;
    margin-right: 10px;
}

.favorite-list-item i.fa-chevron-right {
    color: #ccc;
    font-size: 12px;
}

/* Modal Footer */
.favorite-modal-footer {
    padding: 15px 20px;
    border-top: 1px solid #eee;
    background: #f8f9fa;
}

.btn-favorite-new {
    width: 100%;
    padding: 12px;
    border: 2px dashed #ddd;
    border-radius: 10px;
    background: white;
    color: #666;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.2s;
}

.btn-favorite-new:hover {
    border-color: var(--primary-color, #007bff);
    color: var(--primary-color, #007bff);
    background: #f0f7ff;
}

/* Create Form Styles */
#create-list-form .form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: #333;
}

#create-list-form .form-control {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 14px;
}

#create-list-form .form-control:focus {
    outline: none;
    border-color: var(--primary-color, #007bff);
    box-shadow: 0 0 0 3px rgba(0, 123, 255, 0.1);
}

/* Product Card Favorite Button */
.product-card .favorite-quick-btn {
    position: absolute;
    top: 10px;
    right: 10px;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: white;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #dc3545;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    opacity: 0;
    transition: all 0.3s ease;
    z-index: 5;
}

.product-card:hover .favorite-quick-btn {
    opacity: 1;
}

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

.product-card .favorite-quick-btn.active {
    background: #dc3545;
    color: white;
}

/* Wishlist Badge in Header */
.wishlist-btn {
    position: relative;
}

.wishlist-count {
    position: absolute;
    top: -8px;
    right: -8px;
    min-width: 20px;
    height: 20px;
    background: #dc3545;
    color: white;
    border-radius: 10px;
    font-size: 11px;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 5px;
}

.wishlist-count:empty,
.wishlist-count[data-count="0"] {
    display: none;
}

/* Mobile Adjustments */
@media (max-width: 576px) {
    .favorite-modal-content {
        max-width: 100%;
        border-radius: 16px 16px 0 0;
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        animation: modalSlideUp 0.3s ease;
    }
    
    @keyframes modalSlideUp {
        from {
            transform: translateY(100%);
        }
        to {
            transform: translateY(0);
        }
    }
    
    .favorite-modal-overlay {
        align-items: flex-end;
        padding: 0;
    }
    
    .product-card .favorite-quick-btn {
        opacity: 1;
    }
}
