/* Reset and Base Styles */
* {
    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;
}

.app-container {
    max-width: 935px;
    margin: 0 auto;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Header */
.header {
    background-color: #ffffff;
    border-bottom: 1px solid #dbdbdb;
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 20px;
    max-width: 935px;
    margin: 0 auto;
}

.logo {
    font-size: 24px;
    font-weight: 700;
    color: #262626;
    font-family: 'Segoe UI', sans-serif;
}

.header-icons {
    display: flex;
    gap: 16px;
}

.icon-btn {
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px;
    border-radius: 8px;
    transition: background-color 0.2s ease;
    color: #262626;
}

.icon-btn:hover {
    background-color: #f5f5f5;
}

/* Main Content */
.main-content {
    flex: 1;
    padding: 20px;
}

.feed-container {
    max-width: 470px;
    margin: 0 auto;
}

/* Stories Section */
.stories-section {
    background-color: #ffffff;
    border: 1px solid #dbdbdb;
    border-radius: 8px;
    padding: 16px;
    margin-bottom: 24px;
}

.stories-scroll {
    display: flex;
    gap: 16px;
    overflow-x: auto;
    padding-bottom: 4px;
}

.stories-scroll::-webkit-scrollbar {
    display: none;
}

.story-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    min-width: 66px;
    cursor: pointer;
}

.story-avatar {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: linear-gradient(45deg, #f09433 0%, #e6683c 25%, #dc2743 50%, #cc2366 75%, #bc1888 100%);
    padding: 2px;
    margin-bottom: 4px;
}

.story-avatar img {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid #ffffff;
}

.story-username {
    font-size: 12px;
    color: #262626;
    text-align: center;
    max-width: 66px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Posts Feed */
.posts-feed {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.post {
    background-color: #ffffff;
    border: 1px solid #dbdbdb;
    border-radius: 8px;
    overflow: hidden;
}

.post-header {
    display: flex;
    align-items: center;
    padding: 12px 16px;
    gap: 12px;
}

.post-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    overflow: hidden;
}

.post-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.post-user-info {
    flex: 1;
}

.post-username {
    font-weight: 600;
    font-size: 14px;
    color: #262626;
}

.post-location {
    font-size: 12px;
    color: #8e8e8e;
}

.post-options {
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px;
    color: #262626;
}

.post-image {
    width: 100%;
    height: 400px;
    object-fit: cover;
    display: block;
}

.post-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 16px;
}

.post-actions-left {
    display: flex;
    gap: 16px;
}

.action-btn {
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px;
    color: #262626;
    transition: transform 0.1s ease;
}

.action-btn:hover {
    transform: scale(1.1);
}

.action-btn.liked {
    color: #ed4956;
}

.post-likes {
    padding: 0 16px 8px;
    font-weight: 600;
    font-size: 14px;
    color: #262626;
}

.post-caption {
    padding: 0 16px 8px;
    font-size: 14px;
    line-height: 1.4;
}

.post-username-caption {
    font-weight: 600;
    color: #262626;
    margin-right: 8px;
}

.post-comments {
    padding: 0 16px 12px;
}

.view-comments {
    color: #8e8e8e;
    font-size: 14px;
    cursor: pointer;
    background: none;
    border: none;
    padding: 0;
    margin-bottom: 4px;
}

.comment {
    font-size: 14px;
    margin-bottom: 4px;
}

.comment-username {
    font-weight: 600;
    color: #262626;
    margin-right: 8px;
}

.post-time {
    padding: 0 16px 12px;
    font-size: 10px;
    color: #8e8e8e;
    text-transform: uppercase;
    letter-spacing: 0.2px;
}

/* Bottom Navigation */
.bottom-nav {
    background-color: #ffffff;
    border-top: 1px solid #dbdbdb;
    display: flex;
    justify-content: space-around;
    padding: 8px 0;
    position: sticky;
    bottom: 0;
}

.nav-btn {
    background: none;
    border: none;
    cursor: pointer;
    padding: 12px;
    color: #262626;
    transition: color 0.2s ease;
}

.nav-btn.active {
    color: #0095f6;
}

.nav-btn:hover {
    color: #0095f6;
}

/* Responsive Design */
@media (max-width: 768px) {
    .app-container {
        max-width: 100%;
    }
    
    .main-content {
        padding: 0;
    }
    
    .feed-container {
        max-width: 100%;
    }
    
    .stories-section {
        border-radius: 0;
        border-left: none;
        border-right: none;
        margin-bottom: 0;
    }
    
    .post {
        border-radius: 0;
        border-left: none;
        border-right: none;
        margin-bottom: 0;
    }
    
    .header-content {
        padding: 12px 16px;
    }
    
    .post-image {
        height: 350px;
    }
}

@media (max-width: 480px) {
    .logo {
        font-size: 20px;
    }
    
    .header-icons {
        gap: 12px;
    }
    
    .post-image {
        height: 300px;
    }
    
    .stories-scroll {
        gap: 12px;
    }
    
    .story-item {
        min-width: 60px;
    }
    
    .story-avatar {
        width: 50px;
        height: 50px;
    }
    
    .story-username {
        font-size: 11px;
        max-width: 60px;
    }
}

/* Loading Animation */
@keyframes pulse {
    0% {
        opacity: 1;
    }
    50% {
        opacity: 0.5;
    }
    100% {
        opacity: 1;
    }
}

.loading {
    animation: pulse 1.5s ease-in-out infinite;
}

/* Smooth Transitions */
.post {
    transition: transform 0.2s ease;
}

.post:hover {
    transform: translateY(-2px);
}

/* Custom Scrollbar */
.stories-scroll {
    scrollbar-width: none;
    -ms-overflow-style: none;
}

/* Focus States for Accessibility */
.icon-btn:focus,
.action-btn:focus,
.nav-btn:focus {
    outline: 2px solid #0095f6;
    outline-offset: 2px;
    border-radius: 4px;
}

/* Heart Animation */
@keyframes heartBeat {
    0% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.3);
    }
    100% {
        transform: scale(1);
    }
}

.action-btn.liked {
    animation: heartBeat 0.3s ease;
}
