* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    background-color: #fafafa;
    color: #262626;
    line-height: 1.5;
}

.container {
    display: flex;
    position: relative;
}

.sidebar {
    width: 220px;
    height: 100vh;
    position: fixed;
    left: 0;
    top: 0;
    background-color: white;
    border-right: 1px solid #dbdbdb;
    padding: 20px 0;
    display: flex;
    flex-direction: column;
    transition: transform 0.3s ease;
    z-index: 1000;
}

.sidebar-collapsed {
    transform: translateX(-190px);
}

.sidebar-header {
    padding: 0 20px;
    margin-bottom: 24px;
}

.toggle-sidebar {
    position: absolute;
    right: -15px;
    top: 20px;
    background-color: white;
    border: 1px solid #dbdbdb;
    border-radius: 50%;
    width: 30px;
    height: 30px;
    font-size: 16px;
    cursor: pointer;
    color: #262626;
    z-index: 1001;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.sidebar-collapsed .toggle-sidebar {
    right: -15px;
}

.sidebar-menu {
    flex: 1;
    overflow-y: auto;
}

.sidebar-menu ul {
    list-style: none;
}

.menu-item {
    margin-bottom: 8px;
}

.menu-item a {
    display: flex;
    align-items: center;
    padding: 12px 20px;
    text-decoration: none;
    color: #262626;
}

.menu-item a:hover {
    background-color: #f0f0f0; /* Light grey background on hover */
    border-radius: 8px; /* Optional: round the corners on hover */
    color: #000; /* Optional: slightly darken text on hover */
}

.menu-item a i {
    font-size: 24px;
    margin-right: 16px;
    width: 24px;
    text-align: center;
}

.menu-item.active a {
    font-weight: bold;
    background-color: #e0e0e0; /* Slightly darker grey for active item */
    border-radius: 8px; /* Match hover rounding */
}

.sidebar-footer {
    padding: 20px;
    border-top: 1px solid #dbdbdb;
}

.sidebar-footer a {
    display: flex;
    align-items: center;
    text-decoration: none;
    color: #262626;
}

.sidebar-footer a i {
    font-size: 24px;
    margin-right: 16px;
}

.instagram-profile {
    max-width: 935px;
    margin: 0 auto;
    padding: 30px 20px;
    margin-left: 220px;
    transition: margin-left 0.3s ease;
    width: calc(100% - 220px);
}

.profile-collapsed {
    margin-left: 30px;
    width: calc(100% - 30px);
}

.profile-header {
    display: flex;
    gap: 30px;
    margin-bottom: 44px;
}

.profile-image {
    width: 150px;
    height: 150px;
    flex-shrink: 0;
}

.profile-image img {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    border: 1px solid #dbdbdb;
    padding: 3px;
}

.profile-info {
    flex: 1;
}

.profile-actions {
    display: flex;
    align-items: center;
    gap: 20px;
    margin-bottom: 20px;
}

h1 {
    font-size: 20px;
    font-weight: 400;
}

.action-buttons {
    display: flex;
    gap: 8px;
}

button {
    border: none;
    background: none;
    cursor: pointer;
    font-size: 14px;
    padding: 7px 16px;
    border-radius: 8px;
}

.follow-btn {
    background-color: #0095f6;
    color: white;
    font-weight: 600;
}

.message-btn {
    background-color: transparent;
    border: 1px solid #dbdbdb;
    font-weight: 600;
}

.more-btn {
    width: 40px;
    height: 32px;
    padding: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.profile-stats {
    display: flex;
    gap: 40px;
    margin-bottom: 20px;
}

.stat {
    font-size: 16px;
}

.stat-count {
    font-weight: 600;
}

.profile-bio {
    max-width: 400px;
}

.profile-bio h2 {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 4px;
}

.profile-bio p {
    font-size: 14px;
}

.profile-bio a {
    color: #00376b;
    text-decoration: none;
    font-weight: 600;
}

.social-buttons-top {
    display: flex;
    gap: 20px;
    margin-bottom: 44px;
    padding: 0 20px;
    justify-content: flex-start;
}

.profile-nav {
    display: flex;
    justify-content: center;
    border-top: 1px solid #dbdbdb;
    margin-bottom: 20px;
}

.profile-nav button {
    border: none;
    background: none;
    padding: 16px;
    font-size: 12px;
    font-weight: 600;
    color: #8e8e8e;
    letter-spacing: 1px;
    border-top: 1px solid transparent;
    margin-top: -1px;
}

.profile-nav button.active {
    color: #262626;
    border-top-color: #262626;
}

.profile-nav button i {
    margin-right: 6px;
}

.post-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 4px;
}

.post-item {
    aspect-ratio: 1;
    overflow: hidden;
}

.post-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Social Links Styling */
.social-links {
    margin: 30px 0;
    text-align: center;
    padding: 0 20px;
}

.social-links h3 {
    margin-bottom: 20px;
    font-size: 18px;
    color: #262626;
}

.social-buttons {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 15px;
}

.social-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 77px;
    height: 77px;
    padding: 10px;
    border-radius: 50%;
    text-decoration: none;
    font-weight: 600;
    color: white;
    transition: all 0.3s ease;
}

.social-btn i {
    font-size: 24px;
    margin-bottom: 5px;
    margin-right: 0;
}

.social-btn.facebook {
    background-color: #497ae4;
}

.social-btn.twitter {
    background-color: #1da1f2;
}

.social-btn.linkedin {
    background-color: #0077b5;
}

.social-btn.github {
    background-color: #333;
}

.social-btn.instagram {
    background: linear-gradient(45deg, #405de6, #5851db, #833ab4, #c13584, #e1306c, #fd1d1d);
}

.social-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
}

/* Responsive styles */
@media (max-width: 768px) {
    .social-buttons {
        flex-direction: column;
        align-items: center;
    }
    
    .social-btn {
        width: 100%;
        max-width: 300px;
    }
}

.post-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

@media (max-width: 735px) {
    .profile-header {
        flex-direction: column;
        gap: 20px;
        align-items: center;
        text-align: center;
    }

    .profile-image {
        width: 77px;
        height: 77px;
    }

    .profile-actions {
        flex-direction: column;
        align-items: center;
    }

    .profile-stats {
        justify-content: center;
    }

    .profile-bio {
        text-align: center;
        margin: 0 auto;
    }

    .story-highlights {
        overflow-x: auto;
        padding-bottom: 10px;
    }

    .post-grid {
        gap: 3px;
    }

    .profile-nav {
        overflow-x: auto;
    }

    .profile-nav button {
        flex: 1;
        min-width: max-content;
    }
}

@media (max-width: 768px) {
    .sidebar {
        transform: translateX(-190px);
    }
    
    .instagram-profile {
        margin-left: 30px;
        width: calc(100% - 30px);
    }
    
    .sidebar-expanded {
        transform: translateX(0);
    }
    
    .profile-expanded {
        margin-left: 220px;
        width: calc(100% - 220px);
    }
}

/* Styles for generic main content area */
.main-content {
    max-width: 935px; /* Match instagram profile width */
    margin: 0 auto;
    padding: 30px 20px;
    margin-left: 220px; /* Account for sidebar */
    transition: margin-left 0.3s ease;
    width: calc(100% - 220px);
}

/* Adjust main content margin when sidebar is collapsed */
/* Use '+' sibling selector assuming main-content directly follows sidebar in the DOM structure if sidebar isn't fixed */
/* If sidebar is fixed and main-content is not a direct sibling, this might need adjustment or JS */
.sidebar-collapsed ~ .main-content { /* Using ~ general sibling combinator for flexibility */
    margin-left: 30px; /* Adjust based on collapsed sidebar width */
    width: calc(100% - 30px);
}

/* Styles for the book library list */
.main-content h1 {
    font-size: 24px; /* Slightly larger heading */
    font-weight: 600;
    margin-bottom: 10px;
    color: #262626;
}

.main-content p {
    margin-bottom: 20px;
    color: #8e8e8e; /* Lighter text for description */
}

.main-content ul {
    list-style: none; /* Remove default bullets */
    padding: 0;
}

.main-content li {
    background-color: #ffffff; /* White background for each item */
    border: 1px solid #dbdbdb; /* Light border */
    border-radius: 8px; /* Rounded corners */
    margin-bottom: 15px; /* Space between items */
    padding: 15px 20px; /* Padding inside each item */
    transition: box-shadow 0.2s ease-in-out; /* Smooth shadow transition */
}

.main-content li:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1); /* Add shadow on hover */
}

.main-content li a {
    text-decoration: none;
    color: #0095f6; /* Instagram blue for links */
    font-weight: 600;
    display: inline-block; /* Ensure link takes up space */
    margin-right: 10px; /* Space between link and description */
}

.main-content li a:hover {
    text-decoration: underline; /* Underline on hover */
}

/* Responsive adjustments for main content */
@media (max-width: 768px) {
    .main-content {
        margin-left: 30px; /* Default margin for smaller screens */
        width: calc(100% - 30px);
        padding: 20px 15px; /* Reduce padding */
    }

    /* Adjust when sidebar is explicitly expanded on small screens */
    /* This assumes a class 'sidebar-expanded' might be added via JS */
    .sidebar-expanded ~ .main-content {
        margin-left: 220px;
        width: calc(100% - 220px);
    }

     /* If sidebar state is controlled differently (e.g., no class change on body/container), */
     /* ensure the default collapsed state styles apply correctly on small screens */
    .sidebar:not(.sidebar-collapsed) ~ .main-content {
         /* Adjust if sidebar is shown by default or via other means on small screens */
         /* This might conflict if sidebar is always collapsed by default < 768px */
         /* Consider the JS logic controlling sidebar visibility */
    }


    .main-content h1 {
        font-size: 20px;
    }

    .main-content li {
        padding: 12px 15px;
    }
}