/* ============================================
   SYSTÈME DE FAVORIS - STYLES
   ============================================ */

/* Bouton favoris (cœur uniquement) */
.karto-favorite-btn {
    position: absolute;
    top: 16px;
    right: 22px;
    width: 36px;
    height: 36px;
    background: rgba(255, 255, 255, 0.9);
    border: none;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    padding: 0;
}

.karto-favorite-shortcode-wrap.is-inline {
    display: inline-flex;
    align-items: center;
    gap: 10px;
}

.karto-favorite-btn.karto-favorite-btn-relative {
    position: relative;
    top: auto;
    right: auto;
}

.karto-favorite-btn-text {
    font-size: 15px;
    line-height: 1.2;
    color: #1C1C1C;
}

.karto-favorite-btn:hover {
    background: rgba(255, 255, 255, 1);
    transform: scale(1.1);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.karto-favorite-btn.active {
    background: #FF9A41;
}

.karto-favorite-btn.active:hover {
    background: #FF9A41;
    opacity: 0.9;
}

.karto-favorite-icon {
    position: relative;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.karto-favorite-icon svg {
    position: absolute;
    width: 20px;
    height: 20px;
    transition: all 0.3s ease;
}

.karto-favorite-icon .heart-empty {
    color: #FF9A41;
}

.karto-favorite-icon .heart-filled {
    color: #ffffff;
    display: none;
}

.karto-favorite-btn.active .heart-empty {
    display: none;
}

.karto-favorite-btn.active .heart-filled {
    display: block;
}

/* Animation du cœur au clic */
@keyframes heartBeat {
    0% {
        transform: scale(1);
    }
    25% {
        transform: scale(1.3);
    }
    50% {
        transform: scale(1);
    }
    75% {
        transform: scale(1.2);
    }
    100% {
        transform: scale(1);
    }
}

.karto-favorite-btn:active .karto-favorite-icon svg {
    animation: heartBeat 0.5s ease;
}

/* Page de liste des favoris */
#karto-favorites-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

.karto-favorites-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 2px solid #e0e0e0;
}

.karto-favorites-header h2 {
    margin: 0;
    font-size: 28px;
    color: #1C1C1C;
}

.karto-favorites-header-buttons {
    display: flex;
    gap: 10px;
    align-items: center;
}

#karto-send-favorites-email {
    padding: 10px 20px;
    background: #07959C;
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    transition: background 0.3s ease;
}

#karto-send-favorites-email:hover {
    background: #056f75;
}

#karto-send-favorites-email:disabled {
    background: #ccc;
    cursor: not-allowed;
}

#karto-download-favorites-pdf {
    padding: 10px 20px;
    background: #FF9A41;
    color: #fff;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    transition: background 0.3s ease;
}

#karto-download-favorites-pdf:hover {
    background: #E88734;
}

#karto-download-favorites-pdf:disabled {
    background: #c9c9c9;
    cursor: not-allowed;
}

#karto-clear-all-favorites {
    padding: 10px 20px;
    background: #84AC36;
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    transition: background 0.3s ease;
}

#karto-clear-all-favorites:hover {
    background: #648427;
}

.karto-favorites-grid {
    min-height: 200px;
}

.karto-favorites-grid-inner {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 24px;
}

.karto-favorite-item {
    background: white;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.karto-favorite-item:hover {
    transform: translateY(-4px);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
}

.karto-favorite-image {
    position: relative;
    width: 100%;
    height: 200px;
    overflow: hidden;
}

.karto-favorite-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Image sans thumbnail : fond gris clair avec icône centrée */
.karto-favorite-image-no-thumbnail {
    background: #e8e8e8;
    display: flex;
    align-items: center;
    justify-content: center;
}

.karto-favorite-image-no-thumbnail .karto-default-icon {
    width: 64px;
    height: 64px;
    object-fit: contain;
    opacity: 0.6;
}

.karto-favorite-content {
    padding: 30px;
}

.karto-favorite-title {
    margin: 0 0 8px 0;
    font-size: 18px;
    font-weight: 600;
    color:#1C1C1C;
}

.karto-favorite-meta {
    margin: 0 0 8px 0;
    font-size: 14px;
    color: #1C1C1C;
}

.karto-favorite-adresse {
    margin: 8px 0;
    font-size: 14px;
    color: #1C1C1C;
}

.karto-favorite-discover-link {
    display: inline-block;
    margin-top: 12px;
    font-size: 13px;
    font-weight: 500;
    color: #039FA5;
    text-decoration: none;
}

.karto-favorite-discover-link:hover {
    text-decoration: underline;
}

.karto-favorite-description {
    margin: 8px 0 0 0;
    font-size: 14px;
    color: #1C1C1C;
    line-height: 1.5;
}

/* Bouton retirer (croix) sur la liste des favoris */
.karto-favorite-item .karto-favorite-btn-remove {
    background: rgba(0, 0, 0, 0.5);
}
.karto-favorite-item .karto-favorite-btn-remove .karto-icon-remove {
    color: #fff;
    width: 20px;
    height: 20px;
}
.karto-favorite-item .karto-favorite-btn-remove:hover {
    background: #dc3545;
}

.karto-no-favorites {
    text-align: center;
    padding: 40px 20px;
    color: #999;
    font-size: 16px;
}

/* Compteur de favoris */
.karto-favorites-counter-widget {
    display: inline-block;
}

.karto-favorites-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
    color: #333;
    font-size: 16px;
    transition: color 0.3s ease;
    position: relative;
}

.karto-favorites-link:hover {
    color: #e91e63;
}

.karto-favorites-link svg {
    width: 30px;
    height: 30px;
    fill: currentColor;
}

.karto-favorites-text {
    font-weight: 500;
}

.karto-favorites-counter-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 20px;
    height: 20px;
    padding: 0 6px;
    background: #e91e63;
    color: white;
    border-radius: 10px;
    font-size: 12px;
    font-weight: 600;
    margin-left: 4px;
    position: absolute;
    top: -10px;
    right: -2px;
}

/* Mini liste de favoris */
.karto-favorites-mini-widget {
    margin: 20px 0;
}

.karto-favorites-mini-title {
    margin: 0 0 16px 0;
    font-size: 20px;
    font-weight: 600;
    color: #333;
}

.karto-favorites-mini-list-inner {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.karto-favorite-mini-item {
    display: flex;
    gap: 12px;
    padding: 12px;
    background: white;
    border-radius: 6px;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.1);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.karto-favorite-mini-item:hover {
    transform: translateX(4px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.karto-favorite-mini-image {
    flex-shrink: 0;
    width: 80px;
    height: 60px;
    border-radius: 4px;
    overflow: hidden;
}

.karto-favorite-mini-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Mini image sans thumbnail : fond gris clair avec icône centrée */
.karto-favorite-mini-image-no-thumbnail {
    background: #e8e8e8;
    display: flex;
    align-items: center;
    justify-content: center;
}

.karto-favorite-mini-image-no-thumbnail .karto-default-icon {
    width: 32px;
    height: 32px;
    object-fit: contain;
    opacity: 0.6;
}

.karto-favorite-mini-content {
    flex: 1;
    min-width: 0;
}

.karto-favorite-mini-title {
    margin: 0 0 4px 0;
    font-size: 14px;
    font-weight: 600;
    color: #333;
}

.karto-favorite-mini-excerpt {
    margin: 0;
    font-size: 12px;
    color: #666;
    line-height: 1.4;
}

.karto-no-favorites-mini {
    text-align: center;
    padding: 20px;
    color: #999;
    font-size: 14px;
}

/* Lien vers la page des favoris */
.karto-favorites-page-link {
    display: inline-block;
    padding: 10px 20px;
    background: #20b2aa;
    color: white;
    text-decoration: none;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    transition: background 0.3s ease;
}

.karto-favorites-page-link:hover {
    background: #1a9a94;
    color: white;
}

.karto-favorites-link-count {
    margin-left: 4px;
    font-weight: 600;
}

/* Modal pour l'envoi par email */
.karto-email-modal {
    display: none;
    position: fixed;
    z-index: 10000;
    left: 0;
    top: 0;
    width: 100%;
    min-width:100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0, 0, 0, 0.5);
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

.karto-email-modal-content {
    background-color: #fefefe;
    margin: 10% auto;
    padding: 30px;
    border: 1px solid #888;
    border-radius: 8px;
    width: 90%;
    max-width: 500px;
    position: relative;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    animation: slideDown 0.3s ease;
}

@keyframes slideDown {
    from {
        transform: translateY(-50px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.karto-email-modal-close {
    color: #aaa;
    float: right;
    font-size: 28px;
    font-weight: bold;
    position: absolute;
    right: 15px;
    top: 15px;
    cursor: pointer;
    line-height: 1;
}

.karto-email-modal-close:hover,
.karto-email-modal-close:focus {
    color: #000;
}

.karto-email-modal-content h3 {
    margin: 0 0 20px 0;
    font-size: 24px;
    color: #333;
}

.karto-email-form-group {
    margin-bottom: 20px;
}

.karto-email-form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #333;
}

.karto-email-form-group input[type="email"] {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 16px;
    box-sizing: border-box;
}

.karto-email-form-group input[type="email"]:focus {
    outline: none;
    border-color: #0073aa;
    box-shadow: 0 0 0 2px rgba(0, 115, 170, 0.1);
}

.karto-email-form-actions {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
    margin-top: 20px;
}

.karto-email-form-actions button {
    padding: 10px 20px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    transition: background 0.3s ease;
}

.karto-email-form-actions .button-primary {
    background: #0073aa;
    color: white;
}

.karto-email-form-actions .button-primary:hover {
    background: #005a87;
}

.karto-email-form-actions .button-primary:disabled {
    background: #ccc;
    cursor: not-allowed;
}

.karto-email-form-actions .button-secondary {
    background: #6c757d;
    color: white;
}

.karto-email-form-actions .button-secondary:hover {
    background: #5a6268;
}

.karto-email-message {
    padding: 12px;
    border-radius: 4px;
    margin-bottom: 15px;
    font-size: 14px;
}

.karto-email-message-success {
    background-color: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.karto-email-message-error {
    background-color: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

/* Responsive */
@media (max-width: 768px) {
    .karto-favorites-grid-inner {
        grid-template-columns: 1fr;
    }
    
    .karto-favorites-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 16px;
    }
    
    .karto-favorites-header-buttons {
        width: 100%;
        flex-direction: column;
    }
    
    #karto-download-favorites-pdf,
    #karto-send-favorites-email,
    #karto-clear-all-favorites {
        width: 100%;
    }
    
    .karto-email-modal-content {
        margin: 20% auto;
        padding: 20px;
        width: 95%;
    }
    
    .karto-email-form-actions {
        flex-direction: column;
    }
    
    .karto-email-form-actions button {
        width: 100%;
    }
}

