/**
 * Smart Embed Styles
 * Styles for video embeds and link previews
 */

/* Embed Container */
.embed-container {
    margin: 1.5rem 0;
    max-width: 100%;
}

/* Video Embeds */
.embed-video {
    position: relative;
    width: 100%;
    max-width: 100%;
    margin: 1.5rem 0;
}

.embed-container {
    position: relative;
}

.embed-placeholder {
    position: relative;
    padding-bottom: 56.25%; /* 16:9 aspect ratio */
    height: 0;
    overflow: hidden;
    background: #000;
    border-radius: 8px;
    cursor: pointer;
    transition: transform 0.2s ease;
}

.embed-placeholder:hover {
    transform: scale(1.01);
}

.embed-thumbnail-img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 1;
    z-index: 0;
}

.embed-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.4);
    transition: background 0.2s ease;
    z-index: 1;
}

.embed-placeholder:hover .embed-overlay {
    background: rgba(0, 0, 0, 0.3);
}

.embed-play-button {
    width: 68px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: transform 0.2s ease;
    z-index: 2;
    transform: scale(1);
    will-change: transform;
}

.embed-placeholder:hover .embed-play-button {
    transform: scale(1.1);
}

.embed-youtube .embed-play-button {
    background: #FF0000;
}

.embed-vimeo .embed-play-button {
    background: #1ab7ea;
}

.embed-iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: none;
    border-radius: 8px;
}

/* Hide iframe by default, show on click */
.embed-container:not(.loaded) .embed-iframe {
    display: none !important;
}

.embed-container.loaded .embed-placeholder {
    display: none !important;
}

.embed-container.loaded .embed-iframe {
    display: block !important;
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

/* Ensure container maintains aspect ratio when iframe is loaded */
.embed-container.loaded {
    padding-bottom: 56.25%; /* 16:9 aspect ratio */
    height: 0;
    position: relative;
}

/* Link Preview Cards */
.embed-link-preview {
    margin: 1.5rem 0;
}

.embed-card {
    border: 1px solid var(--border, #ddd);
    border-radius: 8px;
    overflow: hidden;
    display: flex;
    background: var(--surface, #fff);
    transition: box-shadow 0.2s ease;
    text-decoration: none;
    color: inherit;
}

.embed-card:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    text-decoration: none;
    color: inherit;
}

.embed-thumbnail {
    width: 200px;
    min-width: 200px;
    height: 150px;
    background: #f0f0f0;
    overflow: hidden;
    flex-shrink: 0;
}

.embed-thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.embed-content {
    flex: 1;
    padding: 16px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.embed-domain {
    font-size: 0.75rem;
    color: var(--text-secondary, #666);
    text-transform: uppercase;
    margin-bottom: 4px;
    letter-spacing: 0.5px;
}

.embed-title {
    font-weight: 600;
    color: var(--text-primary, #333);
    margin-bottom: 8px;
    line-height: 1.4;
}

.embed-description {
    font-size: 0.9rem;
    color: var(--text-secondary, #666);
    line-height: 1.5;
}

/* Dark Mode Support */
[data-theme="dark"] .embed-card {
    background: var(--surface, #1E293B);
    border-color: var(--border, #334155);
}

[data-theme="dark"] .embed-title {
    color: var(--text-primary, #F1F5F9);
}

[data-theme="dark"] .embed-description {
    color: var(--text-secondary, #CBD5E1);
}

[data-theme="dark"] .embed-domain {
    color: var(--text-secondary, #CBD5E1);
}

[data-theme="dark"] .embed-thumbnail {
    background: var(--surface-alt, #0F172A);
}

/* Responsive */
@media (max-width: 768px) {
    .embed-thumbnail {
        width: 120px;
        min-width: 120px;
        height: 90px;
    }
    
    .embed-content {
        padding: 12px;
    }
    
    .embed-title {
        font-size: 0.95rem;
    }
    
    .embed-description {
        font-size: 0.85rem;
    }
}

/* Loading State */
.embed-container.loading {
    opacity: 0.7;
    pointer-events: none;
}

