/*
================================================================================
=== VIDEO MODAL STYLES (LOGISCH ÜBERARBEITET) ==================================
================================================================================
*/

body.ruwac-modal-open { overflow: hidden; }

/* 1. Haupt-Modal & Overlay (Unverändert) */
.ruwac-video-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 99999;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.4s ease, visibility 0s linear 0.4s;
    padding: 20px;
    box-sizing: border-box;
}
.ruwac-video-modal:not(.is-open) { display: none; }
.ruwac-video-modal.is-open {
    opacity: 1;
    visibility: visible;
    transition-delay: 0s;
}
.ruwac-video-modal__overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(30, 30, 30, 0.5);
}

/* 2. Content-Container (Flexibel für beide Zustände) */
.ruwac-video-modal__content {
    position: relative;
    z-index: 10;
    width: 90%;
    max-width: 850px;
    border-radius: 8px; /* Radius wird an die Kinder vererbt */
    transition: transform 0.4s ease, opacity 0.3s ease, background-color 0.3s ease, padding 0.3s ease;
    opacity: 0;
    transform: translateY(50px) scale(0.98);
    
    /* Zustand 1: Platzhalter ist sichtbar (Standard) */
    background-color: #ffffff;
    padding: 40px 25px; /* Symmetrisches Padding */
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.2);
    color: #333333;
}
.ruwac-video-modal.is-open .ruwac-video-modal__content {
    opacity: 1;
    transform: translateY(0) scale(1);
}

/* Zustand 2: Video ist aktiv */
.ruwac-video-modal__content.video-is-active {
    background-color: transparent; /* Wichtig: Kein eigener Hintergrund mehr */
    padding: 0; /* Wichtig: Kein Padding, das den "weißen Rahmen" erzeugt */
    box-shadow: none; /* Schatten ist nicht mehr nötig */
    overflow: hidden; /* Stellt sicher, dass der Radius auf das Video wirkt */
}

/* 3. Schließen-Button (Angepasst für beide Zustände) */
.ruwac-video-modal__close-btn {
    position: absolute;
    top: -40px;  /* Positioniert außerhalb des Inhalts für saubere Optik */
    right: -40px;
    color: #ffffff; /* Immer weiß, da auf dem dunklen Overlay */
    width: 36px;
    height: 36px;
    font-size: 32px;
    transition: all 0.2s ease;
    z-index: 11;
    cursor: pointer;
    border: none;
    background: none;
    line-height: 1;
    opacity: 0.8;
}
.ruwac-video-modal__close-btn:hover {
    opacity: 1;
    transform: rotate(90deg);
}
@media (max-width: 950px) { /* Button bei kleineren Screens wieder nach innen holen */
    .ruwac-video-modal__close-btn {
        top: 15px;
        right: 15px;
        color: #555555; /* Farbe für innen */
    }
    .ruwac-video-modal__content.video-is-active .ruwac-video-modal__close-btn {
        color: #ffffff; /* Farbe für innen, wenn Video aktiv ist */
    }
}


/* 4. Platzhalter (NEU mit Flexbox für perfekte Zentrierung) */
.ruwac-video-modal__two-click-placeholder {
    display: flex; /* Flexbox für Zentrierung! */
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 1rem; /* Gleichmäßiger Abstand zwischen den Elementen */
    text-align: center;
}
.ruwac-video-modal__content.video-is-active .ruwac-video-modal__two-click-placeholder {
    display: none; /* Platzhalter ausblenden, wenn Video aktiv ist */
}
.ruwac-video-modal__two-click-placeholder p,
.ruwac-video-modal__two-click-placeholder small {
    margin: 0; /* Wichtig: Browser-Standard-Abstände entfernen */
    max-width: 500px; /* Verhindert zu breite Textzeilen */
}
.ruwac-video-modal__two-click-placeholder p { color: #333333; }
.ruwac-video-modal__two-click-placeholder small { color: #6c757d; }


/* 5. Button-Styling (Unverändert, funktioniert jetzt korrekt) */
.ruwac-scl-cta {
    margin-top: 1rem; /* Etwas mehr Abstand nach oben */
    display: inline-block;
    border-radius: 50px;
    padding: 12px 30px;
    font-size: clamp(0.9rem, 1.5vw, 1rem);
    font-weight: 600;
    text-decoration: none !important;
    transition: all 0.3s ease;
    cursor: pointer;
    border: 2px solid transparent;
}
.ruwac-scl-cta--primary {
    background-color: var(--primary-color);
    color: #ffffff;
    border-color: var(--primary-color);
}
.ruwac-scl-cta--primary:hover {
    background-color: #ffffff;
    color: var(--primary-color);
    border-color: var(--primary-color);
    transform: translateY(-2px);
}

/* 6. Video-Wrapper (Wird nur im aktiven Zustand angezeigt) */
.ruwac-video-modal__video-wrapper {
    display: none; /* Standardmäßig ausgeblendet */
    position: relative;
    padding-bottom: 56.25%; /* 16:9 */
    height: 0;
    background-color: #000;
    border-radius: 8px; /* Eigener Radius, da Container transparent ist */
    overflow: hidden; /* Wichtig, damit iframe die Ecken annimmt */
}
.ruwac-video-modal__content.video-is-active .ruwac-video-modal__video-wrapper {
    display: block; /* Wrapper anzeigen, wenn Video aktiv ist */
}
.ruwac-video-modal__video-wrapper iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: 0;
}