/**
 * Styles pour les cartes de prévisualisation d'URL
 */

/* Container du placeholder */
.url-preview-placeholder {
    margin: 1.5rem 0;
    transition: all 0.3s ease;
}

/* Loader */
.url-preview-loader {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem;
    background-color: rgba(59, 130, 246, 0.05);
    border: 1px dashed rgba(59, 130, 246, 0.3);
    border-radius: 0.5rem;
}

.url-preview-loader-animation {
    width: 1.25rem;
    height: 1.25rem;
    border: 2px solid rgba(59, 130, 246, 0.3);
    border-top-color: rgba(59, 130, 246, 1);
    border-radius: 50%;
    animation: url-preview-spin 0.8s linear infinite;
}

@keyframes url-preview-spin {
    to {
        transform: rotate(360deg);
    }
}

.url-preview-loader-text {
    font-size: 0.875rem;
    color: #6b7280;
}

/* Dark mode pour le loader */
.dark .url-preview-loader {
    background-color: rgba(59, 130, 246, 0.1);
    border-color: rgba(59, 130, 246, 0.4);
}

.dark .url-preview-loader-text {
    color: #9ca3af;
}

/* Carte de prévisualisation */
.url-preview-card {
    display: flex;
    flex-direction: row;
    overflow: hidden;
    border: 1px solid #e5e7eb;
    border-radius: 0.75rem;
    background-color: #ffffff;
    text-decoration: none;
    transition: all 0.2s ease;
    box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1);
    max-width: 650px;
}

.url-preview-card:hover {
    border-color: #3b82f6;
    box-shadow: 0 4px 12px 0 rgba(59, 130, 246, 0.15);
    transform: translateY(-2px);
}

/* Dark mode pour la carte */
.dark .url-preview-card {
    background-color: #1f2937;
    border-color: #374151;
}

.dark .url-preview-card:hover {
    border-color: #3b82f6;
    box-shadow: 0 4px 12px 0 rgba(59, 130, 246, 0.25);
}

/* Image de prévisualisation */
.url-preview-image {
    flex-shrink: 0;
    width: 180px;
    height: 180px;
    background-color: #f3f4f6;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
}

.url-preview-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.dark .url-preview-image {
    background-color: #374151;
}

/* Contenu de la carte */
.url-preview-content {
    flex: 1;
    padding: 1rem 1.25rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    min-width: 0;
}

/* Nom du site */
.url-preview-site {
    font-size: 0.75rem;
    font-weight: 600;
    color: #6b7280;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.dark .url-preview-site {
    color: #9ca3af;
}

/* Titre */
.url-preview-title {
    font-size: 1rem;
    font-weight: 600;
    color: #111827;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
}

.dark .url-preview-title {
    color: #f9fafb;
}

/* Description */
.url-preview-description {
    font-size: 0.875rem;
    color: #6b7280;
    line-height: 1.5;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
}

.dark .url-preview-description {
    color: #9ca3af;
}

/* URL/Domaine */
.url-preview-url {
    display: flex;
    align-items: center;
    gap: 0.375rem;
    font-size: 0.75rem;
    color: #9ca3af;
    margin-top: auto;
}

.dark .url-preview-url {
    color: #6b7280;
}

.url-preview-icon {
    width: 1rem;
    height: 1rem;
    flex-shrink: 0;
}

/* Lien de fallback (en cas d'erreur) */
.url-preview-fallback {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1rem;
    background-color: #f3f4f6;
    border: 1px solid #e5e7eb;
    border-radius: 0.5rem;
    color: #3b82f6;
    text-decoration: none;
    font-size: 0.875rem;
    transition: all 0.2s ease;
}

.url-preview-fallback:hover {
    background-color: #e5e7eb;
    border-color: #3b82f6;
}

.dark .url-preview-fallback {
    background-color: #374151;
    border-color: #4b5563;
    color: #60a5fa;
}

.dark .url-preview-fallback:hover {
    background-color: #4b5563;
    border-color: #3b82f6;
}

/* Layout mobile */
@media (max-width: 640px) {
    .url-preview-card {
        flex-direction: column;
    }
    
    .url-preview-image {
        width: 100%;
        height: 160px;
    }
    
    .url-preview-content {
        padding: 1rem;
    }
    
    .url-preview-title {
        font-size: 0.9375rem;
    }
}

/* Animation d'entrée */
.url-preview-placeholder.loaded {
    animation: url-preview-fade-in 0.3s ease;
}

@keyframes url-preview-fade-in {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

