/* Event User Content Styles */
.em-event-user-content {
    margin: 2rem 0;
    padding: 1.5rem;
    border: 1px solid #ddd;
    border-radius: 8px;
    background: #f9f9f9;
}

.em-event-user-content h3 {
    margin-top: 0;
    color: #333;
    border-bottom: 2px solid #0073aa;
    padding-bottom: 0.5rem;
}

.em-event-user-content h4 {
    color: #555;
    margin: 1.5rem 0 1rem 0;
}

/* Upload Area */
.em-image-upload-area {
    margin-bottom: 2rem;
}

.em-upload-dropzone {
    border: 2px dashed #ccc;
    border-radius: 8px;
    padding: 2rem;
    text-align: center;
    background: #fff;
    transition: all 0.3s ease;
    cursor: pointer;
}

.em-upload-dropzone:hover,
.em-upload-dropzone.em-dragover {
    border-color: #0073aa;
    background: #f0f8ff;
}

.em-upload-dropzone p {
    margin: 0.5rem 0;
    color: #666;
}

.em-upload-info {
    font-size: 0.9em;
    color: #999;
}

.em-progress-bar {
    width: 100%;
    height: 20px;
    background: #f0f0f0;
    border-radius: 10px;
    overflow: hidden;
    margin: 1rem 0;
}

.em-progress-fill {
    height: 100%;
    background: #0073aa;
    width: 0%;
    transition: width 0.3s ease;
    animation: progress-animation 1.5s infinite;
}

@keyframes progress-animation {
    0% { background-position: 0 0; }
    100% { background-position: 30px 0; }
}

/* Comment Form */
.em-comment-form {
    margin-bottom: 2rem;
}

.em-comment-form textarea {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid #ddd;
    border-radius: 4px;
    resize: vertical;
    font-family: inherit;
}

.em-comment-form button {
    margin-top: 0.5rem;
}

/* Images Grid */
.em-images-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 1rem;
    margin: 1rem 0;
}

.em-image-item {
    position: relative;
    background: #fff;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    transition: transform 0.2s ease;
}

.em-image-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.em-image-item img {
    width: 100%;
    height: 200px;
    object-fit: cover;
    display: block;
}

.em-image-meta {
    padding: 0.75rem;
    background: #fff;
}

.em-image-author {
    font-weight: bold;
    color: #333;
    display: block;
}

.em-image-date {
    font-size: 0.9em;
    color: #666;
    display: block;
    margin-top: 0.25rem;
}

.em-delete-image {
    background: #dc3545;
    color: white;
    border: none;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-size: 0.8em;
    cursor: pointer;
    margin-top: 0.5rem;
    transition: background 0.2s ease;
}

.em-delete-image:hover {
    background: #c82333;
}

/* Comments */
.em-comment-item {
    background: #fff;
    padding: 1rem;
    margin-bottom: 1rem;
    border-radius: 8px;
    border-left: 4px solid #0073aa;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.em-comment-meta {
    margin-bottom: 0.5rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid #eee;
}

.em-comment-meta strong {
    color: #333;
}

.em-comment-date {
    color: #666;
    font-size: 0.9em;
    margin-left: 1rem;
}

.em-comment-content {
    color: #555;
    line-height: 1.6;
}

/* Notice Messages */
.em-user-content-notice {
    background: #fff3cd;
    border: 1px solid #ffeaa7;
    color: #856404;
    padding: 1rem;
    border-radius: 4px;
    margin: 1rem 0;
}

/* Responsive Design */
@media (max-width: 768px) {
    .em-images-grid {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
        gap: 0.75rem;
    }
    
    .em-image-item img {
        height: 150px;
    }
    
    .em-event-user-content {
        padding: 1rem;
    }
    
    .em-upload-dropzone {
        padding: 1.5rem 1rem;
    }
}

@media (max-width: 480px) {
    .em-images-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .em-comment-date {
        display: block;
        margin-left: 0;
        margin-top: 0.25rem;
    }
}

/* Photo links work with keyboard, touch, and without JavaScript. */
.em-photo-link {
    display: block;
    cursor: zoom-in;
}

.em-photo-link:focus-visible {
    outline: 3px solid #0b5f8d;
    outline-offset: -3px;
}

/* Native dialog occupies the viewport's top layer above theme overlays. */
dialog.em-image-modal {
    position: fixed;
    inset: 0;
    width: 100vw;
    height: 100vh;
    height: 100dvh;
    max-width: none;
    max-height: none;
    margin: 0;
    padding: 0;
    border: 0;
    box-sizing: border-box;
    color: #fff;
    background: rgba(0, 0, 0, 0.94);
    overflow: hidden;
}

dialog.em-image-modal::backdrop {
    background: #000;
}

.em-image-modal .em-modal-content {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    box-sizing: border-box;
    padding: calc(56px + env(safe-area-inset-top, 0px))
        calc(12px + env(safe-area-inset-right, 0px))
        calc(12px + env(safe-area-inset-bottom, 0px))
        calc(12px + env(safe-area-inset-left, 0px));
}

.em-image-modal .em-modal-content img {
    display: block;
    width: auto;
    height: auto;
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

.em-image-modal .em-modal-close {
    position: absolute;
    top: calc(6px + env(safe-area-inset-top, 0px));
    right: calc(6px + env(safe-area-inset-right, 0px));
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    padding: 0;
    border: 1px solid #fff;
    border-radius: 50%;
    color: #fff;
    background: #222;
    font: 30px/1 sans-serif;
    cursor: pointer;
}

.em-image-modal .em-modal-close:focus-visible {
    outline: 3px solid #fff;
    outline-offset: 3px;
}

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