/* Instagram Clone Styles */
:root {
    --bg-primary: #ffffff;
    --bg-secondary: #fafafa;
    --bg-tertiary: #f0f0f0;
    --text-primary: #262626;
    --text-secondary: #8e8e8e;
    --text-tertiary: #c7c7c7;
    --border-color: #dbdbdb;
    --accent-gradient: linear-gradient(45deg, #f09433 0%, #e6683c 25%, #dc2743 50%, #cc2366 75%, #bc1888 100%);
    --link-color: #0095f6;
    --link-hover: #00376b;
    --font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, sans-serif;
    --sidebar-width: 244px;
    --right-sidebar-width: 320px;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: var(--font-family);
    background-color: var(--bg-secondary);
    color: var(--text-primary);
    line-height: 1.5;
    min-height: 100vh;
}

/* Sidebar Navigation */
.sidebar {
    position: fixed;
    left: 0;
    top: 0;
    width: var(--sidebar-width);
    height: 100vh;
    background: var(--bg-primary);
    border-right: 1px solid var(--border-color);
    padding: 25px 12px;
    display: flex;
    flex-direction: column;
    z-index: 100;
}

.logo {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    margin-bottom: 20px;
}

.logo svg {
    width: 28px;
    height: 28px;
    display: none;
}

.logo-text {
    font-size: 24px;
    font-weight: 700;
    letter-spacing: -0.5px;
    background: var(--accent-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.nav-menu {
    list-style: none;
    flex: 1;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 12px;
    margin: 4px 0;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
}

.nav-item:hover {
    background: var(--bg-secondary);
}

.nav-item.active {
    font-weight: 600;
}

.nav-item svg {
    width: 24px;
    height: 24px;
    stroke: var(--text-primary);
    flex-shrink: 0;
}

.nav-item span {
    font-size: 16px;
    color: var(--text-primary);
}

.nav-item .profile-pic {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    overflow: hidden;
}

.nav-item .profile-pic img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.badge {
    position: absolute;
    right: 12px;
    background: var(--accent-gradient);
    color: white;
    font-size: 11px;
    font-weight: 600;
    padding: 2px 6px;
    border-radius: 10px;
    min-width: 18px;
    text-align: center;
}

.nav-bottom {
    margin-top: auto;
    padding-top: 20px;
    border-top: 1px solid var(--border-color);
}

/* Main Content */
.main-content {
    margin-left: var(--sidebar-width);
    margin-right: var(--right-sidebar-width);
    padding: 30px 0;
    max-width: 630px;
    margin-left: calc(var(--sidebar-width) + ((100vw - var(--sidebar-width) - var(--right-sidebar-width) - 630px) / 2));
}

/* Stories Section */
.stories-container {
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 16px;
    margin-bottom: 24px;
    overflow: hidden;
}

.stories-scroll {
    display: flex;
    gap: 16px;
    overflow-x: auto;
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.stories-scroll::-webkit-scrollbar {
    display: none;
}

.story-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    flex-shrink: 0;
}

.story-ring {
    width: 66px;
    height: 66px;
    border-radius: 50%;
    padding: 3px;
    background: var(--bg-tertiary);
}

.story-ring.has-story {
    background: var(--accent-gradient);
}

.story-img {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    overflow: hidden;
    border: 2px solid var(--bg-primary);
    position: relative;
}

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

.add-story .add-icon {
    position: absolute;
    bottom: 0;
    right: 0;
    width: 20px;
    height: 20px;
    background: var(--link-color);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: 600;
    border: 2px solid var(--bg-primary);
}

.story-username {
    font-size: 12px;
    color: var(--text-primary);
    max-width: 66px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Feed Section */
.feed {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.post {
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    overflow: hidden;
}

.post-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 16px;
}

.post-user {
    display: flex;
    align-items: center;
    gap: 12px;
}

.profile-pic {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    overflow: hidden;
    background: var(--bg-tertiary);
}

.profile-pic.large {
    width: 56px;
    height: 56px;
}

.profile-pic.small {
    width: 24px;
    height: 24px;
}

.profile-pic img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.user-info {
    display: flex;
    flex-direction: column;
}

.user-info .username {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
}

.user-info .location {
    font-size: 12px;
    color: var(--text-secondary);
}

.more-btn {
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px;
    color: var(--text-primary);
}

.more-btn svg {
    width: 20px;
    height: 20px;
}

.post-image {
    width: 100%;
    aspect-ratio: 4/5;
    background: var(--bg-tertiary);
    overflow: hidden;
}

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

.post-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px 8px;
}

.action-left {
    display: flex;
    gap: 16px;
}

.action-btn {
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px;
    color: var(--text-primary);
    transition: all 0.2s ease;
}

.action-btn:hover {
    opacity: 0.6;
}

.action-btn svg {
    width: 24px;
    height: 24px;
}

.action-btn.like-btn.liked svg {
    fill: #ed4956;
    stroke: #ed4956;
}

.post-stats {
    padding: 0 16px 8px;
}

.likes-count {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
}

.post-caption {
    padding: 0 16px 8px;
    font-size: 14px;
    line-height: 1.5;
}

.post-caption .username {
    font-weight: 600;
    margin-right: 4px;
}

.post-caption .caption-text {
    color: var(--text-primary);
}

.post-comments {
    padding: 0 16px 8px;
}

.view-comments {
    font-size: 14px;
    color: var(--text-secondary);
    cursor: pointer;
}

.view-comments:hover {
    color: var(--text-primary);
}

.post-time {
    padding: 0 16px 16px;
    font-size: 10px;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Right Sidebar */
.right-sidebar {
    position: fixed;
    right: 0;
    top: 0;
    width: var(--right-sidebar-width);
    height: 100vh;
    padding: 40px 16px;
    overflow-y: auto;
}

.user-profile {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 24px;
}

.user-profile .profile-info {
    flex: 1;
}

.user-profile .username {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
    display: block;
}

.user-profile .full-name {
    font-size: 14px;
    color: var(--text-secondary);
}

.switch-btn {
    background: none;
    border: none;
    color: var(--link-color);
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
}

.switch-btn:hover {
    color: var(--link-hover);
}

.suggestions-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
}

.suggestions-header span {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-secondary);
}

.see-all {
    background: none;
    border: none;
    color: var(--text-primary);
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
}

.suggestions-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 32px;
}

.suggestion-item {
    display: flex;
    align-items: center;
    gap: 12px;
}

.suggestion-info {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.suggestion-info .username {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
}

.suggestion-info .mutual {
    font-size: 12px;
    color: var(--text-secondary);
}

.follow-btn {
    background: none;
    border: none;
    color: var(--link-color);
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
}

.follow-btn:hover {
    color: var(--link-hover);
}

/* Footer */
.sidebar-footer {
    margin-top: auto;
}

.footer-links {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 12px;
    margin-bottom: 16px;
}

.footer-links a {
    font-size: 12px;
    color: var(--text-tertiary);
    text-decoration: none;
}

.footer-links a:hover {
    text-decoration: underline;
}

.footer-links a::after {
    content: "·";
    margin-left: 12px;
    color: var(--text-tertiary);
}

.footer-links a:last-child::after {
    content: none;
}

.copyright {
    font-size: 12px;
    color: var(--text-tertiary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Responsive Design */
@media (max-width: 1260px) {
    .right-sidebar {
        display: none;
    }
    
    .main-content {
        margin-right: 0;
        margin-left: calc(var(--sidebar-width) + ((100vw - var(--sidebar-width) - 630px) / 2));
    }
}

@media (max-width: 768px) {
    :root {
        --sidebar-width: 72px;
    }
    
    .logo-text {
        display: none;
    }
    
    .logo svg {
        display: block;
    }
    
    .nav-item span {
        display: none;
    }
    
    .nav-item .badge {
        position: absolute;
        top: 8px;
        right: 8px;
    }
    
    .main-content {
        margin-left: var(--sidebar-width);
        padding: 16px;
        max-width: 100%;
    }
    
    .stories-container {
        border-radius: 0;
        border-left: none;
        border-right: none;
        margin: -16px -16px 16px;
    }
    
    .post {
        border-radius: 0;
        border-left: none;
        border-right: none;
        margin: 0 -16px;
    }
}

@media (max-width: 480px) {
    :root {
        --sidebar-width: 0;
    }
    
    .sidebar {
        display: none;
    }
    
    .main-content {
        margin-left: 0;
        padding: 0;
    }
    
    .stories-container {
        margin: 0 0 16px;
    }
    
    .post {
        margin: 0 0 16px;
    }
}

/* Animations */
@keyframes likeAnimation {
    0% { transform: scale(1); }
    50% { transform: scale(1.2); }
    100% { transform: scale(1); }
}

.action-btn.like-btn.liked {
    animation: likeAnimation 0.3s ease;
}

/* Scrollbar Styling */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: var(--bg-secondary);
}

::-webkit-scrollbar-thumb {
    background: var(--text-tertiary);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--text-secondary);
}