/* Urban Legends Submission - Media Display Styles (Simplified) */

.uls-submission-media {
    margin: 30px 0;
    width: 100%;
}

.uls-media-item {
    margin-bottom: 30px;
    width: 100%;
    text-align: center; /* 画像・動画を中央配置するため */
}

.uls-media-item:last-child {
    margin-bottom: 0;
}

/* Image Styles */
.uls-submission-image {
    max-width: 100%;
    max-height: 70vh; /* 画面の高さの70%以内に制限 */
    width: auto;
    height: auto;
    border: 1px solid #444;
    border-radius: 0.5rem;
    cursor: pointer;
    display: block;
    margin: 0 auto; /* 中央配置 */
    object-fit: contain; /* アスペクト比を保持 */
}

/* Video Styles */
.uls-submission-video {
    max-width: 100%;
    max-height: 70vh; /* 画面の高さの70%以内に制限 */
    width: auto;
    height: auto;
    border: 1px solid #444;
    border-radius: 0.5rem;
    background: #000;
    display: block;
    margin: 0 auto; /* 中央配置 */
    object-fit: contain; /* アスペクト比を保持 */
}

.uls-submission-video:focus {
    outline: none;
}

/* Media Container */
.uls-image + .uls-video {
    margin-top: 30px;
}

/* Mobile specific adjustments for vertical media */
@media (max-width: 768px) {
    .uls-submission-media {
        margin: 20px 0;
    }

    .uls-media-item {
        margin-bottom: 20px;
    }

    /* モバイルでは画面の高さの60%に制限 */
    .uls-submission-image,
    .uls-submission-video {
        max-height: 60vh;
    }
}

/* Fallback message styling */
.uls-submission-video p {
    color: #888;
    font-style: italic;
    margin: 15px 0;
    text-align: center;
    padding: 15px;
    background: rgba(68, 68, 68, 0.2);
    border-radius: 0.5rem;
    border: 1px solid #444;
}

.uls-submission-video a {
    color: #ccc;
    text-decoration: underline;
}

/* Loading state */
.uls-media-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 200px;
    background: rgba(68, 68, 68, 0.1);
    border-radius: 0.5rem;
    border: 1px solid #444;
}

.uls-media-loading::after {
    content: "読み込み中...";
    color: #888;
}

/* Error state */
.uls-media-error {
    background: rgba(68, 68, 68, 0.2);
    color: #aaa;
    padding: 20px;
    border-radius: 0.5rem;
    text-align: center;
    border: 1px solid #444;
}

/* Media meta info */
.uls-media-info {
    font-size: 0.85em;
    color: #666;
    margin-top: 12px;
    text-align: center;
    padding: 8px 15px;
    background: rgba(68, 68, 68, 0.1);
    border-radius: 0.5rem;
    border: 1px solid #444;
    display: inline-block;
}

/* Lightbox styles for images */
.uls-image-lightbox {
    display: none;
    position: fixed;
    z-index: 10000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.9);
    cursor: pointer;
}

.uls-image-lightbox img {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    max-width: 90%;
    max-height: 90%;
    border: 1px solid #444;
}

.uls-image-lightbox .close {
    position: absolute;
    top: 30px;
    right: 40px;
    color: #ccc;
    font-size: 40px;
    font-weight: bold;
    cursor: pointer;
    z-index: 10001;
}

