/* favorites.css - Estilos para Sistema de Favoritos */
/* Compatible con todas las localidades - v1.0 */

/* Botón flotante de favoritos */
.favorites-btn {
    position: fixed;
    bottom: 70px;
    right: 5px;
    background: linear-gradient(135deg, #ff4757, #ff3838);
    color: white;
    border: none;
    border-radius: 50px;
    padding: 12px 20px;
    display: flex;
    align-items: center;
    gap: 8px;
    box-shadow: 0 4px 15px rgba(255, 71, 87, 0.3);
    z-index: 9999;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 600;
    font-size: 14px;
}

.favorites-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(255, 71, 87, 0.4);
    background: linear-gradient(135deg, #ff3838, #ff2d2d);
}

.favorites-btn:active {
    transform: translateY(0);
}

.favorites-count {
    background: white;
    color: #ff4757;
    border-radius: 50%;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: bold;
    transition: all 0.3s ease;
}

/* Botón de favorito en tarjetas */
.favorite-toggle {
    position: absolute;
    top: 10px;
    right: 10px;
    background: rgba(255, 255, 255, 0.95);
    border: none;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 10;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(0,0,0,0.2);
    font-size: 16px;
}

.favorite-toggle:hover {
    background: white;
    transform: scale(1.1);
    box-shadow: 0 4px 12px rgba(0,0,0,0.3);
}

.favorite-toggle.favorited {
    background: #ff4757;
    color: white;
}

.favorite-toggle.favorited i {
    color: #ff2d2d;
}

.favorite-toggle.favorited:hover {
    background: #ff2d2d;
}

/* Modal de favoritos */
.favorites-modal .modal-content {
    border-radius: 15px;
    border: none;
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
}

.favorites-modal .modal-header {
    background: linear-gradient(135deg, #ff4757, #ff6b81);
    color: white;
    border-radius: 15px 15px 0 0;
    border: none;
    padding: 20px;
}

.favorites-modal .modal-title {
    font-weight: 700;
    font-size: 1.3rem;
}

.favorites-modal .modal-body {
    padding: 0;
    max-height: 60vh;
    overflow-y: auto;
}

.favorites-modal .modal-footer {
    border-top: 1px solid #eee;
    padding: 15px 20px;
}

/* Items de favoritos */
.favorite-item {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 15px 20px;
    border-bottom: 1px solid #f0f0f0;
    transition: all 0.3s ease;
    background: white;
}

.favorite-item:hover {
    background: #f8f9fa;
    transform: translateX(5px);
}

.favorite-item:last-child {
    border-bottom: none;
}

.favorite-item img {
    width: 60px;
    height: 60px;
    object-fit: cover;
    border-radius: 10px;
    flex-shrink: 0;
}

.favorite-item-info {
    flex: 1;
    min-width: 0;
}

.favorite-item-info h6 {
    margin: 0;
    font-weight: 600;
    color: #333;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.favorite-item-info .text-muted {
    font-size: 0.85rem;
    margin-bottom: 4px;
}

.favorite-item-info .badge {
    font-size: 0.75rem;
}

.favorite-item-actions {
    display: flex;
    gap: 8px;
    flex-shrink: 0;
}

.favorite-item-actions .btn {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    transition: all 0.3s ease;
}

.favorite-item-actions .btn:hover {
    transform: scale(1.1);
}

/* Estados vacío */
#emptyFavorites {
    padding: 40px 20px;
}

#emptyFavorites i {
    color: #ddd;
    margin-bottom: 15px;
}

#emptyFavorites p {
    color: #6c757d;
    margin-bottom: 5px;
}

#emptyFavorites small {
    color: #adb5bd;
}

/* Toast Notifications */
.favorite-toast {
    position: fixed;
    bottom: 80px;
    right: 20px;
    background: white;
    border-radius: 10px;
    padding: 15px 20px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.2);
    z-index: 1001;
    transform: translateX(120%);
    transition: transform 0.3s ease;
    border-left: 4px solid #ff4757;
    max-width: 300px;
}

.favorite-toast.show {
    transform: translateX(0);
}

.favorite-toast-success {
    border-left-color: #2ed573;
}

.favorite-toast-info {
    border-left-color: #1e90ff;
}

.favorite-toast-warning {
    border-left-color: #ffa502;
}

.toast-content {
    display: flex;
    align-items: center;
    gap: 10px;
}

.toast-content i {
    font-size: 1.2rem;
}

.favorite-toast-success .toast-content i {
    color: #2ed573;
}

.favorite-toast-info .toast-content i {
    color: #1e90ff;
}

.favorite-toast-warning .toast-content i {
    color: #ffa502;
}

.toast-content span {
    color: #333;
    font-weight: 500;
    font-size: 0.9rem;
}

/* Responsive */
@media (max-width: 768px) {
    .favorites-btn {
        bottom: 15px;
        right: 15px;
        padding: 10px 16px;
        font-size: 13px;
    }
    
    .favorite-toggle {
        width: 35px;
        height: 35px;
        font-size: 14px;
    }
    
    .favorites-modal .modal-dialog {
        margin: 20px;
    }
    
    .favorite-item {
        padding: 12px 15px;
    }
    
    .favorite-item img {
        width: 50px;
        height: 50px;
    }
    
    .favorite-toast {
        bottom: 70px;
        right: 15px;
        left: 15px;
        max-width: none;
    }
}

@media (max-width: 480px) {
    .favorite-item {
        flex-direction: column;
        text-align: center;
        gap: 10px;
    }
    
    .favorite-item-info {
        width: 100%;
    }
    
    .favorite-item-actions {
        width: 100%;
        justify-content: center;
    }
}

/* Animaciones */
@keyframes favoritePulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.1); }
    100% { transform: scale(1); }
}

.favorite-toggle.favorited {
    animation: favoritePulse 0.5s ease;
}

/* Scrollbar personalizado para modal */
.favorites-modal .modal-body::-webkit-scrollbar {
    width: 6px;
}

.favorites-modal .modal-body::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 3px;
}

.favorites-modal .modal-body::-webkit-scrollbar-thumb {
    background: #ff4757;
    border-radius: 3px;
}

.favorites-modal .modal-body::-webkit-scrollbar-thumb:hover {
    background: #ff2d2d;
}

/* Sistema de Favoritos - Estilos */
.favorites-btn-header {
    position: relative;
    background: none;
    border: none;
    font-size: 1.5rem;
    color: #6c757d;
    cursor: pointer;
    transition: all 0.3s ease;
    padding: 0.5rem;
}

.favorites-btn-header:hover {
    color: #dc3545;
    transform: scale(1.1);
}

.favorites-btn-header.has-favorites {
    color: #dc3545;
}

.favorites-count-header {
    position: absolute;
    top: -5px;
    right: -5px;
    background: #dc3545;
    color: white;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    font-size: 0.75rem;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    transition: transform 0.3s ease;
}

/* Modal de Favoritos */
.favorites-modal .modal-content {
    border-radius: 15px;
    border: none;
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
}

.favorites-modal .modal-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-radius: 15px 15px 0 0;
    border: none;
}

.favorites-modal .modal-title {
    font-weight: 600;
}

/* Items de Favoritos */
.favorite-item {
    display: flex;
    align-items: center;
    padding: 1rem;
    border: 1px solid #e9ecef;
    border-radius: 10px;
    margin-bottom: 0.75rem;
    background: white;
    transition: all 0.3s ease;
    position: relative;
}

.favorite-item:hover {
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    transform: translateY(-2px);
}

.favorite-item img {
    width: 60px;
    height: 60px;
    object-fit: cover;
    border-radius: 8px;
    margin-right: 1rem;
}

.favorite-item-info {
    flex: 1;
}

.favorite-item-info h6 {
    margin: 0;
    color: #333;
    font-weight: 600;
}

.favorite-item-actions {
    display: flex;
    gap: 0.5rem;
}

.favorite-item-localidad {
    position: absolute;
    top: 5px;
    right: 5px;
    background: #667eea;
    color: white;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 10px;
    font-weight: bold;
    text-transform: uppercase;
}

/* Botones de favorito en tarjetas */
.favorite-toggle {
    transition: all 0.3s ease !important;
}

.favorite-toggle:hover {
    transform: scale(1.1) !important;
    background: rgba(255, 255, 255, 1) !important;
}

.favorite-toggle.favorited {
    color: #dc3545 !important;
}

/* Toast Notifications */
.favorite-toast {
    position: fixed;
    top: 20px;
    right: 20px;
    background: white;
    border-radius: 10px;
    padding: 12px 16px;
    box-shadow: 0 6px 20px rgba(0,0,0,0.15);
    z-index: 1060;
    transform: translateX(400px);
    transition: transform 0.3s ease;
    border-left: 4px solid #007bff;
    min-width: 300px;
}

.favorite-toast.show {
    transform: translateX(0);
}

.favorite-toast-success {
    border-left-color: #28a745;
}

.favorite-toast-warning {
    border-left-color: #ffc107;
}

.favorite-toast-info {
    border-left-color: #17a2b8;
}

.favorite-toast .toast-content {
    display: flex;
    align-items: center;
    gap: 10px;
}

.favorite-toast .toast-content i {
    font-size: 1.2rem;
}

.favorite-toast-success .toast-content i {
    color: #28a745;
}

.favorite-toast-warning .toast-content i {
    color: #ffc107;
}

.favorite-toast-info .toast-content i {
    color: #17a2b8;
}

/* Responsive */
@media (max-width: 768px) {
    .favorite-item {
        flex-direction: column;
        text-align: center;
    }
    
    .favorite-item img {
        margin-right: 0;
        margin-bottom: 1rem;
    }
    
    .favorite-item-actions {
        margin-top: 1rem;
        justify-content: center;
    }
    
    .favorite-toast {
        min-width: 250px;
        right: 10px;
        left: 10px;
    }
}

/* Estados vacíos */
#emptyFavorites {
    padding: 3rem 1rem;
}

#emptyFavorites i {
    color: #dee2e6;
    margin-bottom: 1rem;
}

#emptyFavorites p {
    margin-bottom: 0.5rem;
    color: #6c757d;
}

#emptyFavorites small {
    color: #adb5bd;
}