/* EmbedFusion v2.0.1 Frontend Styles */

.ef-embed-block,
.ef-embed-group {
    --ef-bg: #f8fafc;
    --ef-surface: #ffffff;
    --ef-border: #e2e8f0;
    --ef-text: #0f172a;
    --ef-muted: #475569;
    --ef-btn-sec-bg: #e2e8f0;
    --ef-btn-sec-text: #1e293b;
    --ef-shadow: 0 4px 16px rgba(15, 23, 42, 0.06);
    margin: 1.15em 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    box-sizing: border-box;
}

.ef-embed-group .ef-embed-block {
    margin: 0.75em 0;
}

.ef-embed-block *,
.ef-embed-block *::before,
.ef-embed-block *::after {
    box-sizing: border-box;
}

.ef-hidden {
    display: none !important;
}

@media (prefers-color-scheme: dark) {
    html:not([data-theme="light"]) .ef-embed-block,
    html:not([data-theme="light"]) .ef-embed-group {
        --ef-bg: #111827;
        --ef-surface: #1e293b;
        --ef-border: #334155;
        --ef-text: #f1f5f9;
        --ef-muted: #94a3b8;
        --ef-btn-sec-bg: #334155;
        --ef-btn-sec-text: #e2e8f0;
        --ef-shadow: 0 6px 20px rgba(0, 0, 0, 0.35);
    }
}

html[data-theme="dark"] .ef-embed-block,
html[data-theme="dark"] .ef-embed-group,
html.ps-dark-theme .ef-embed-block,
html.ps-dark-theme .ef-embed-group,
html.dark .ef-embed-block,
html.dark .ef-embed-group,
body.dark-mode .ef-embed-block,
body.dark-mode .ef-embed-group {
    --ef-bg: #111827;
    --ef-surface: #1e293b;
    --ef-border: #334155;
    --ef-text: #f1f5f9;
    --ef-muted: #94a3b8;
    --ef-btn-sec-bg: #334155;
    --ef-btn-sec-text: #e2e8f0;
    --ef-shadow: 0 6px 20px rgba(0, 0, 0, 0.35);
}

/* Responsive 16:9 Video Wrapper */
.ef-video-wrap {
    position: relative;
    width: 100%;
    max-width: 900px;
    margin: 0 auto;
    aspect-ratio: 16 / 9;
    border-radius: 12px;
    overflow: hidden;
    background: #000000;
    box-shadow: var(--ef-shadow);
}

@supports not (aspect-ratio: 16 / 9) {
    .ef-video-wrap {
        height: 0;
        padding-top: 56.25%;
    }
}

.ef-video-wrap iframe {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    border: 0;
    display: block;
}

/* Fixed-height Steam Widget Wrapper (prevents mobile clipping) */
.ef-steam-wrap {
    width: 100%;
    max-width: 646px;
    margin: 0 auto;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: var(--ef-shadow);
    background: #1b2838;
}

.ef-steam-wrap iframe {
    width: 100%;
    height: 190px;
    border: 0;
    display: block;
}

/* Social Mount Wrapper */
.ef-social-mount {
    display: flex;
    justify-content: center;
    width: 100%;
}

.ef-social-mount > iframe,
.ef-social-mount > .twitter-tweet,
.ef-social-mount > .instagram-media {
    margin: 0 auto !important;
}

/* Placeholder Card (YouTube / X / Instagram / Steam fallback) */
.ef-card {
    --ef-accent: #2563eb;
    --ef-accent-contrast: #ffffff;
    max-width: 680px;
    margin: 0 auto;
    padding: 18px 20px;
    border-radius: 12px;
    border: 1px solid var(--ef-border);
    border-left: 4px solid var(--ef-accent);
    background: var(--ef-surface);
    color: var(--ef-text);
    box-shadow: var(--ef-shadow);
}

.ef-card--youtube { --ef-accent: #e11d48; }
.ef-card--x { --ef-accent: #0f1419; }
.ef-card--instagram { --ef-accent: #d946ef; }
.ef-card--steam { --ef-accent: #1b2838; }

@media (prefers-color-scheme: dark) {
    html:not([data-theme="light"]) .ef-card--x { --ef-accent: #e2e8f0; --ef-accent-contrast: #0f172a; }
    html:not([data-theme="light"]) .ef-card--steam { --ef-accent: #66c0f4; --ef-accent-contrast: #0f172a; }
}

html[data-theme="dark"] .ef-card--x,
html.ps-dark-theme .ef-card--x,
html.dark .ef-card--x,
body.dark-mode .ef-card--x { --ef-accent: #e2e8f0; --ef-accent-contrast: #0f172a; }

html[data-theme="dark"] .ef-card--steam,
html.ps-dark-theme .ef-card--steam,
html.dark .ef-card--steam,
body.dark-mode .ef-card--steam { --ef-accent: #66c0f4; --ef-accent-contrast: #0f172a; }

.ef-card-head {
    display: flex;
    align-items: center;
    gap: 12px;
}

.ef-card-icon {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    background: var(--ef-bg);
    color: var(--ef-accent);
    border: 1px solid var(--ef-border);
}

.ef-card-icon svg {
    width: 22px;
    height: 22px;
}

.ef-card-meta {
    min-width: 0;
    flex: 1;
}

.ef-card-badge {
    display: inline-block;
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.02em;
    color: var(--ef-accent);
    margin-bottom: 2px;
}

.ef-card-title {
    font-size: 15px;
    font-weight: 600;
    line-height: 1.4;
    color: var(--ef-text);
    word-break: break-word;
}

.ef-card-status {
    margin: 10px 0 14px;
    font-size: 13px;
    line-height: 1.5;
    color: var(--ef-muted);
}

.ef-card-actions,
.ef-store-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

/* Shared Buttons */
.ef-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 7px 14px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 600;
    line-height: 1.4;
    text-decoration: none !important;
    cursor: pointer;
    border: 1px solid transparent;
    transition: opacity 0.16s ease, transform 0.12s ease;
}

.ef-btn:hover {
    opacity: 0.9;
}

.ef-btn:active {
    transform: translateY(1px);
}

.ef-btn-primary {
    background: var(--ef-accent);
    color: var(--ef-accent-contrast) !important;
}

.ef-btn-secondary {
    background: var(--ef-btn-sec-bg);
    color: var(--ef-btn-sec-text) !important;
}

/* Game Store Cards (Epic / Xbox / PlayStation / Nintendo) */
.ef-store-card {
    --ef-accent: #2563eb;
    --ef-accent-contrast: #ffffff;
    max-width: 720px;
    margin: 0 auto;
    display: flex;
    align-items: stretch;
    border-radius: 14px;
    overflow: hidden;
    border: 1px solid var(--ef-border);
    background: var(--ef-surface);
    color: var(--ef-text);
    box-shadow: var(--ef-shadow);
}

.ef-store-card--epic { --ef-accent: #2f2f2f; }
.ef-store-card--xbox { --ef-accent: #107c10; }
.ef-store-card--playstation { --ef-accent: #003791; }
.ef-store-card--nintendo { --ef-accent: #e60012; }

@media (prefers-color-scheme: dark) {
    html:not([data-theme="light"]) .ef-store-card--epic { --ef-accent: #475569; }
    html:not([data-theme="light"]) .ef-store-card--playstation { --ef-accent: #2563eb; }
}

html[data-theme="dark"] .ef-store-card--epic,
html.ps-dark-theme .ef-store-card--epic,
html.dark .ef-store-card--epic,
body.dark-mode .ef-store-card--epic { --ef-accent: #475569; }

html[data-theme="dark"] .ef-store-card--playstation,
html.ps-dark-theme .ef-store-card--playstation,
html.dark .ef-store-card--playstation,
body.dark-mode .ef-store-card--playstation { --ef-accent: #2563eb; }

.ef-store-media {
    position: relative;
    width: 240px;
    min-height: 144px;
    flex-shrink: 0;
    background: var(--ef-bg);
    overflow: hidden;
}

.ef-store-thumb {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.ef-store-emblem {
    width: 100%;
    height: 100%;
    min-height: 144px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 16px;
    color: #ffffff;
    text-align: center;
    font-size: 13px;
    font-weight: 600;
}

.ef-store-emblem svg {
    width: 36px;
    height: 36px;
}

.ef-store-emblem--epic { background: linear-gradient(135deg, #1a1a1a 0%, #3a3a3a 100%); }
.ef-store-emblem--xbox { background: linear-gradient(135deg, #0b5a0b 0%, #16a34a 100%); }
.ef-store-emblem--playstation { background: linear-gradient(135deg, #002366 0%, #0057d9 100%); }
.ef-store-emblem--nintendo { background: linear-gradient(135deg, #b8000e 0%, #e60012 100%); }

.ef-store-body {
    flex: 1;
    min-width: 0;
    padding: 16px 20px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 8px;
}

.ef-store-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    font-weight: 700;
    color: var(--ef-accent);
}

.ef-store-badge svg {
    width: 15px;
    height: 15px;
}

.ef-store-title {
    font-size: 16px;
    font-weight: 700;
    line-height: 1.35;
    color: var(--ef-text);
    word-break: break-word;
}

.ef-store-desc {
    font-size: 13px;
    line-height: 1.5;
    color: var(--ef-muted);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.ef-store-actions {
    margin-top: 4px;
}

@media (max-width: 600px) {
    .ef-store-card {
        flex-direction: column;
    }

    .ef-store-media {
        width: 100%;
        height: 165px;
        min-height: 165px;
    }

    .ef-store-body {
        padding: 14px 16px;
    }
}
