/* 기본 스타일 리셋 */
* {
    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;
}

/* 헤더 스타일 */
.header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    background-color: white;
    border-bottom: 1px solid #dbdbdb;
    z-index: 1000;
    height: 60px;
}

.header-content {
    max-width: 975px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 100%;
    padding: 0 20px;
}

.logo {
    display: flex;
    align-items: center;
    font-size: 24px;
    font-weight: 600;
    color: #262626;
}

.logo i {
    margin-right: 8px;
    color: #0095f6;
}

.search-bar {
    position: relative;
    flex: 0 1 300px;
}

.search-bar input {
    width: 100%;
    padding: 8px 16px 8px 40px;
    border: 1px solid #dbdbdb;
    border-radius: 8px;
    background-color: #fafafa;
    font-size: 14px;
    outline: none;
    transition: all 0.2s ease;
}

.search-bar input:focus {
    background-color: white;
    border-color: #0095f6;
}

.search-bar i {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: #8e8e8e;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 20px;
}

.action-btn {
    background: none;
    border: none;
    font-size: 24px;
    color: #262626;
    cursor: pointer;
    padding: 8px;
    border-radius: 50%;
    transition: background-color 0.2s ease;
}

.action-btn:hover {
    background-color: #fafafa;
}

.profile-pic img {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    object-fit: cover;
    cursor: pointer;
}

/* 메인 컨텐츠 */
.main-content {
    margin-top: 60px;
    display: flex;
    justify-content: center;
    gap: 32px;
    padding: 20px;
}

.container {
    max-width: 614px;
    width: 100%;
}

/* 스토리 섹션 */
.stories-section {
    background-color: white;
    border: 1px solid #dbdbdb;
    border-radius: 8px;
    padding: 16px;
    margin-bottom: 24px;
    display: flex;
    gap: 16px;
    overflow-x: auto;
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.stories-section::-webkit-scrollbar {
    display: none;
}

.story-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    min-width: 72px;
    cursor: pointer;
}

.story-avatar {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: linear-gradient(45deg, #f09433, #e6683c, #dc2743, #cc2366, #bc1888);
    padding: 2px;
}

.story-avatar img {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid white;
}

.story-item span {
    font-size: 12px;
    color: #262626;
    text-align: center;
    max-width: 72px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* 피드 섹션 */
.feed-section {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.post {
    background-color: white;
    border: 1px solid #dbdbdb;
    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;
}

.post-user img {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    object-fit: cover;
}

.post-user-info {
    display: flex;
    flex-direction: column;
}

.post-username {
    font-weight: 600;
    font-size: 14px;
    color: #262626;
}

.post-location {
    font-size: 12px;
    color: #8e8e8e;
}

.post-options {
    background: none;
    border: none;
    font-size: 16px;
    color: #262626;
    cursor: pointer;
    padding: 4px;
}

.post-image {
    width: 100%;
    max-height: 614px;
    object-fit: cover;
}

.post-actions {
    padding: 8px 16px;
}

.post-action-buttons {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 8px;
}

.action-button {
    background: none;
    border: none;
    font-size: 24px;
    color: #262626;
    cursor: pointer;
    padding: 4px;
    transition: transform 0.1s ease;
}

.action-button:hover {
    transform: scale(1.1);
}

.action-button.liked {
    color: #ed4956;
}

.action-button.bookmarked {
    color: #262626;
}

.post-likes {
    font-weight: 600;
    font-size: 14px;
    margin-bottom: 8px;
}

.post-caption {
    margin-bottom: 8px;
}

.post-caption .username {
    font-weight: 600;
    margin-right: 8px;
}

.post-comments {
    color: #8e8e8e;
    font-size: 14px;
    margin-bottom: 8px;
    cursor: pointer;
}

.post-time {
    color: #8e8e8e;
    font-size: 10px;
    text-transform: uppercase;
    margin-bottom: 12px;
}

.post-comment-input {
    display: flex;
    align-items: center;
    gap: 8px;
    padding-top: 12px;
    border-top: 1px solid #dbdbdb;
}

.post-comment-input input {
    flex: 1;
    border: none;
    outline: none;
    font-size: 14px;
    padding: 8px 0;
}

.post-comment-input button {
    background: none;
    border: none;
    color: #0095f6;
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
    opacity: 0.3;
    transition: opacity 0.2s ease;
}

.post-comment-input button.active {
    opacity: 1;
}

/* 사이드바 */
.sidebar {
    width: 300px;
    position: sticky;
    top: 80px;
    height: fit-content;
}

.sidebar-content {
    background-color: white;
    border: 1px solid #dbdbdb;
    border-radius: 8px;
    padding: 16px;
}

.suggested-users h3 {
    color: #8e8e8e;
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 16px;
}

.user-item {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
}

.user-item img {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    object-fit: cover;
}

.user-info {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.username {
    font-weight: 600;
    font-size: 14px;
    color: #262626;
}

.user-desc {
    font-size: 12px;
    color: #8e8e8e;
}

.follow-btn {
    background: none;
    border: none;
    color: #0095f6;
    font-weight: 600;
    font-size: 12px;
    cursor: pointer;
}

/* 반응형 디자인 */
@media (max-width: 1024px) {
    .sidebar {
        display: none;
    }
    
    .main-content {
        justify-content: center;
    }
}

@media (max-width: 768px) {
    .header-content {
        padding: 0 16px;
    }
    
    .search-bar {
        display: none;
    }
    
    .main-content {
        padding: 16px;
    }
    
    .container {
        max-width: 100%;
    }
    
    .stories-section {
        padding: 12px;
        gap: 12px;
    }
    
    .story-item {
        min-width: 64px;
    }
    
    .story-avatar {
        width: 48px;
        height: 48px;
    }
    
    .story-item span {
        font-size: 11px;
    }
}

@media (max-width: 480px) {
    .header {
        height: 56px;
    }
    
    .main-content {
        margin-top: 56px;
        padding: 12px;
    }
    
    .header-content {
        padding: 0 12px;
    }
    
    .action-btn {
        font-size: 20px;
        padding: 6px;
    }
    
    .profile-pic img {
        width: 28px;
        height: 28px;
    }
    
    .stories-section {
        padding: 8px;
        gap: 8px;
    }
    
    .story-item {
        min-width: 56px;
    }
    
    .story-avatar {
        width: 40px;
        height: 40px;
    }
    
    .post-header {
        padding: 12px;
    }
    
    .post-actions {
        padding: 8px 12px;
    }
}

/* 애니메이션 효과 */
.post {
    animation: fadeInUp 0.5s ease-out;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.action-button:active {
    transform: scale(0.95);
}

/* 호버 효과 */
.post:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    transition: box-shadow 0.2s ease;
}

.story-item:hover .story-avatar {
    transform: scale(1.05);
    transition: transform 0.2s ease;
}

/* 스크롤바 스타일링 */
::-webkit-scrollbar {
    width: 6px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
}

::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
    background: #a8a8a8;
}

/* 로딩 오버레이 */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(255, 255, 255, 0.9);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

.loading-spinner {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
}

.loading-spinner i {
    font-size: 48px;
    color: #0095f6;
}

.loading-spinner p {
    font-size: 16px;
    color: #262626;
    font-weight: 500;
}

/* 게시물이 없을 때 */
.no-posts {
    text-align: center;
    padding: 60px 20px;
    color: #8e8e8e;
}

.no-posts i {
    font-size: 64px;
    margin-bottom: 16px;
    opacity: 0.5;
}

.no-posts p {
    font-size: 16px;
}

/* 개선된 댓글 모달 */
.comments-modal .comment-item {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 12px 0;
    border-bottom: 1px solid #f0f0f0;
}

.comments-modal .comment-item:last-child {
    border-bottom: none;
}

.comments-modal .comment-user {
    display: flex;
    align-items: center;
    gap: 12px;
}

.comments-modal .comment-user img {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    object-fit: cover;
}

.comments-modal .comment-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.comments-modal .comment-username {
    font-weight: 600;
    font-size: 14px;
    color: #262626;
}

.comments-modal .comment-time {
    font-size: 12px;
    color: #8e8e8e;
}

.comments-modal .comment-text {
    color: #262626;
    font-size: 14px;
    line-height: 1.4;
    margin-left: 44px;
}

.comments-modal .no-comments {
    text-align: center;
    color: #8e8e8e;
    font-style: italic;
    padding: 40px 0;
}

/* 알림 스타일 개선 */
.notification {
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
    border-radius: 12px;
    font-weight: 500;
}

.notification i {
    font-size: 16px;
}

/* 반응형 개선 */
@media (max-width: 480px) {
    .notification {
        min-width: 280px;
        right: 10px;
        left: 10px;
        font-size: 13px;
    }
    
    .loading-spinner i {
        font-size: 36px;
    }
    
    .loading-spinner p {
        font-size: 14px;
    }
}
