/* Mobile-First Card System (US-VIEW-001) */
/* This file will contain more specific styles for the card layout, swipe animations etc. */
/* For now, basic structure is in style.css */

.post-stream {
    /* Styles for the stream container if needed */
}

/* Individual Post Card - further enhancements */
.post-card {
    /* Add specific card styles here if they differ from the general .post-card in style.css */
    /* Example: for swipe interactions, you might add transition properties */
    transition: transform 0.3s ease-out;
    max-height: 80vh;
    overflow-y: auto;
}

/* This targets the container for the stream of post cards */
#post-stream {
    display: flex;
    transition: transform 0.3s ease-in-out;
}

/* This is the container that enables the swiping behavior */
#card-swiper-container {
    overflow: hidden;
    position: relative;
    width: 100%;
    max-width: 700px; /* Or your desired max width */
    margin: 0 auto;
}

.author-info {
    display: flex;
    align-items: center;
    gap: 10px; /* Adds space between the avatar and the username */
    flex-grow: 1; /* Allows this container to take up available space */
}

.author-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover; /* Ensures the image covers the area without distortion */
    border: 1px solid var(--card-border-light);
}

body.dark-mode .author-avatar {
    border-color: var(--card-border-dark);
}

.author {
    font-weight: bold;
    margin-bottom: 5px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.author-link {
    color: var(--link-color-light);
    text-decoration: none;
    font-weight: bold;
}
.author-link:hover {
    text-decoration: underline;
}


.account-type-badge {
    font-size: 0.7em;
    padding: 2px 6px;
    border-radius: 4px;
    background-color: #eee;
    color: #333;
    margin-left: 8px;
    text-transform: capitalize;
}

.account-type-badge.company {
    background-color: var(--secondary-color);
    color: white;
}


.timestamp {
    font-size: 0.8em;
    color: #666;
    margin-bottom: 15px;
}

.content-display {
    white-space: pre-wrap; /* Ensures that text wraps and line breaks are respected */
    word-wrap: break-word; /* Breaks long words */
}

.post-images-grid {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 10px;
}

.post-image {
    width: 100%;
    height: auto;
    border-radius: 4px;
    cursor: pointer;
    transition: transform 0.2s;
}

.post-image:hover {
   /* transform: scale(1.02); */
}

#image-preview-container img {
    height: 50px;
    width: 50px;
    object-fit: cover;
    border-radius: 4px;
}

.youtube-embed {
    position: relative;
    padding-bottom: 56.25%; /* 16:9 aspect ratio */
}

.post-actions {
    margin-top: auto; /* Pushes actions to the bottom */
    padding-top: 10px;
    border-top: 1px solid #eee;
    display: flex;
    gap: 15px;
    align-items: center;
}

.post-user-actions {
    padding-top: 5px;
    display: flex;
    justify-content: flex-end;
}


.comment-btn, .upvote-btn, .edit-post-btn {
    background: none;
    border: none;
    color: #555;
    cursor: pointer;
    font-size: 0.9em;
    display: flex;
    align-items: center;
    gap: 5px;
}
.comment-btn:hover, .upvote-btn:hover, .edit-post-btn:hover {
    color: var(--primary-color);
}
.upvote-btn.upvoted {
    color: var(--accent-color);
    font-weight: bold;
}
.action-icon {
    vertical-align: middle;
}
.upvote-count {
    font-size: 0.9em;
    color: #333;
}


.comments-section {
    margin-top: 20px;
    padding-top: 15px;
    border-top: 1px solid #f0f0f0;
}
.comments-list {
    margin-bottom: 15px;
}

.comment {
    padding: 10px;
    border-radius: 5px;
    background-color: #f9f9f9;
    margin-bottom: 10px;
}
.comment-author {
    font-weight: bold;
    font-size: 0.9em;
    margin-bottom: 5px;
}
.comment-content {
    font-size: 0.95em;
}

.add-comment-form textarea {
    width: 100%;
    padding: 8px;
    border-radius: 4px;
    border: 1px solid #ddd;
    margin-bottom: 5px;
    resize: vertical;
}

.add-comment-form button {
    color: white;
    border: none;
    padding: 8px 15px;
    border-radius: 4px;
    cursor: pointer;
}

.add-comment-form button:hover {
    background-color: var(--primary-color-dark);
}

.dark-mode .post-card {
    background-color: #2e2e2e;
    box-shadow: 0 2px 4px rgba(0,0,0,0.4);
}
.dark-mode .timestamp, .dark-mode .comment-btn, .dark-mode .upvote-btn, .dark-mode .edit-post-btn {
    color: #aaa;
}
.dark-mode .post-actions {
    border-top-color: #444;
}
.dark-mode .author-link {
    color: var(--link-color-dark);
}
.dark-mode .account-type-badge {
    background-color: #555;
    color: #ddd;
}
.dark-mode .account-type-badge.company {
    background-color: var(--secondary-color);
}
.dark-mode .upvote-count {
    color: #ccc;
}
.dark-mode .comment {
    background-color: #3a3a3a;
}

/* Edit form specific styles */
.edit-post-form-container {
    padding: 15px;
    border: 1px dashed var(--primary-color);
    border-radius: 5px;
    margin-top: 15px;
    background-color: rgba(0,0,0,0.02);
}
.dark-mode .edit-post-form-container {
    background-color: rgba(255,255,255,0.05);
    border-color: var(--primary-color-light);
}

.edit-post-form textarea,
.edit-post-form input[type="text"] {
    width: 100%;
    padding: 10px;
    margin-bottom: 10px;
    border-radius: 4px;
    border: 1px solid #ccc;
}
.dark-mode .edit-post-form textarea,
.dark-mode .edit-post-form input[type="text"] {
    background-color: #444;
    border-color: #666;
    color: #eee;
}

.edit-post-form .button-danger {
    background-color: #e74c3c;
    color: white;
}
.edit-post-form .button-danger:hover {
    background-color: #c0392b;
}

.current-images-preview {
    display: flex;
    gap: 5px;
    margin: 10px 0;
    flex-wrap: wrap;
}

/* Placeholder for swipe indicators (US-VIEW-002) */
.swipe-indicator-left,
.swipe-indicator-right {
    /* Styles for visual cues for swiping */
}

/* Styles for long post scrolling (US-VIEW-003) */
.post-card .scrollable-content {
    max-height: 300px; /* Example max height before scrolling */
    overflow-y: auto;
}

/* Responsive adjustments */
@media (max-width: 600px) {
    .container {
        width: 95%;
        padding: 10px;
    }

    .post-card {
        margin-left: 0;
        margin-right: 0;
    }
}

.post-card .post-content .post-text {
    font-size: 1rem;
    line-height: 1.5;
    white-space: pre-wrap; /* Preserves whitespace and line breaks */
    word-wrap: break-word; /* Breaks long words */
}

.post-card .post-actions {
    display: flex;
    align-items: center;
}

.post-card .comments-section form button:hover {
    background-color: #0044cc;
}

/* YouTube Preview Styling */
.youtube-preview {
    position: relative;
    margin-top: 15px;
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid var(--border-color);
}

.youtube-preview a {
    display: block;
    position: relative;
}

.youtube-thumbnail {
    width: 100%;
    display: block;
    aspect-ratio: 16 / 9;
    object-fit: cover;
    transition: transform 0.2s ease-in-out;
}

.youtube-preview:hover .youtube-thumbnail {
    transform: scale(1.05);
}

.youtube-play-icon {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 60px;
    height: 42px;
    background-color: rgba(0, 0, 0, 0.6);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.2s ease;
}

.youtube-play-icon::after {
    content: '';
    display: block;
    border-style: solid;
    border-width: 12px 0 12px 20px;
    border-color: transparent transparent transparent white;
}

.youtube-preview:hover .youtube-play-icon {
    background-color: rgba(255, 0, 0, 0.8);
}

.youtube-info {
    padding: 10px 15px;
    background-color: var(--card-footer-bg);
}

.youtube-title {
    font-size: 1rem;
    font-weight: 600;
    margin: 0;
    color: var(--text-color);
} 