/* Timeline Posts - Common Styles */

.post-content {
    word-wrap: break-word;
    padding: 0.5rem 0;
}

.post-image img {
    max-width: 100%;
    height: auto;
}

.post-media {
    background: #000;
    border-radius: 12px;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    aspect-ratio: 1 / 1;
}

.post-media-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.card {
    box-shadow: 0 1px 3px rgba(0,0,0,0.12), 0 1px 2px rgba(0,0,0,0.24);
}

.list-group-item a {
    text-decoration: none;
    color: inherit;
}

.list-group-item a:hover {
    color: #0d6efd;
}

.list-group-item.active {
    background-color: #0d6efd;
    border-color: #0d6efd;
}

.list-group-item.active a {
    color: white;
}

.like-btn.active {
    background-color: #0d6efd;
    color: white;
    border-color: #0d6efd;
}

.like-btn.active:hover {
    background-color: #0b5ed7;
    border-color: #0a58ca;
}

.comment {
    transition: background-color 0.2s ease;
}

.comment:hover {
    background-color: #e9ecef !important;
}

.comment-text {
    margin-top: 4px;
    white-space: pre-wrap;
    word-wrap: break-word;
}

.add-comment-form textarea {
    resize: none;
}

.add-comment-form .btn {
    align-self: flex-end;
}

/* Mobile-specific Instagram-like styles */
@media (max-width: 767.98px) {
    /* Remove container padding on mobile for edge-to-edge posts */
    .container {
        padding-left: 0;
        padding-right: 0;
    }

    /* Full width cards on mobile */
    #timeline-posts .card {
        border-radius: 0;
        border-left: none;
        border-right: none;
        margin-bottom: 0;
        box-shadow: none;
        border-bottom: 8px solid #f0f0f0;
    }

    /* Compact post creation on mobile */
    #timeline-posts .card:first-of-type {
        border-top: none;
    }

    /* Reduce padding on mobile */
    .card-body {
        padding: 0.75rem;
    }

    /* Optimize images for mobile */
    .post-image {
        margin-left: -0.75rem;
        margin-right: -0.75rem;
        margin-bottom: 0.75rem !important;
    }

    .post-image img {
        border-radius: 0;
    }

    .post-media {
        border-radius: 0;
        aspect-ratio: 1 / 1;
    }

    /* Compact post stats */
    .post-stats {
        font-size: 0.85rem;
    }

    /* Full width buttons on mobile */
    .post-actions .btn-group {
        border-radius: 0;
    }

    .post-actions .btn {
        border-radius: 0;
        border: none;
        border-right: 1px solid #dee2e6;
        padding: 0.5rem;
    }

    .post-actions .btn:last-child {
        border-right: none;
    }

    /* Compact user avatars */
    .rounded-circle {
        width: 36px !important;
        height: 36px !important;
    }

    .comment .rounded-circle {
        width: 28px !important;
        height: 28px !important;
    }

    /* Responsive text sizing */
    .card-title {
        font-size: 1rem;
    }

    h6 {
        font-size: 0.9rem;
    }

    /* Optimize comment form for mobile */
    .add-comment-form .input-group {
        flex-direction: column;
    }

    .add-comment-form textarea {
        border-radius: 0.25rem 0.25rem 0 0 !important;
    }

    .add-comment-form .btn {
        border-radius: 0 0 0.25rem 0.25rem !important;
        width: 100%;
    }

    /* Hide post creation card on very small screens to focus on feed */
    .card:has(form[action*="timeline/post"]) {
        display: block;
    }

    /* Compact pagination */
    .d-flex.justify-content-between {
        padding: 0 0.75rem;
    }
}

/* Tablet optimizations */
@media (min-width: 768px) and (max-width: 991.98px) {
    .col-md-6 {
        flex: 0 0 100%;
        max-width: 100%;
    }

    .col-md-3 {
        flex: 0 0 100%;
        max-width: 100%;
        margin-bottom: 1rem;
    }
}

/* Bottom Action Bar */
.bottom-action-bar {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    box-shadow: 0 -4px 12px rgba(0, 0, 0, 0.15);
    z-index: 1000;
    padding: 12px 0;
}

.action-buttons {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 20px;
    max-width: 600px;
    margin: 0 auto;
    padding: 0 20px;
}

.action-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.2);
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 12px;
    padding: 12px 24px;
    color: white;
    font-weight: 600;
    transition: all 0.3s ease;
    cursor: pointer;
    backdrop-filter: blur(10px);
    min-width: 120px;
}

.action-btn:hover {
    background: rgba(255, 255, 255, 0.3);
    border-color: rgba(255, 255, 255, 0.5);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.action-btn:active {
    transform: translateY(0);
}

.action-btn i {
    font-size: 24px;
    margin-bottom: 4px;
}

.action-label {
    font-size: 13px;
}

/* Add padding to body to prevent content being hidden behind action bar */
body {
    padding-bottom: 80px;
}

/* Modal styling improvements */
.modal-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-radius: 8px 8px 0 0;
}

.modal-header .btn-close {
    filter: brightness(0) invert(1);
    opacity: 0.8;
}

.modal-header .btn-close:hover {
    opacity: 1;
}

.modal-title i {
    margin-right: 8px;
}

.modal-body {
    padding: 1.5rem;
}

.modal-footer {
    border-top: 1px solid #dee2e6;
    padding: 1rem 1.5rem;
}

/* Image preview in modal */
#imagePreviewContainer {
    text-align: center;
    margin-bottom: 1rem;
}

#imagePreview {
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

/* Mobile and Tablet adjustments for action bar - keep it fixed on bottom */
@media (max-width: 767.98px) {
    .action-buttons {
        gap: 12px;
        padding: 0 15px;
    }

    .action-btn {
        padding: 10px 16px;
        min-width: 100px;
    }

    .action-btn i {
        font-size: 20px;
    }

    .action-label {
        font-size: 12px;
    }

    .bottom-action-bar {
        padding: 10px 0;
    }

    body {
        padding-bottom: 70px;
    }
}

/* Extra small mobile adjustments */
@media (max-width: 575.98px) {
    .action-btn {
        padding: 8px 12px;
        min-width: 90px;
    }

    .action-btn i {
        font-size: 18px;
    }

    .action-label {
        font-size: 11px;
    }
}

/* Desktop - show action bar in a less prominent way */
@media (min-width: 768px) {
    .bottom-action-bar {
        position: static;
        background: transparent;
        box-shadow: none;
        padding: 20px 0;
        margin-top: 20px;
    }

    .action-buttons {
        max-width: 100%;
    }

    .action-btn {
        background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
        border: none;
        padding: 14px 28px;
        min-width: 140px;
    }

    .action-btn:hover {
        background: linear-gradient(135deg, #5568d3 0%, #63408a 100%);
        box-shadow: 0 6px 16px rgba(102, 126, 234, 0.3);
    }

    body {
        padding-bottom: 0;
    }
}

