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

/* 로딩 스피너 애니메이션 */
@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

body {
    font-family: 'Arial', sans-serif;
    background-color: #ffffff;
    color: #333;
    line-height: 1.6;
}

.container {
    max-width: 800px;
    margin: 0 auto;
    padding: 0;
}

.posts-container {
    padding: 0;
    margin-bottom: 80px;
}

.post {
    background: white;
    padding: 16px;
    margin-bottom: 1px;
    border-bottom: 1px solid #eee;
    cursor: pointer;
    transition: background-color 0.2s;
}

.post:hover {
    background: #f8f9fa;
}

.post-header {
    display: flex;
    align-items: center;
    margin-bottom: 10px;
}

.post-author {
    display: flex;
    align-items: center;
    gap: 8px;
}

.author-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: #4a4a4a;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: bold;
}

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

.author-name {
    font-weight: bold;
    font-size: 14px;
    color: #333;
}

.post-date {
    color: #666;
    font-size: 12px;
}

.post-title {
    font-size: 16px;
    font-weight: bold;
    color: #333;
    margin-bottom: 8px;
    line-height: 1.3;
}

.post-content {
    font-size: 14px;
    color: #666;
    margin-bottom: 12px;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.post-content-area {
    cursor: pointer;
}

.post-stats {
    display: flex;
    gap: 20px;
    color: #666;
    font-size: 14px;
    padding-top: 8px;
}

.stat-item {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 8px;
    border-radius: 16px;
    transition: background-color 0.2s;
    cursor: pointer;
    min-width: 45px;
}

.stat-item:hover {
    background: #f0f0f0;
}

.stat-item.like-btn {
    cursor: pointer;
    transition: all 0.2s;
}

.stat-item.like-btn:hover {
    background: #ffe6cc;
}

.stat-item.like-btn.liked {
    color: #FFAB02;
    font-weight: bold;
}

.stat-item.like-btn.liked:hover {
    background: #ffe6cc;
}

/* 플로팅 버튼 */
.floating-btn {
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 56px;
    height: 56px;
    background: #FFAB02;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 24px;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    transition: all 0.3s;
    z-index: 1000;
}

.floating-btn:hover {
    background: #e6990a;
    transform: scale(1.1);
}

/* 페이지 스타일 */
.page {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: white;
    z-index: 2000;
    display: flex;
    flex-direction: column;
}

.page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 50px;
    padding: 0 20px;
    border-bottom: 1px solid #eee;
    background: white;
    position: sticky;
    top: 0;
    z-index: 100;
}

.home-header {
    justify-content: center;
}

.back-btn {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: #333;
    padding: 6px;
    margin-left: -6px;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
}

.page-header h2 {
    font-size: 16px;
    font-weight: bold;
    color: #333;
    margin: 0;
}

.submit-btn, .menu-btn, .share-btn {
    background: none;
    border: none;
    color: #FFAB02;
    font-size: 14px;
    cursor: pointer;
    font-weight: bold;
    padding: 6px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.share-btn {
    color: #333;
    transition: color 0.2s;
    width: 36px;
}

.share-btn:hover {
    color: #FFAB02;
}

.submit-btn:hover, .menu-btn:hover {
    color: #e6990a;
}

/* 글 작성 페이지 */
.write-form {
    padding: 20px;
    flex: 1;
}

.write-form input {
    width: 100%;
    padding: 16px;
    border: none;
    border-bottom: 1px solid #eee;
    font-size: 18px;
    margin-bottom: 20px;
}

.write-form input:focus {
    outline: none;
    border-bottom-color: #FFAB02;
}

.write-form textarea {
    width: 100%;
    padding: 16px;
    border: none;
    font-size: 16px;
    line-height: 1.6;
    min-height: 300px;
    resize: none;
}

.write-form textarea:focus {
    outline: none;
}

/* 글 상세 페이지 */
.detail-content {
    flex: 1;
    overflow-y: auto;
    padding-bottom: 80px; /* 댓글 입력창 공간 확보 */
}

.post-detail {
    padding: 20px;
}

.post-detail .post-title {
    font-size: 24px;
    font-weight: bold;
    color: #333;
    margin-bottom: 16px;
    line-height: 1.2;
}

.post-detail .post-header {
    margin-bottom: 20px;
}

.post-detail .post-content {
    font-size: 16px;
    color: #333;
    line-height: 1.4;
    margin-bottom: 0;
    display: block;
    -webkit-line-clamp: none;
    overflow: visible;
}

/* 액션 버튼 바 (제목 아래에 위치) */
.post-actions-bar {
    display: flex;
    padding: 12px 20px;
    border-bottom: 1px solid #eee;
    background: white;
    margin-bottom: 20px;
}

/* 댓글 입력창만 하단 고정 */
.comment-input-fixed {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: white;
    border-top: 1px solid #eee;
    z-index: 100;
}

.post-actions-bar .action-btn {
    background: none;
    border: none;
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 12px;
    cursor: pointer;
    transition: background-color 0.2s;
    border-radius: 20px;
    font-size: 14px;
    color: #666;
}

.post-actions-bar .action-btn:hover {
    background: #f0f0f0;
}

.post-actions-bar .action-btn.liked {
    color: #FFAB02;
}

.post-actions-bar .action-btn.liked .icon {
    color: #FFAB02;
}

.comments-list {
    padding: 0 20px 20px 20px;
}

.comment {
    background: white;
    padding: 16px 0;
    margin-bottom: 0;
    border-bottom: 1px solid #eee;
    border-radius: 0;
}

.comment:last-child {
    border-bottom: none;
}

.comment-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
}

.comment-author {
    font-weight: bold;
    font-size: 14px;
    color: #333;
}

.comment-date {
    font-size: 12px;
    color: #999;
}

.comment-content {
    margin-bottom: 8px;
    font-size: 14px;
    line-height: 1.5;
    color: #333;
}

.comment-actions {
    display: flex;
    gap: 10px;
    align-items: center;
}

.comment-like-btn {
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    padding: 6px 12px;
    border-radius: 16px;
    cursor: pointer;
    font-size: 12px;
    font-weight: 500;
    transition: all 0.2s ease;
    color: #666;
    display: flex;
    align-items: center;
    gap: 4px;
    min-width: 50px;
    justify-content: center;
}

.comment-like-btn:hover {
    background: #e9ecef;
    border-color: #FFAB02;
    color: #FFAB02;
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.comment-like-btn.liked {
    background: #FFAB02;
    color: white;
    border-color: #FFAB02;
    font-weight: bold;
}

.comment-like-btn.liked:hover {
    background: #e6990a;
    border-color: #e6990a;
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(255, 171, 2, 0.3);
}

.comment-input-area {
    display: flex;
    padding: 12px 20px;
    gap: 10px;
    background: white;
    border-top: 1px solid #eee;
}

.comment-input-area input {
    flex: 1;
    padding: 12px 16px;
    border: 1px solid #ddd;
    border-radius: 20px;
    font-size: 14px;
}

.comment-input-area input:focus {
    outline: none;
    border-color: #FFAB02;
}

.comment-input-area button {
    background: #FFAB02;
    color: white;
    border: none;
    padding: 12px 20px;
    border-radius: 20px;
    cursor: pointer;
    font-size: 14px;
    transition: background-color 0.3s;
}

.comment-input-area button:hover {
    background: #e6990a;
}

/* 모달 */
.modal {
    display: none;
    position: fixed;
    z-index: 3000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
}

.modal-content {
    background-color: white;
    margin: 50% auto;
    transform: translateY(-50%);
    padding: 20px;
    border-radius: 10px;
    width: 90%;
    max-width: 400px;
    position: relative;
}

.close {
    position: absolute;
    right: 15px;
    top: 15px;
    font-size: 28px;
    cursor: pointer;
    color: #aaa;
}

.close:hover {
    color: #000;
}

.share-buttons {
    display: flex;
    gap: 10px;
    margin-top: 20px;
}

.share-buttons button {
    flex: 1;
    padding: 10px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    transition: background-color 0.3s;
    color: white;
    font-weight: bold;
}

.share-buttons button:nth-child(1) {
    background: #1877f2; /* Facebook 파란색 */
}

.share-buttons button:nth-child(1):hover {
    background: #166fe5;
}

.share-buttons button:nth-child(2) {
    background: #666; /* 링크 복사 회색 */
}

.share-buttons button:nth-child(2):hover {
    background: #555;
}

/* 하단 탭바 */
.bottom-tab-bar {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: 60px;
    background: white;
    border-top: 1px solid #eee;
    display: flex;
    justify-content: space-around;
    align-items: center;
    z-index: 1000;
    box-shadow: 0 -2px 8px rgba(0, 0, 0, 0.1);
}

.tab-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    padding: 15px 0;
    flex: 1;
}

.tab-item:hover {
    background: #f8f9fa;
}

.tab-icon {
    width: 30px;
    height: 30px;
    object-fit: contain;
}

/* 하단 탭바로 인한 콘텐츠 여백 조정 */
.posts-container {
    padding: 0;
    margin-bottom: 140px; /* 하단 탭바(60px) + 기존 여백(80px) */
    margin-top: 0; /* 헤더가 sticky이므로 추가 여백 불필요 */
}

/* 댓글 입력창 위치 조정 */
.comment-input-fixed {
    bottom: 60px; /* 하단 탭바 위에 위치 */
}

/* 글 상세 페이지에서 댓글 입력창을 화면 하단에 고정 */
#detailPage .comment-input-fixed {
    bottom: 0; /* 글 상세 페이지에서는 화면 하단에 고정 */
}

/* 글 상세 페이지에서 콘텐츠 하단 여백 조정 */
#detailPage .detail-content {
    padding-bottom: 80px; /* 댓글 입력창 공간 확보 */
    padding-top: 0; /* 헤더가 sticky이므로 추가 여백 불필요 */
}

/* 플로팅 버튼 위치 조정 */
.floating-btn {
    bottom: 80px; /* 하단 탭바 위에 위치 */
    right: 20px;
}

@media (max-width: 768px) {
    .container {
        padding: 0;
    }
    
    header h1 {
        font-size: 2em;
    }
    
    .post {
        padding: 16px;
    }
    
    .floating-btn {
        bottom: 80px;
        right: 20px;
    }
}