/* United We Rise - Posts and Feed Styles */

/* ========================================
   POSTS CONTAINER
======================================== */

.posts-container {
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    position: fixed;
    top: 6.5vh; /* 6.5% from top of screen */
    bottom: 0.5vh; /* 0.5% from bottom of screen */
    left: 3vw; /* Account for sidebar */
    right: 26%; /* Account for map area */
    margin: 0 1rem; /* Side margins */
    display: flex;
    flex-direction: column;
    z-index: 1;
}

/* ========================================
   POST COMPOSER
======================================== */

.post-composer {
    padding: 1rem;
    border-bottom: 1px solid #eee;
}

.post-composer textarea {
    width: 100%;
    min-height: 80px;
    border: 1px solid #ddd;
    border-radius: 4px;
    padding: 0.75rem;
    resize: vertical;
    box-sizing: border-box;
}

.post-composer-actions {
    margin-top: 0.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.post-composer-actions .btn {
    width: auto;
    padding: 0.5rem 1rem;
}

/* ========================================
   MEDIA UPLOAD & PREVIEW
======================================== */

.media-actions {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.media-btn {
    background: #f5f5f5;
    border: 1px solid #ddd;
    padding: 0.5rem 0.75rem;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.9rem;
    color: #555;
    transition: all 0.2s;
}

.media-btn:hover {
    background: #e9e9e9;
    border-color: #bbb;
}

.media-preview-area {
    background: #f9f9f9;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 1rem;
    margin: 0.75rem 0;
    position: relative;
}

.media-preview-content .media-item {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.media-preview-content .media-info {
    flex-grow: 1;
}

.media-preview-content .media-info p {
    margin: 0.25rem 0;
    color: #666;
    font-size: 0.9rem;
}

.media-preview-content .media-info p:first-child {
    color: #333;
    font-weight: 500;
}

.remove-media-btn {
    position: absolute;
    top: 0.5rem;
    right: 0.5rem;
    background: #f44336;
    color: white;
    border: none;
    border-radius: 50%;
    width: 24px;
    height: 24px;
    cursor: pointer;
    font-size: 0.8rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
}

.remove-media-btn:hover {
    background: #d32f2f;
}

/* ========================================
   POSTS FEED
======================================== */

.posts-feed {
    flex-grow: 1; /* Take up remaining space in posts-container */
    overflow-y: auto;
    padding: 1rem;
    box-sizing: border-box;
}

.feed-header {
    background: linear-gradient(135deg, #4b5c09 0%, #6b7f1a 100%);
    color: white;
    padding: 1.5rem;
    margin-bottom: 1rem;
    border-radius: 8px;
}

.feed-header h2 {
    margin: 0 0 0.5rem 0;
    font-size: 1.5rem;
}

.feed-header p {
    margin: 0;
    opacity: 0.9;
}

/* ========================================
   POST ITEMS
======================================== */

.post-item {
    padding: 1rem;
    border-bottom: 1px solid #eee;
}

.post-item:last-child {
    border-bottom: none;
}

.post-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 0.5rem;
}

.post-content {
    margin-bottom: 0.75rem;
    line-height: 1.4;
}

.post-actions {
    display: flex;
    gap: 1rem;
    font-size: 0.9rem;
    color: #666;
}

.post-action {
    cursor: pointer;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    transition: background 0.2s;
}

.post-action:hover {
    background: #f0f0f0;
}

.post-action.liked {
    color: #d32f2f;
}

/* ========================================
   POST MEDIA ATTACHMENTS
======================================== */

.post-media {
    margin: 0.75rem 0;
}

.post-media-item {
    position: relative;
    margin-bottom: 0.5rem;
}

.post-media-item:last-child {
    margin-bottom: 0;
}

.post-media-item img {
    display: block;
    max-width: 100%;
    height: auto;
    border-radius: 8px;
    cursor: pointer;
    transition: opacity 0.2s;
}

.post-media-item img:hover {
    opacity: 0.9;
}

.media-type-badge {
    position: absolute;
    top: 8px;
    right: 8px;
    background: rgba(0, 0, 0, 0.7);
    color: white;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 0.7rem;
    font-weight: bold;
    pointer-events: none;
}

.gif-badge {
    background: #ff9800;
}

/* ========================================
   MEDIA VIEWER OVERLAY
======================================== */

.media-viewer-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.9);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    cursor: pointer;
}

.media-viewer-content {
    position: relative;
    cursor: default;
}

.media-viewer-close {
    position: absolute;
    top: -40px;
    right: 0;
    background: none;
    border: none;
    color: white;
    font-size: 2rem;
    cursor: pointer;
    padding: 8px;
    line-height: 1;
}

.media-viewer-close:hover {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
}

.media-viewer-badge {
    position: absolute;
    bottom: 16px;
    right: 16px;
    background: #ff9800;
    color: white;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 0.8rem;
    font-weight: bold;
}

/* ========================================
   PHOTO CAPTIONS IN GALLERY
======================================== */

.photo-caption {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(transparent, rgba(0, 0, 0, 0.8));
    color: white;
    padding: 1rem 0.5rem 0.5rem;
    font-size: 0.8rem;
    line-height: 1.2;
    max-height: 40px;
    overflow: hidden;
    text-overflow: ellipsis;
    word-wrap: break-word;
}

.photo-item {
    position: relative;
}

.photo-item:hover .photo-caption {
    max-height: none;
    overflow: visible;
    background: rgba(0, 0, 0, 0.9);
    z-index: 10;
}