/**
 * URL Embed Card Styles
 * Modern, responsive URL preview cards
 */

.url-embed-card {
    display: flex;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    overflow: hidden;
    margin: 20px 0;
    text-decoration: none;
    color: inherit;
    transition: all 0.3s ease;
    background: #ffffff;
    max-width: 100%;
}

.url-embed-card,
.url-embed-card:hover,
.url-embed-card:focus,
.url-embed-card:active {
    text-decoration: none;
}

.url-embed-card * {
    text-decoration: none;
}

.url-embed-card:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    border-color: #007bff;
    transform: translateY(-2px);
    text-decoration: none;
}

.url-embed-card-content {
    flex: 1;
    padding: 16px 20px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    min-width: 0;
}

.url-embed-card-image {
    width: 200px;
    height: auto;
    min-height: 150px;
    max-height: 250px;
    object-fit: cover;
    flex-shrink: 0;
    display: block;
}

.url-embed-card-title {
    font-size: 18px;
    font-weight: 600;
    margin: 0 0 8px 0;
    color: #1a1a1a;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    line-height: 1.4;
}

.url-embed-card-description {
    font-size: 14px;
    color: #666666;
    margin: 0 0 12px 0;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    line-height: 1.5;
}

.url-embed-card-meta {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: #888888;
}

.url-embed-card-favicon {
    width: 16px;
    height: 16px;
    border-radius: 3px;
    flex-shrink: 0;
}

.url-embed-card-site {
    font-weight: 500;
    color: #666666;
}

/* Responsive */
@media (max-width: 768px) {
    .url-embed-card {
        flex-direction: column;
    }
    
    .url-embed-card-image {
        width: 100%;
        height: 200px;
    }
    
    .url-embed-card-content {
        padding: 16px;
    }
}

/* Loading state */
.url-embed-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    margin: 20px 0;
    background: #f9f9f9;
}

.url-embed-loading::after {
    content: '';
    width: 40px;
    height: 40px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #007bff;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Error state */
.url-embed-error {
    padding: 16px 20px;
    border: 1px solid #ffc107;
    border-radius: 8px;
    margin: 20px 0;
    background: #fff9e6;
    color: #856404;
}

/* No image variant */
.url-embed-card.no-image .url-embed-card-content {
    padding: 20px;
}

/* Dark theme support using data-theme attribute */
body[data-theme="dark"] .url-embed-card,
[data-theme="dark"] .url-embed-card {
    background: #1e1e1e;
    border-color: #404040;
}

body[data-theme="dark"] .url-embed-card:hover,
[data-theme="dark"] .url-embed-card:hover {
    border-color: #4a9eff;
    box-shadow: 0 4px 12px rgba(74, 158, 255, 0.2);
}

body[data-theme="dark"] .url-embed-card-title,
[data-theme="dark"] .url-embed-card-title {
    color: #e0e0e0;
}

body[data-theme="dark"] .url-embed-card-description,
[data-theme="dark"] .url-embed-card-description {
    color: #b0b0b0;
}

body[data-theme="dark"] .url-embed-card-meta,
[data-theme="dark"] .url-embed-card-meta {
    color: #888888;
}

body[data-theme="dark"] .url-embed-card-site,
[data-theme="dark"] .url-embed-card-site {
    color: #999999;
}

body[data-theme="dark"] .url-embed-loading,
[data-theme="dark"] .url-embed-loading {
    background: #2a2a2a;
    border-color: #404040;
}

body[data-theme="dark"] .url-embed-error,
[data-theme="dark"] .url-embed-error {
    background: #3a3520;
    border-color: #857a3a;
    color: #ffc107;
}
