/* Global Reset for Accurate Layout Sizing */
*, *::before, *::after {
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: #f0f2f5;
    margin: 0;
    padding: 0;
}

/* =========================================
   NAVBAR
   ========================================= */
.navbar {
    background-color: white;
    padding: 15px 40px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    position: sticky;
    top: 0;
    z-index: 100;
}

.navbar h2 {
    margin: 0;
}

/* =========================================
   3-COLUMN DESKTOP LAYOUT (NEW)
   ========================================= */
.container {
    display: flex;
    max-width: 1200px; /* Width increased for 3 columns */
    margin: 30px auto;
    gap: 20px;
    padding: 0 20px;
    align-items: flex-start; /* Prevents sidebars from stretching vertically */
}

/* 1. Left Column (Navigation) */
.sidebar {
    background: white;
    width: 250px;
    padding: 20px;
    border-radius: 12px;
    height: fit-content;
    flex-shrink: 0; /* Prevents squeezing */
}

.sidebar ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.sidebar li {
    padding: 12px 10px;
    cursor: pointer;
    font-weight: bold;
    color: #333;
    border-radius: 6px;
    margin-bottom: 5px;
}

.sidebar li:hover {
    background-color: #f0f2f5;
}

/* 2. Middle Column (The Feed) */
.feed {
    flex: 1;
    min-width: 0; /* Prevents large text from breaking the flexbox */
    display: flex;
    flex-direction: column;
    gap: 20px;
}

/* 3. Right Column (Widgets/Polls) */
.right-sidebar {
    width: 300px;
    flex-shrink: 0; /* Prevents squeezing */
    display: flex;
    flex-direction: column;
    gap: 20px;
}

/* =========================================
   POST & WIDGET CARDS
   ========================================= */
.create-post, .post, .widget {
    background: white;
    padding: 20px;
    border-radius: 12px;
    box-shadow: 0 1px 2px rgba(0,0,0,0.05);
}

textarea {
    width: 100%;
    height: 70px;
    border: 1px solid #ccc;
    border-radius: 8px;
    padding: 10px;
    margin-bottom: 10px;
    font-family: inherit;
    resize: none;
}

button {
    background-color: #2563eb;
    color: white;
    padding: 10px 20px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-weight: bold;
}

/* =========================================
   📱 MOBILE RESPONSIVE DESIGN
   ========================================= */
@media screen and (max-width: 900px) {
    /* Main container ko column mein badlo */
    .container {
        flex-direction: column;
        padding-bottom: 80px; /* Bottom nav ke liye space */
        margin: 15px auto;
    }

    /* Feed aur Right Sidebar ko 100% width do */
    .feed, .right-sidebar, .sidebar {
        width: 100%;
    }

    /* Right sidebar mobile me thik se dikhe */
    .right-sidebar {
        margin-top: 10px;
    }

    /* Sidebar ko Bottom Nav bar banao */
    .sidebar {
        position: fixed;
        bottom: 0;
        left: 0;
        background: white;
        border-top: 1px solid #ddd;
        box-shadow: 0 -4px 10px rgba(0,0,0,0.05);
        z-index: 1000;
        padding: 0;
        margin: 0;
        border-radius: 15px 15px 0 0;
        /* Custom scrollbar for mobile nav hide karne ke liye */
        overflow-x: auto; 
    }

    .sidebar ul {
        display: flex;
        flex-direction: row;
        justify-content: space-between;
        white-space: nowrap;
        padding: 10px 15px;
        margin: 0;
    }

    .sidebar ul li {
        margin: 0 5px;
        padding: 10px 15px;
        font-size: 14px;
        border-radius: 20px;
        text-align: center;
    }

    /* Navbar UI fix for mobile */
    .navbar {
        padding: 15px 20px;
    }
    
    .navbar h2 {
        font-size: 20px;
    }
    
    .navbar button {
        padding: 6px 12px;
        font-size: 14px;
    }

    .create-post, .post, .widget {
        padding: 15px;
    }
}