/* farmersblog - Apple + Facebook inspired styling */

:root {
    --fb-blue: #1877F2;
    --fb-bg: #f0f2f5;
    --like-red: #e41e3f;
    --card-radius: 0.75rem;
    --green: #28a745;
}

body {
    background-color: var(--fb-bg);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen,
        Ubuntu, Cantarell, "Fira Sans", "Droid Sans", "Helvetica Neue", sans-serif;
}

/* Post Cards */
.post-card {
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    overflow: hidden;
    word-wrap: break-word;
}

.post-card:hover {
    transform: scale(1.01);
    box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.1) !important;
}

/* Caption container - prevent overflow */
.caption-container {
    overflow: hidden;
    word-wrap: break-word;
}

.post-image {
    width: 100%;
    height: 300px;
    object-fit: cover;
    background: #f8f9fa;
}

@media (max-width: 576px) {
    .post-image {
        height: 200px;
    }
}

/* Like Button */
.btn-like {
    background: transparent;
    border: 1px solid #dee2e6;
    color: #6c757d;
    transition: all 0.2s ease;
}

.btn-like:hover {
    background: rgba(228, 30, 63, 0.05);
    border-color: var(--like-red);
    color: var(--like-red);
}

.btn-like.liked {
    background: rgba(228, 30, 63, 0.1);
    border-color: var(--like-red);
    color: var(--like-red);
}

.btn-like.liked i {
    animation: heartBeat 0.3s ease;
}

@keyframes heartBeat {
    0% { transform: scale(1); }
    50% { transform: scale(1.3); }
    100% { transform: scale(1); }
}

/* Upload Area */
.upload-area {
    cursor: pointer;
    transition: all 0.2s ease;
    border-color: #dee2e6 !important;
}

.upload-area:hover {
    background: #e9ecef !important;
    border-color: var(--fb-blue) !important;
}

.upload-area:hover .btn-outline-success {
    background: var(--green);
    color: white;
    border-color: var(--green);
}

/* Rounded pill start/end for input groups */
.rounded-pill-start {
    border-radius: 50rem 0 0 50rem !important;
}

.rounded-pill-end {
    border-radius: 0 50rem 50rem 0 !important;
}

/* Pagination */
.page-link {
    border: none;
    color: var(--fb-blue);
    padding: 0.5rem 1.25rem;
    font-weight: 500;
}

.page-link:hover {
    background: rgba(24, 119, 242, 0.1);
    color: var(--fb-blue);
}

/* Toast */
.toast {
    min-width: 250px;
}

/* Navbar */
.navbar {
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}

.nav-link {
    font-weight: 500;
    color: #1c1e21;
}

.nav-link:hover {
    color: var(--fb-blue);
}

/* Comment items */
.comment-item:last-child {
    margin-bottom: 0 !important;
}

/* Form inputs */
.form-control:focus {
    box-shadow: 0 0 0 0.2rem rgba(24, 119, 242, 0.15);
    border-color: var(--fb-blue);
}

/* Alert animations */
.alert {
    animation: slideDown 0.3s ease;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Profile grid */
.profile-grid-item {
    aspect-ratio: 1;
    overflow: hidden;
}

/* Chat scrollbar */
#chatMessages::-webkit-scrollbar {
    width: 6px;
}

#chatMessages::-webkit-scrollbar-track {
    background: transparent;
}

#chatMessages::-webkit-scrollbar-thumb {
    background: #ccc;
    border-radius: 3px;
}

/* Group cards */
.group-card {
    transition: transform 0.2s ease;
}

.group-card:hover {
    transform: translateY(-2px);
}

/* Min-width utility for text truncation */
.min-width-0 {
    min-width: 0;
}

/* Badge for group tag */
.badge a {
    color: inherit;
}

/* Video thumbnail overlay */
.video-thumbnail {
    position: relative;
}

.video-thumbnail .play-overlay {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(0, 0, 0, 0.5);
    border-radius: 50%;
    padding: 1rem;
}

/* Listing cards */
.listing-card {
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.listing-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.12) !important;
}

/* Media navigation arrows */
#mediaContainer .btn-light {
    opacity: 0.85;
    transition: opacity 0.2s ease;
}

#mediaContainer .btn-light:hover {
    opacity: 1;
}

/* Read more link */
.read-more-link {
    color: var(--fb-blue);
}

.read-more-link:hover {
    text-decoration: underline !important;
}

/* Preserve whitespace and line breaks in user-generated text */
.post-caption,
.caption-preview,
.caption-full,
.comment-item p,
.chat-messages p,
.bio-text,
.group-description,
.listing-description {
    white-space: pre-wrap;
    word-wrap: break-word;
}
