/**
 * DreamNoos Dynamic Image Styles
 * Styling for dynamically loaded dream images
 */

/* Image Container */
[data-dream-keyword] {
    min-height: 220px;
    border-radius: 12px;
    overflow: hidden;
    position: relative;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

[data-dream-keyword]:hover {
    transform: translateY(-5px);
    box-shadow: 0 12px 24px rgba(0,0,0,0.2);
}

/* Real Image Styling */
.dream-image {
    width: 100%;
    height: auto;
    object-fit: cover;
    border-radius: 12px;
}

/* Video Overlay */
.video-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
}

[data-dream-keyword]:hover .video-overlay {
    opacity: 1;
}

.video-play-btn {
    background: rgba(255, 255, 255, 0.95);
    color: #667eea;
    border: none;
    padding: 1rem 2rem;
    border-radius: 50px;
    font-weight: 600;
    box-shadow: 0 4px 12px rgba(0,0,0,0.3);
    transition: transform 0.3s ease;
}

.video-play-btn:hover {
    transform: scale(1.05);
    background: white;
}

/* Video Modal */
.dream-video-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-backdrop {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.8);
}

.modal-content {
    position: relative;
    max-width: 90%;
    max-height: 90vh;
    background: white;
    border-radius: 12px;
    padding: 2rem;
}

.modal-content .btn-close {
    position: absolute;
    top: 10px;
    right: 10px;
    background: rgba(0, 0, 0, 0.5);
    color: white;
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-content video {
    width: 100%;
    max-height: 80vh;
    border-radius: 8px;
}

/* Loading State */
.dream-image-loading {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: loading 1.5s infinite;
}

@keyframes loading {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* Video Container (embed video below image) */
.dream-video-container {
    background: #f8f9fa;
    padding: 1.5rem;
    border-radius: 12px;
    border: 1px solid #dee2e6;
}

.dream-video-container video {
    width: 100%;
    max-height: 500px;
    border-radius: 8px;
}

.dream-video-container p {
    margin-bottom: 0;
    text-align: center;
}

/* YouTube/External Video Embed */
.dream-video-embed {
    position: relative;
    padding-bottom: 56.25%; /* 16:9 aspect ratio */
    height: 0;
    overflow: hidden;
    border-radius: 12px;
    margin-top: 1rem;
}

.dream-video-embed iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border-radius: 8px;
}

/* Responsive */
@media (max-width: 768px) {
    .video-play-btn {
        padding: 0.75rem 1.5rem;
        font-size: 0.9rem;
    }
    
    .dream-video-container {
        padding: 1rem;
    }
    
    .dream-video-container video {
        max-height: 300px;
    }
    
    .modal-content {
        max-width: 95%;
        padding: 1rem;
    }
    
    .modal-content video {
        max-height: 50vh;
    }
}

