/**
 * Display Styles - Empfänger-Ansicht.
 * Update v5.0.0: Audio-Toggle im Header
 * Update v5.5.3: Native Bildbreite für Bild-E-Cards
 * Update v5.6.14: Max-width 600px, Buttons außerhalb der E-Card
 *
 * @package FourSystem_ECards
 */

/* Update v5.6.14: Wrapper für gesamte Anzeige inkl. Buttons */
.fsec-display-wrapper {
    max-width: 600px;
    margin: 0 auto;
}

/* Container - nur die E-Card selbst */
.fsec-display {
    max-width: 600px;
    margin: 0 auto;
    /* border-radius wird per Inline-Style gesetzt */
}

/* Update v5.5.3: Bild-E-Cards mit nativer Breite zentrieren */
.fsec-display-image {
    margin: 0 auto;
}

/* Videos behalten die max-width */
.fsec-display-video {
    max-width: 600px;
}

.fsec-display-content {
    display: flex;
    flex-direction: column;
    gap: 0; /* Update v5.6.14: Kein Gap mehr */
}

/* Media */
.fsec-display-media {
    overflow: hidden;
    position: relative;
    /* Update v5.6.14: Border-Radius nur oben, wird per CSS Variable gesetzt */
    border-radius: var(--fsec-border-radius, 8px) var(--fsec-border-radius, 8px) 0 0;
}

.fsec-display-media img {
    width: 100%;
    height: auto;
    display: block;
}

/* Video */
.fsec-video-wrap {
    position: relative;
    width: 100%;
    padding-bottom: 56.25%; /* 16:9 */
}

.fsec-video-wrap iframe,
.fsec-video-wrap video {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

.fsec-video-mp4 video {
    background: #000;
}

/* Update v5.7.8: Bildnachweis unter dem Bild */
.fsec-display-credits {
    padding: 4px 8px;
    font-size: 10px;
    line-height: 1.4;
    color: #999;
    text-align: left;
}

.fsec-display-credits a {
    color: #777;
    text-decoration: none;
}

.fsec-display-credits a:hover {
    color: #333;
    text-decoration: underline;
}

/* Nachricht */
.fsec-display-message {
    /* Update v5.6.14: Border-Radius nur unten */
    border-radius: 0 0 var(--fsec-border-radius, 8px) var(--fsec-border-radius, 8px);
}

/* Update v5.0.0: Header mit Toggle-Button */
.fsec-message-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    font-size: 14px;
    color: #646970;
}

.fsec-sender-info {
    display: flex;
    align-items: center;
    gap: 5px;
}

.fsec-from-label {
    color: #646970;
}

.fsec-from-name {
    font-weight: 600;
    color: #1d2327;
}

/* Update v5.0.0: Audio-Toggle Button im Header */
.fsec-audio-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    padding: 0;
    border: none;
    border-radius: 50%;
    background: #f0f0f1;
    color: #1d2327;
    cursor: pointer;
    transition: background 0.2s ease, color 0.2s ease, transform 0.2s ease;
}

.fsec-audio-toggle:hover {
    background: #2271b1;
    color: #fff;
    transform: scale(1.1);
}

.fsec-audio-toggle svg {
    width: 20px;
    height: 20px;
}

.fsec-message-body {
    font-size: 16px;
    line-height: 1.7;
    color: #1d2327;
}

.fsec-message-body p {
    margin: 0 0 15px 0;
}

.fsec-message-body p:last-child {
    margin-bottom: 0;
}

/* Update v5.6.14: Buttons AUSSERHALB der E-Card, mittig */
.fsec-display-actions {
    display: flex;
    gap: 15px;
    margin-top: 25px;
    justify-content: center;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

.fsec-display .fsec-btn {
    padding: 12px 30px;
    border: none;
    border-radius: 4px;
    font-size: 15px;
    font-weight: 500;
    cursor: pointer;
    text-decoration: none;
    transition: background 0.2s, transform 0.2s;
}

.fsec-display .fsec-btn-primary {
    background: #2271b1;
    color: #fff;
}

.fsec-display .fsec-btn-primary:hover {
    background: #135e96;
    transform: translateY(-1px);
}

.fsec-display .fsec-btn-secondary {
    background: #f6f7f7;
    color: #2271b1;
    border: 1px solid #2271b1;
}

.fsec-display .fsec-btn-secondary:hover {
    background: #f0f0f1;
}

/* Preview Banner */
.fsec-preview-banner {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #dba617;
    color: #fff;
    padding: 10px 15px;
    margin: -20px -20px 20px -20px;
    border-radius: var(--fsec-border-radius, 8px) var(--fsec-border-radius, 8px) 0 0;
}

.fsec-preview-label {
    font-weight: 600;
}

.fsec-btn-small {
    padding: 6px 12px;
    font-size: 12px;
    background: rgba(255,255,255,0.2);
    border: 1px solid rgba(255,255,255,0.4);
    color: #fff;
    border-radius: 4px;
    cursor: pointer;
}

.fsec-btn-small:hover {
    background: rgba(255,255,255,0.3);
}

/* Error State */
.fsec-display-error {
    text-align: center;
    padding: 60px 30px;
}

.fsec-error-icon {
    font-size: 48px;
    margin-bottom: 20px;
}

.fsec-error-message {
    font-size: 18px;
    color: #646970;
    margin-bottom: 25px;
}

/* No Image Placeholder */
.fsec-no-image {
    background: #f0f0f1;
    padding: 60px;
    text-align: center;
}

.fsec-no-image .dashicons {
    font-size: 64px;
    width: 64px;
    height: 64px;
    color: #c3c4c7;
}

/* === Audio-Overlay für Mobile/Autoplay-Blockierung === */

.fsec-audio-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 10;
    transition: opacity 0.3s ease;
}

.fsec-audio-overlay.foursys-hiding {
    opacity: 0;
}

.fsec-audio-play-overlay {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    padding: 30px 50px;
    background: rgba(255, 255, 255, 0.95);
    border: none;
    border-radius: 12px;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.fsec-audio-play-overlay:hover {
    transform: scale(1.05);
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.2);
}

.fsec-play-icon {
    font-size: 48px;
    color: #2271b1;
}

.fsec-play-text {
    font-size: 16px;
    font-weight: 500;
    color: #1d2327;
}

/* Mobile */
@media (max-width: 768px) {
    .fsec-display {
        margin: 10px;
        max-width: calc(100% - 20px);
    }
    
    .fsec-display-actions {
        flex-direction: column;
        padding: 0 10px;
    }
    
    .fsec-display .fsec-btn {
        width: 100%;
        text-align: center;
    }
    
    .fsec-audio-play-overlay {
        padding: 25px 40px;
    }
    
    .fsec-play-icon {
        font-size: 40px;
    }
    
    .fsec-audio-toggle {
        width: 32px;
        height: 32px;
    }
    
    .fsec-audio-toggle svg {
        width: 18px;
        height: 18px;
    }
}
