/* ========================================= */
/* Global Reset & Utilities                  */
/* ========================================= */

html, body {
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    background-color: #f0f2f5;
    display: flex;
    flex-direction: column; /* Stack Header, Main Container, and Footer vertically */
    min-height: 100vh; /* Ensures body at least takes full screen height */
}

/* Base container utility class for consistent padding/max-width control */
.container {
    width: 100%;
    max-width: 1200px;
    margin: auto;
    padding-left: 0.5rem;
    padding-right: 0.5rem;
    box-sizing: border-box;
}

/* Utility Class for spacing (mimicking Bootstrap classes where needed) */
.mb-4 { margin-bottom: 2rem !important; }
.p-3 { padding: 15px !important; }
.rounded { border-radius: 8px; }
.shadow { box-shadow: 0 1px 5px rgba(0, 0, 0, 0.1); }


/* ========================================= */
/* Header / Top Banner (.main-header)         */
/* ========================================= */

.main-header {
    background-color: #ffffff;
    border-bottom: 1px solid #ddd;
    padding: 8px 0;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
    position: sticky; /* Sticky header */
    top: 0;
    z-index: 1000;
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Logo */
.logo h1 {
    font-size: 2rem;
    color: #3b5998;
    margin: 0;
}

/* Navigation Links Container */
.nav-links a {
    text-decoration: none;
    color: #606770;
    padding: 5px 10px;
    margin-left: 5px;
    transition: color 0.2s, background-color 0.2s;
    border-radius: 4px;
    font-weight: 600;
}

.nav-links a:hover {
    background-color: #e7e7e7;
    color: #3b5998;
}

.nav-link.active {
    color: #1877f2;
    font-weight: bold;
}

/* ========================================= */
/* Main Content Wrapper (The area that scrolls)*/
/* ========================================= */

main {
    display: flex; /* Use flexbox for horizontal side-by-side layout */
    max-width: 1200px;
    margin: 20px auto;
    padding: 0 20px;
}

/* General Sidebar Styling */
.sidebar {
    flex-shrink: 10;
    padding: 5px;
    background-color: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

/* Sidebar link styling remains clean */
.sidebar a {
 padding: 8px 8px 8px 16px;
 text-decoration: none;
 font-size: 16px;
 color: #818181;
  display: block;
 transition: 0.3s;
 }

/* Left Sidebar Menu */
.left-sidebar {
    flex: 0 0 200px;
    min-width: 200px;
    position: sticky;
    top: 90px; /* Offset by header height (rough estimate) */
}

/* Central Feed - IMPORTANT CHANGE: Removed all fixed height rules */
.central-feed {
    flex: 1; /* Takes up remaining flexible width */
    min-width: 450px;
    margin-right: 20px;
    overflow-y: visible; /* Allows natural content flow */
}

/* Right Sidebar Menu */
.right-sidebar {
    flex: 0 0 280px;
    min-width: 200px;
    padding-top: 10px;
}


/* ========================================= */
/* Post Card Styling (Enhanced)                  */
/* ========================================= */

.post-card {
    background: #ffffff;
    border: none;
    box-shadow: 0 1px 5px rgba(0, 0, 0, 0.1);
}

/* User Info Block within a post or general feed area */
.user-info {
    display: flex;
    align-items: center;
    margin-bottom: 15px;
}
.avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    object-fit: cover;
    margin-right: 12px;
    border: 1px solid #eee;
}

.username {
    display: inline-block;
    font-weight: bold;
    color: #3b5998;
    cursor: pointer;
    margin: 0;
    font-size: 17px;
}

.post-body {
    padding: 10px 0;
    margin-bottom: 15px;
    line-height: 1.4;
}
.post-text {
    margin: top: 0;
    margin-bottom: 10px;
    font-size: 16px;
}
.post-image {
    width: 100%;
    max-height: 500px;
    object-fit: cover;
    border-radius: 6px;
    margin-top: 10px;
}

/* Actions/Buttons - General styling for the group */
.post-actions {
    padding-top: 10px;
    border-top: 1px solid #eee;
    display: flex; /* Use flexbox to arrange buttons linearly */
    justify-content: space-around; /* Even spacing between buttons */
    gap: 5px;
}

/* Styling for all action buttons within the card */
.action-btn {
    flex: 1; /* Makes all buttons take equal width */
    padding: 8px 10px;
    border-radius: 6px;
    transition: background-color 0.2s, border-color 0.2s;
}

/* Specific button styles for better visual hierarchy and feedback */
.action-btn {
    background-color: #f7f9fb; /* Light neutral background */
    border: 1px solid #ddd;
    color: #606770;
    cursor: pointer;
}

/* State when button is active/liked (e.g., after liking) */
.action-btn.liked {
    background-color: #e8f5e9; /* Light green background for liked state */
    border-color: #4CAF50;
    color: #388E3C;
}

/* Example button color tweaks */
.dislike-btn {
    color: #FF9800; /* Orange/Yellow for dislike */
}
.share-btn {
    color: #2196F3; /* Blue for share */
}
.report-btn {
    background-color: #ffebee !important; /* Very light red background */
    border-color: #f44336 !important;
    color: #d32f2f !important;
}

/* ========================================= */
/* Form Elements (Create Post/Login)         */
/* ========================================= */
.post-form-container .user-info {
    margin-bottom: 15px;
}
#post-form textarea {
    width: 100%;
    padding: 8px;
    border: 1px solid #ddd;
    resize: none;
    font-size: 16px;
}

/* ========================================= */
/* Footer Styling                              */
/* ========================================= */

.app-footer {
    background-color: #f7f9fa;
    padding: 40px 0 20px 0;
    border-top: 1px solid #ddd;
}

.footer-content {
    display: flex;
    justify-content: space-between;
    margin-bottom: 30px;
}

/* Adjust column sizing to handle both standard and stacked views smoothly */
.col-md-3, .col-sm-6 {
    flex-basis: 22%; /* Helps distribute columns evenly on desktop (4 parts) */
    min-width: 150px;
    padding: 0 10px;
}

/* Link styling consistency */
.footer-links a {
    color: #999;
    text-decoration: none;
    display: block;
    margin-bottom: 8px;
    font-size: 14px;
}


/* ========================================= */
/* Responsive Adjustments (Media Queries)     */
/* ========================================= */

@media screen and (max-width: 1200px) {
    main {
        flex-direction: column; /* When side content stack, the central feed must still control scrolling */
        margin: 20px auto;
        padding: 0 20px;
    }
    .sidebar {
        width: 100%; /* Full width when stacked */
        min-width: unset;
        position: static !important;
        border-bottom: 1px solid #ddd;
        margin-right: 0 !important;
        padding: 0 !important;
    }

    .central-feed {
        /* Reset fixed height rules to guarantee content flow on all screen sizes */
        overflow-y: visible !important;
        max-height: none !important;
        margin-right: 0 !important;
        padding-bottom: 20px;
    }
}
