/**
 * FM Content Blocker Stylesheet (Zwei-Klick-Lösung / DSGVO)
 *
 * @package FM_Core_Enhancements
 * @version 1.3.0
 */

.fm-embed-placeholder {
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    width: 100%;
    aspect-ratio: var(--fm-aspect-ratio, 16 / 9);
    min-height: 280px;
    margin: 28px 0;
    padding: 24px;
    background: linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
    border: 1px solid #334155;
    border-radius: 12px;
    box-shadow: 0 10px 25px -5px rgba(15, 23, 42, 0.25), 0 8px 10px -6px rgba(15, 23, 42, 0.2);
    box-sizing: border-box;
    overflow: hidden;
    color: #f8fafc;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
    clear: both;
}

/* Subtle background pattern */
.fm-embed-placeholder .fm-embed-backdrop {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image: radial-gradient(circle at 50% 30%, rgba(255, 255, 255, 0.04) 0%, transparent 70%);
    pointer-events: none;
}

.fm-embed-placeholder .fm-embed-card {
    position: relative;
    z-index: 2;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    max-width: 580px;
    width: 100%;
    margin: auto;
}

/* Header with Badge & Privacy Tag */
.fm-embed-placeholder .fm-embed-header {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 16px;
}

.fm-embed-placeholder .fm-embed-badge {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 6px 12px;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 9999px;
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 0.02em;
    color: #ffffff;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
}

.fm-embed-placeholder .fm-embed-badge-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: var(--badge-color, #ef4444);
}

.fm-embed-placeholder .fm-embed-badge-icon svg {
    width: 18px;
    height: 18px;
}

.fm-embed-placeholder .fm-embed-privacy-tag {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 11.5px;
    font-weight: 600;
    color: #34d399; /* Emerald 400 */
    background: rgba(16, 185, 129, 0.12);
    border: 1px solid rgba(16, 185, 129, 0.25);
    padding: 4px 10px;
    border-radius: 9999px;
}

/* Body / Text */
.fm-embed-placeholder .fm-embed-body {
    margin-bottom: 18px;
}

.fm-embed-placeholder .fm-embed-title {
    font-size: 18px;
    font-weight: 700;
    color: #ffffff;
    margin: 0 0 8px 0;
    line-height: 1.35;
    letter-spacing: -0.01em;
}

.fm-embed-placeholder .fm-embed-desc {
    font-size: 13.5px;
    line-height: 1.6;
    color: #cbd5e1; /* Slate 300 */
    margin: 0;
}

.fm-embed-placeholder .fm-embed-desc strong {
    color: #ffffff;
}

.fm-embed-placeholder .fm-embed-policy-link {
    display: block;
    margin-top: 6px;
    font-size: 12px;
    color: #38bdf8; /* Sky 400 */
    text-decoration: underline;
    text-underline-offset: 3px;
    transition: color 0.15s ease;
}

.fm-embed-placeholder .fm-embed-policy-link:hover {
    color: #7dd3fc;
}

/* Footer / Action Button & Remember */
.fm-embed-placeholder .fm-embed-footer {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    width: 100%;
}

.fm-embed-placeholder .fm-embed-unlock-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 24px;
    background: #ffffff;
    color: #0f172a;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3), 0 1px 2px rgba(0, 0, 0, 0.2);
    transition: all 0.18s cubic-bezier(0.16, 1, 0.3, 1);
}

.fm-embed-placeholder .fm-embed-unlock-btn:hover {
    background: #f1f5f9;
    color: #0284c7;
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.4);
}

.fm-embed-placeholder .fm-embed-unlock-btn:active {
    transform: translateY(0);
}

.fm-embed-placeholder .fm-embed-unlock-btn:focus-visible {
    outline: 3px solid #38bdf8;
    outline-offset: 2px;
}

.fm-embed-placeholder .fm-embed-btn-icon {
    flex-shrink: 0;
    transition: transform 0.15s ease;
}

.fm-embed-placeholder .fm-embed-unlock-btn:hover .fm-embed-btn-icon {
    transform: scale(1.15);
}

.fm-embed-placeholder .fm-embed-remember-label {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    color: #94a3b8;
    cursor: pointer;
    user-select: none;
}

.fm-embed-placeholder .fm-embed-remember-chk {
    width: 15px;
    height: 15px;
    cursor: pointer;
    accent-color: #0284c7;
    margin: 0;
}

/* Fallback for noscript */
.fm-embed-placeholder .fm-embed-noscript {
    margin-top: 15px;
    padding: 10px 14px;
    background: rgba(239, 68, 68, 0.15);
    border: 1px solid rgba(239, 68, 68, 0.3);
    border-radius: 6px;
    font-size: 12px;
    color: #fca5a5;
}

/* Restored / Injected Iframe */
iframe.fm-embed-unlocked {
    display: block;
    width: 100% !important;
    max-width: 100% !important;
    border: none;
    border-radius: 8px;
    margin: 20px 0;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.1);
    animation: fmFadeIn 0.35s ease-out forwards;
}

@keyframes fmFadeIn {
    from {
        opacity: 0;
        transform: scale(0.98);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* Gutenberg embed wrappers compatibility */
.wp-block-embed .fm-embed-placeholder {
    margin: 0;
}

/* Mobile Responsiveness */
@media (max-width: 640px) {
    .fm-embed-placeholder {
        padding: 18px 14px;
        min-height: 240px;
        margin: 20px 0;
        border-radius: 10px;
    }
    .fm-embed-placeholder .fm-embed-title {
        font-size: 15px;
    }
    .fm-embed-placeholder .fm-embed-desc {
        font-size: 12px;
    }
    .fm-embed-placeholder .fm-embed-unlock-btn {
        width: 100%;
        padding: 9px 16px;
        font-size: 13px;
    }
    .fm-embed-placeholder .fm-embed-header {
        margin-bottom: 12px;
    }
}
