/**
 * Post Media Styles
 * CSS for handling post media uploads and displays
 */

/* Hidden file inputs */
.hidden-upload {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border-width: 0;
}

/* Media Thumbnails Bar */
.media-thumbnails-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin: 10px 0;
    padding: 10px;
    background-color: #f9f9f9;
    border-radius: 8px;
    border: 1px solid #eaeaea;
}

.media-thumbnail {
    position: relative;
    width: 80px;
    height: 80px;
    border-radius: 6px;
    overflow: hidden;
    border: 1px solid #ddd;
}

.media-thumbnail img, 
.media-thumbnail video {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.media-thumbnail .btn-remove-thumbnail {
    position: absolute;
    top: 2px;
    right: 2px;
    background: rgba(0,0,0,0.6);
    color: white;
    border: none;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
    cursor: pointer;
    padding: 0;
    line-height: 1;
}

.media-thumbnail .media-type-icon {
    position: absolute;
    bottom: 2px;
    left: 2px;
    background: rgba(0,0,0,0.6);
    color: white;
    border-radius: 4px;
    padding: 2px 4px;
    font-size: 10px;
}

/* Media Preview in Post Create Form */
.media-preview {
    position: relative;
    margin: 10px 0;
    border-radius: 8px;
    overflow: hidden;
    background-color: #f5f5f5;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.preview-content {
    max-height: 300px;
    overflow: hidden;
    display: flex;
    justify-content: center;
    align-items: center;
}

.preview-image {
    max-width: 100%;
    max-height: 300px;
    object-fit: contain;
}

.preview-video {
    max-width: 100%;
    max-height: 300px;
}

.btn-remove-media {
    background-color: rgba(0,0,0,0.5);
    color: white;
    border: none;
    padding: 3px 8px;
    border-radius: 4px;
    position: absolute;
    top: 10px;
    right: 10px;
    cursor: pointer;
    font-size: 12px;
    z-index: 2;
}

/* Location Badge */
.location-display {
    margin: 10px 0;
}

.location-badge {
    display: inline-flex;
    align-items: center;
    background-color: #f0f8ff;
    border-radius: 16px;
    padding: 4px 10px;
    font-size: 14px;
    margin-bottom: 10px;
    border: 1px solid #d0e0f0;
}

.location-icon {
    margin-right: 5px;
}

.btn-remove-location {
    background: none;
    border: none;
    color: #666;
    cursor: pointer;
    margin-left: 8px;
    padding: 0 5px;
    font-size: 12px;
}

/* Media Display in Post Cards */
.post-card .post-media {
    margin: 10px 0;
    border-radius: 8px;
    overflow: hidden;
    max-height: 400px;
    display: flex;
    justify-content: center;
}

.post-card .post-image img {
    width: 100%;
    object-fit: cover;
    max-height: 400px;
    cursor: pointer;
}

.post-card .post-video video {
    width: 100%;
    max-height: 400px;
}

.post-card .post-location {
    margin-top: 8px;
    font-size: 14px;
    color: #666;
    display: flex;
    align-items: center;
}

.post-card .location-icon {
    margin-right: 5px;
}

/* Image Modal */
.image-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.9);
    z-index: 1000;
    justify-content: center;
    align-items: center;
}

.image-modal img {
    max-width: 90%;
    max-height: 90%;
}

.image-modal .close-button {
    position: absolute;
    top: 20px;
    right: 20px;
    color: white;
    font-size: 30px;
    cursor: pointer;
}

/* Media grid for posts with multiple media */
.media-grid {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin: 10px 0;
}

.media-grid-item {
    border-radius: 8px;
    overflow: hidden;
}
