/* ========== STYLES POUR LE PARTAGE ========== */

/* Bouton de partage flottant pour la sélection */
.share-popup {
    background: linear-gradient(135deg, #ffd700, #ffed4e);
    border: 2px solid #cd7f32;
    border-radius: 25px;
    box-shadow: 0 4px 15px rgba(205, 127, 50, 0.3), 
                inset 0 1px 0 rgba(255, 255, 255, 0.3);
    padding: 0;
    font-family: 'Cinzel', serif;
    animation: sharePopupAppear 0.3s ease-out;
}

.share-popup::before {
    content: '';
    position: absolute;
    bottom: -8px;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 0;
    border-left: 8px solid transparent;
    border-right: 8px solid transparent;
    border-top: 8px solid #cd7f32;
}

.share-popup::after {
    content: '';
    position: absolute;
    bottom: -6px;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 0;
    border-left: 6px solid transparent;
    border-right: 6px solid transparent;
    border-top: 6px solid #ffd700;
}

.share-selection-btn {
    background: none;
    border: none;
    color: #8b4513;
    font-family: 'Cinzel', serif;
    font-weight: 600;
    font-size: 0.9rem;
    padding: 8px 16px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
    border-radius: 23px;
    transition: all 0.3s ease;
}

.share-selection-btn:hover {
    color: #5d2f0a;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}

.share-selection-btn i {
    font-size: 1rem;
}

@keyframes sharePopupAppear {
    0% {
        opacity: 0;
        transform: translateX(-50%) scale(0.5) translateY(10px);
    }
    100% {
        opacity: 1;
        transform: translateX(-50%) scale(1) translateY(0);
    }
}

/* Affichage du lien de partage */
.share-link-display {
    background: linear-gradient(145deg, #2a1810, #1e130c);
    border: 2px solid #cd7f32;
    border-radius: 12px;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.3),
                inset 0 1px 0 rgba(255, 255, 255, 0.1);
    padding: 0;
    font-family: 'Cinzel', serif;
    animation: sharePopupAppear 0.3s ease-out;
    position: relative;
}

.share-link-display::before,
.share-link-display::after {
    content: '';
    position: absolute;
    bottom: -8px;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 0;
    border-left: 8px solid transparent;
    border-right: 8px solid transparent;
    border-top: 8px solid #cd7f32;
}

.share-link-display::after {
    bottom: -6px;
    border-left: 6px solid transparent;
    border-right: 6px solid transparent;
    border-top: 6px solid #2a1810;
}

.share-link-container {
    padding: 1rem;
    color: #f4e4bc;
}

.share-link-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 0.8rem;
    color: #ffd700;
    font-weight: 600;
    font-size: 0.9rem;
}

.share-link-header i {
    color: #cd7f32;
}

.share-link-content {
    display: flex;
    gap: 8px;
    margin-bottom: 0.8rem;
    align-items: stretch;
}

.share-link-input {
    flex: 1;
    background: rgba(244, 228, 188, 0.1);
    border: 1px solid rgba(205, 127, 50, 0.5);
    border-radius: 6px;
    padding: 8px 12px;
    color: #f4e4bc;
    font-family: 'Courier New', monospace;
    font-size: 0.8rem;
    min-width: 0; /* Permet la troncature */
    text-overflow: ellipsis;
    overflow: hidden;
    white-space: nowrap;
}

.share-link-input:focus {
    outline: none;
    border-color: #ffd700;
    background: rgba(244, 228, 188, 0.15);
    box-shadow: 0 0 8px rgba(255, 215, 0, 0.3);
}

.share-link-input::-webkit-selection {
    background: rgba(255, 215, 0, 0.3);
}

.share-link-input::-moz-selection {
    background: rgba(255, 215, 0, 0.3);
}

.copy-link-btn {
    background: linear-gradient(135deg, #cd7f32, #b8860b);
    border: 1px solid #8b4513;
    border-radius: 6px;
    color: #2a1810;
    padding: 8px 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 40px;
    text-shadow: 1px 1px 2px rgba(255, 255, 255, 0.3);
}

.copy-link-btn:hover {
    background: linear-gradient(135deg, #ffd700, #ffed4e);
    transform: translateY(-1px);
    box-shadow: 0 3px 10px rgba(205, 127, 50, 0.4);
}

.copy-link-btn i {
    font-size: 0.9rem;
}

.share-link-info {
    color: #d4c4a8;
    font-size: 0.75rem;
    font-style: italic;
    margin-bottom: 0.8rem;
    padding: 6px 8px;
    background: rgba(244, 228, 188, 0.05);
    border-radius: 4px;
    border-left: 3px solid #cd7f32;
}

.close-share-link {
    position: absolute;
    top: 8px;
    right: 8px;
    background: rgba(42, 24, 16, 0.3);
    border: 1px solid rgba(205, 127, 50, 0.5);
    border-radius: 50%;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: #cd7f32;
    transition: all 0.3s ease;
    font-size: 0.7rem;
}

.close-share-link:hover {
    background: rgba(205, 127, 50, 0.2);
    color: #ffd700;
    transform: scale(1.1);
}

/* Modal de partage */
.share-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.share-modal-overlay.active {
    opacity: 1;
}

.share-modal {
    background: linear-gradient(145deg, #2a1810, #1e130c);
    border: 3px solid #cd7f32;
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5),
                inset 0 1px 0 rgba(255, 255, 255, 0.1);
    max-width: 500px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
    transform: scale(0.8);
    transition: transform 0.3s ease;
}

.share-modal-overlay.active .share-modal {
    transform: scale(1);
}

.share-modal-header {
    background: linear-gradient(135deg, #cd7f32, #b8860b);
    border-radius: 12px 12px 0 0;
    padding: 1rem 1.5rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 2px solid #8b4513;
}

.share-modal-header h3 {
    color: #2a1810;
    font-family: 'Cinzel', serif;
    font-weight: 700;
    font-size: 1.2rem;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 10px;
    text-shadow: 1px 1px 2px rgba(255, 255, 255, 0.3);
}

.share-modal-close {
    background: rgba(42, 24, 16, 0.2);
    border: 1px solid #8b4513;
    border-radius: 50%;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: #2a1810;
    transition: all 0.3s ease;
}

.share-modal-close:hover {
    background: rgba(42, 24, 16, 0.4);
    transform: scale(1.1);
}

.share-modal-content {
    padding: 1.5rem;
    color: #f4e4bc;
}

.share-option {
    background: rgba(244, 228, 188, 0.05);
    border: 1px solid rgba(205, 127, 50, 0.3);
    border-radius: 10px;
    padding: 1.2rem;
    margin-bottom: 1rem;
    transition: all 0.3s ease;
}

.share-option:hover {
    background: rgba(244, 228, 188, 0.08);
    border-color: rgba(205, 127, 50, 0.5);
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(205, 127, 50, 0.2);
}

.share-option h4 {
    color: #ffd700;
    font-family: 'Cinzel', serif;
    font-size: 1.1rem;
    margin: 0 0 0.5rem 0;
    font-weight: 600;
}

.share-option p {
    color: #d4c4a8;
    margin: 0 0 1rem 0;
    font-size: 0.9rem;
    line-height: 1.4;
}

.share-btn {
    background: linear-gradient(135deg, #cd7f32, #b8860b);
    border: 1px solid #8b4513;
    border-radius: 8px;
    color: #2a1810;
    font-family: 'Cinzel', serif;
    font-weight: 600;
    font-size: 0.9rem;
    padding: 10px 20px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.3s ease;
    text-shadow: 1px 1px 2px rgba(255, 255, 255, 0.3);
}

.share-btn:hover {
    background: linear-gradient(135deg, #ffd700, #ffed4e);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(205, 127, 50, 0.4);
}

.share-btn i {
    font-size: 1rem;
}

.share-instructions {
    background: rgba(255, 215, 0, 0.1);
    border: 1px solid rgba(255, 215, 0, 0.3);
    border-radius: 8px;
    padding: 1rem;
    margin-top: 1rem;
}

.share-instructions p {
    margin: 0;
    color: #ffd700;
    font-size: 0.85rem;
    line-height: 1.4;
}

.share-instructions i {
    color: #ffed4e;
    margin-right: 5px;
}

/* Notifications */
.notification {
    position: fixed;
    top: 20px;
    right: 20px;
    background: linear-gradient(145deg, #2a1810, #1e130c);
    border: 2px solid #cd7f32;
    border-radius: 10px;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.3),
                inset 0 1px 0 rgba(255, 255, 255, 0.1);
    max-width: 400px;
    z-index: 10001;
    transform: translateX(100%);
    transition: transform 0.3s ease;
}

.notification.show {
    transform: translateX(0);
}

.notification.hide {
    transform: translateX(100%);
}

.notification-content {
    display: flex;
    align-items: flex-start;
    padding: 1rem;
    gap: 12px;
}

.notification-icon {
    background: linear-gradient(135deg, #cd7f32, #b8860b);
    border-radius: 50%;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    box-shadow: 0 2px 8px rgba(205, 127, 50, 0.3);
}

.notification-icon i {
    color: #2a1810;
    font-size: 1.1rem;
    text-shadow: 1px 1px 2px rgba(255, 255, 255, 0.3);
}

.notification-text {
    flex: 1;
    color: #f4e4bc;
}

.notification-text h4 {
    color: #ffd700;
    font-family: 'Cinzel', serif;
    font-size: 1rem;
    font-weight: 600;
    margin: 0 0 0.3rem 0;
}

.notification-text p {
    margin: 0;
    font-size: 0.85rem;
    line-height: 1.4;
    color: #d4c4a8;
}

.notification-close {
    background: none;
    border: none;
    color: #cd7f32;
    cursor: pointer;
    padding: 2px;
    border-radius: 3px;
    transition: all 0.3s ease;
    align-self: flex-start;
}

.notification-close:hover {
    background: rgba(205, 127, 50, 0.2);
    color: #ffd700;
}

/* Styles spécifiques pour les types de notification */
.notification-success .notification-icon {
    background: linear-gradient(135deg, #4caf50, #45a049);
}

.notification-error .notification-icon {
    background: linear-gradient(135deg, #f44336, #da190b);
}

.notification-info .notification-icon {
    background: linear-gradient(135deg, #2196f3, #1976d2);
}

/* Bouton de partage dans la modal du document */
#modalShareBtn {
    background: linear-gradient(135deg, #cd7f32, #b8860b);
    border: 1px solid #8b4513;
    border-radius: 8px;
    color: #2a1810;
    font-family: 'Cinzel', serif;
    font-weight: 600;
    font-size: 0.9rem;
    padding: 8px 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    text-shadow: 1px 1px 2px rgba(255, 255, 255, 0.3);
    display: flex;
    align-items: center;
    gap: 6px;
}

#modalShareBtn:hover {
    background: linear-gradient(135deg, #ffd700, #ffed4e);
    transform: translateY(-1px);
    box-shadow: 0 3px 10px rgba(205, 127, 50, 0.4);
}

#modalShareBtn i {
    font-size: 1rem;
}

/* Responsive */
@media (max-width: 768px) {
    .share-modal {
        width: 95%;
        margin: 10px;
    }
    
    .share-modal-content {
        padding: 1rem;
    }
    
    .notification {
        right: 10px;
        left: 10px;
        max-width: none;
    }
    
    .share-popup {
        transform: translateX(-50%) scale(0.9);
    }
    
    /* Styles pour l'affichage du lien sur mobile */
    .share-link-display {
        min-width: 280px !important;
        max-width: calc(100vw - 40px) !important;
        left: 20px !important;
        transform: none !important;
    }
    
    .share-link-content {
        flex-direction: column;
        gap: 10px;
    }
    
    .copy-link-btn {
        align-self: center;
        min-width: 120px;
    }
    
    .share-link-input {
        font-size: 0.75rem;
        padding: 10px 12px;
    }
}

/* Animation pour les éléments partagés surlignés */
.shared-highlight {
    background: linear-gradient(120deg, 
        rgba(255, 215, 0, 0.3) 0%, 
        rgba(255, 215, 0, 0.1) 50%, 
        rgba(255, 215, 0, 0.3) 100%);
    border-radius: 4px;
    padding: 2px 4px;
    animation: sharedGlow 2s ease-in-out infinite alternate;
    box-shadow: 0 0 10px rgba(255, 215, 0, 0.3);
}

@keyframes sharedGlow {
    0% {
        box-shadow: 0 0 5px rgba(255, 215, 0, 0.3);
    }
    100% {
        box-shadow: 0 0 15px rgba(255, 215, 0, 0.6);
    }
}

/* Styles pour le surlignage multiple de lignes partagées */
.shared-multi-highlight {
    background: linear-gradient(120deg, 
        rgba(102, 187, 255, 0.25) 0%, 
        rgba(102, 187, 255, 0.1) 50%, 
        rgba(102, 187, 255, 0.25) 100%);
    border-left: 4px solid var(--primary-blue, #66bbff);
    border-radius: 2px;
    animation: sharedMultiGlow 3s ease-in-out;
    position: relative;
}

.shared-multi-highlight::before {
    content: '';
    position: absolute;
    left: -2px;
    top: 0;
    bottom: 0;
    width: 2px;
    background: linear-gradient(180deg, 
        transparent 0%, 
        var(--primary-blue, #66bbff) 20%, 
        var(--primary-blue, #66bbff) 80%, 
        transparent 100%);
    animation: sharedMultiPulse 2s ease-in-out infinite;
}

@keyframes sharedMultiGlow {
    0% { 
        background: linear-gradient(120deg, 
            rgba(102, 187, 255, 0.4) 0%, 
            rgba(102, 187, 255, 0.2) 50%, 
            rgba(102, 187, 255, 0.4) 100%);
    }
    50% { 
        background: linear-gradient(120deg, 
            rgba(102, 187, 255, 0.3) 0%, 
            rgba(102, 187, 255, 0.15) 50%, 
            rgba(102, 187, 255, 0.3) 100%);
    }
    100% { 
        background: linear-gradient(120deg, 
            rgba(102, 187, 255, 0.25) 0%, 
            rgba(102, 187, 255, 0.1) 50%, 
            rgba(102, 187, 255, 0.25) 100%);
    }
}

@keyframes sharedMultiPulse {
    0%, 100% {
        opacity: 0.6;
    }
    50% {
        opacity: 1;
    }
}

/* Quand plusieurs lignes sont surlignées, ajouter une indication visuelle */
.shared-multi-highlight:first-of-type::after {
    content: '📍';
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 12px;
    opacity: 0.7;
    animation: fadeInOut 4s ease-in-out;
}

@keyframes fadeInOut {
    0%, 100% { opacity: 0; }
    20%, 80% { opacity: 0.7; }
}
