:root {
    --main-color: #5a7d9a;
    --background-color: #f8f7f4;
    --text-color: #2c2c2c;
    --border-color: #e0ddd8;

    /* Five Elements - Muted Tones */
    --oh-wood: #6b8f71;
    --oh-fire: #c4756e;
    --oh-earth: #c4a35a;
    --oh-metal: #8a8a8a;
    --oh-water: #5e8aad;

    /* Five Elements - Light Backgrounds */
    --oh-bg-wood: #eef3ee;
    --oh-bg-fire: #f5edec;
    --oh-bg-earth: #f5f0e4;
    --oh-bg-metal: #f0efed;
    --oh-bg-water: #ecf1f5;

    /* Five Elements - Bar Fill */
    --oh-bar-wood: #a3c4a7;
    --oh-bar-fire: #dba9a4;
    --oh-bar-earth: #dcc48a;
    --oh-bar-metal: #b8b8b8;
    --oh-bar-water: #9fc0d8;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    background-color: var(--background-color);
    color: var(--text-color);
    margin: 0;
    padding: 0;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    touch-action: manipulation;
}

.container {
    display: flex;
    justify-content: center;
    flex-grow: 1;
    max-width: 1200px;
    margin: 0 auto;
    width: 100%;
}

nav {
    width: 220px;
    padding: 1rem;
    display: flex;
    flex-direction: column;
}

.nav-items {
    margin-bottom: 1rem;
    top: 100px;
}

.nav-items .disabled {
    color: #a0a0a0;
    cursor: not-allowed;
    position: relative;
}

.nav-items .disabled::after {
    content: '(준비 중)';
    font-size: 0.8em;
    margin-left: 5px;
    color: #a0a0a0;
}

.nav-items .disabled i {
    color: #a0a0a0;
}

.new-post-btn {
    background-color: var(--main-color);
    color: white;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 20px;
    cursor: pointer;
    font-weight: bold;
    text-align: center;
    text-decoration: none;
    display: block;
}

#publish-btn {
    background-color: var(--main-color);
    color: white;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 20px;
    cursor: pointer;
    font-weight: bold;
    text-align: center;
    text-decoration: none;
    display: block;
}

#publish-btn:disabled {
    background-color: #a0a0a0;
    cursor: not-allowed;
}

nav ul {
    list-style-type: none;
    padding: 0;
}

nav ul li {
    margin-bottom: 1rem;
}

nav ul li a {
    color: var(--text-color);
    text-decoration: none;
    font-weight: bold;
    display: flex;
    align-items: center;
}

nav ul li a i {
    margin-right: 10px;
    width: 20px;
    text-align: center;
}

nav ul li a.active {
    color: var(--main-color);
}

.page-title {
    font-size: 1.2em;
    font-weight: 700;
    margin: 12px 0;
    color: var(--text-color);
}

main {
    flex: 1;
    min-width: 0;
    max-width: 800px;
    width: 100%;
    padding: 2px;
}

.sidebar {
    width: 0px;
    padding: 1rem;
}

.profile-pic {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    margin-bottom: 1rem;
    cursor: pointer;
}

.new_takus_post {
    border: 1px solid var(--border-color);
    border-radius: 10px;
    padding: 1rem;
    margin-bottom: 1rem;
}

.new_takus_post textarea {
    width: 100%;
    min-height: 100px;
    border: none;
    resize: vertical;
    margin-bottom: 0.5rem;
}

.new_takus_post .form-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.new_takus_post .file-inputs label {
    background-color: #f0f0f0;
    color: var(--text-color);
    border: 1px solid var(--border-color);
    padding: 0.5rem 1rem;
    border-radius: 20px;
    cursor: pointer;
    font-weight: bold;
    margin-right: 0.5rem;
}

.new_takus_post .file-inputs input[type="file"] {
    display: none;
}

.drag-drop-area {
    border: 2px dashed var(--border-color);
    border-radius: 10px;
    padding: 2rem;
    text-align: center;
    margin-top: 1rem;
    transition: background-color 0.3s;
}

.drag-drop-area.dragover {
    background-color: rgba(74, 144, 226, 0.1);
}

.post-media-container {
    overflow-x: auto;
    white-space: nowrap;
    margin-bottom: 1rem;
}

.post-media-item {
    display: inline-block;
    margin-right: 1rem;
    max-width: 100%;
    max-height: 300px;
}

.takus_post {
    border: 1px solid var(--border-color);
    border-radius: 10px;
    padding: 1rem;
    margin-bottom: 1rem;
}

.post-actions {
    display: flex;
    justify-content: space-between;
    margin-top: 1rem;
}

.post-actions button {
    background: none;
    border: none;
    cursor: pointer;
    color: var(--text-color);
}

.comments {
    margin-top: 1rem;
    border-top: 1px solid var(--border-color);
    padding-top: 1rem;
}

.comment {
    position: relative;
    margin-bottom: 10px;
}

.comment-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.delete-comment {
    background: none;
    border: none;
    color: #888;
    cursor: pointer;
    padding: 0;
    font-size: 0.9em;
}

.delete-comment:hover {
    color: #f00;
}

.comment-content {
    margin-top: 5px;
}

.comment-form {
    display: flex;
    margin-top: 1rem;
    align-items: center;
}

.comment-form input {
    flex-grow: 1;
    margin-right: 0.5rem;
    padding: 0.5rem;
    border: 1px solid var(--border-color);
    border-radius: 20px;
}

.comment-form button {
    background-color: var(--main-color);
    color: white;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 20px;
    cursor: pointer;
}

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

.post-actions-right {
    display: flex;
    gap: 10px;
}

.post-actions-right button {
    background: none;
    border: none;
    cursor: pointer;
    color: var(--text-color);
    font-size: 1rem;
    transition: color 0.3s ease; /* 부드러운 색상 전환 효과 추가 */
}

.post-actions-right button.edit-button:hover {
    color: #4a90e2; /* 수정 버튼 hover 시 파란색으로 변경 */
}

.post-actions-right button:hover:not(.edit-button) {
    color: #e74c3c; /* 삭제 버튼 hover 시 빨간색으로 변경 */
}
.edit-mode .post-content {
    display: none;
}

.edit-form {
    display: none;
    margin: 10px;
}

.edit-mode .edit-form {
    display: block;
}

.edit-form textarea {
    width: 100%;
    min-height: 100px;
    border: 1px solid var(--border-color);
    border-radius: 5px;
    padding: 0.5rem;
    margin-bottom: 0.5rem;
}

.edit-form button {
    background-color: var(--main-color);
    color: white;
    border: none;
    cursor: pointer;
    font-size: 0.8rem;
    padding: 0.5rem 1rem;
    border-radius: 20px;
}

.media-preview {
    display: flex;
    overflow-x: auto;
    gap: 10px;
    margin-top: 10px;
    margin-bottom: 10px;
}

.media-preview-item {
    position: relative;
    max-width: 100px;
    max-height: 100px;
}

.media-preview-item img,
.media-preview-item video {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.media-preview-item .remove-media {
    position: absolute;
    top: 5px;
    right: 5px;
    background: rgba(0, 0, 0, 0.5);
    color: white;
    border: none;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    font-size: 12px;
    cursor: pointer;
}

.mobile-nav {
    display: none;
    background-color: var(--background-color);
    border-top: 1px solid var(--border-color);
    width: auto;
    left: 0;
    right: 0;
    z-index: 1000;
}

.mobile-nav ul {
    display: flex;
    justify-content: space-around;
    align-items: center;
    list-style-type: none;
    padding: 0;
    margin: 0;
}

.mobile-nav ul li {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    flex: 1;
}

.mobile-nav ul li a {
    color: var(--text-color);
    text-decoration: none;
    font-size: 0.85rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    width: 100%;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    gap: 2px;
}

.mobile-nav ul li a.active {
    color: var(--main-color);
    font-weight: 600;
}

.mobile-nav ul li a i {
    margin-bottom: 5px;
}

.mobile-nav ul li a.new-post-btn {
    background-color: var(--main-color);
    color: white;
    border-radius: 50%;
    width: 48px;
    height: 48px;
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
    top: -15px;
}

.mobile-nav .disabled {
    color: #a0a0a0;
    cursor: not-allowed;
}

/* 프로필 페이지 스타일 */
.profile-container {
    max-width: 800px;
    margin: 0 auto;
    padding: 20px;
}

.profile-info {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-bottom: 30px;
}

.profile-image {
    position: relative;
    margin-bottom: 20px;
    display: inline-block;
}

.profile-image .profile-pic {
    width: 150px;
    height: 150px;
    border-radius: 50%;
    object-fit: cover;
}

.change-profile-btn {
    position: absolute;
    bottom: 10px;
    left: 50%;
    transform: translateX(-50%);
    background-color: rgba(0, 0, 0, 0.6);
    color: gray;
    border: none;
    padding: 5px 10px;
    border-radius: 15px;
    cursor: pointer;
    font-size: 0.8em;
    transition: background-color 0.3s;
}

.change-profile-btn:hover {
    color: rgba(0, 0, 0, 0.8);
}

#change-profile-picture {
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    background-color: rgba(255, 255, 255, 0.8);
    border: none;
    padding: 5px 10px;
    border-radius: 15px;
    cursor: pointer;
}



.profile-details {
    text-align: left;
    width: 100%;
}



.profile-item {
    display: flex;
    align-items: center;
    margin-bottom: 10px;
    font-size: 16px;
}

.profile-item i {
    margin-right: 10px;
    width: 20px;
    text-align: center;
}

.btn-reset {
    background-color: #f0f0f0;
    border: none;
    color: var(--text-color);
    padding: 2px 8px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.9em;
    margin-left: 10px;
}

.btn-reset:hover {
    background-color: #e0e0e0;
}

.delete-icon {
    color: #dc3545;
}

.delete-account-btn {
    background: none;
    border: none;
    color: inherit;
    cursor: pointer;
    font-size: inherit;
    padding: 0;
    display: flex;
    align-items: center;
}

.delete-account-btn:hover,
.delete-account-btn:hover .delete-icon {
    color: #dc3545;
}

#reset-nickname {
    margin-left: 10px;
    padding: 2px 5px;
    font-size: 0.8em;
}

.user-posts {
    margin-top: 30px;
}

.user-posts h3 {
    margin-bottom: 20px;
}

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

.user-name {
    font-weight: bold;
    color: var(--text-color);
    margin-left: 10px;
}

.post-media-container {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.media-list {
    display: flex;
    flex-wrap: nowrap;
    gap: 10px;
    overflow-x: auto;
}

.media-list img,
.media-list video {
    flex: 0 0 auto;
    max-width: 50%;
    height: auto;
    object-fit: contain;
    background-color: none;
    border: none; 
}

#loading-indicator {
    text-align: center;
    padding: 20px;
    font-style: italic;
    color: #888;
}

/* Modal CSS */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0,0,0,0.9);
}

.modal-content {
    margin: auto;
    display: block;
    width: 90%;
    height: 90%;
    max-width: 90%;
    max-height: 90%;
    object-fit: contain;
    background-color: transparent;
}

.modal-content {
    animation-name: zoom;
    animation-duration: 0.1s;
}

@keyframes zoom {
    from {transform:scale(0)} 
    to {transform:scale(1)}
}

@media (max-width: 25600px) {
    .container {
        flex-direction: row;
        align-items: flex-start;
        max-width: 1200px;
        margin-left: 0;
    }
    nav {
        position: fixed;
        top: 0;
        left: 30px;
        bottom: 0;
        height: 100vh;
        width: 250px;
        box-sizing: border-box;
        overflow-y: auto;
        background-color: var(--background-color);
    }

    main {
        margin-left: 270px;
        flex: 1;
        min-width: 0;
        max-width: 800px;
        width: 100%;
        padding: 8px;
        box-sizing: border-box;
    }
}

@media (max-width: 800px) {
    body {
        padding-bottom: 60px;
        overflow-x: hidden;
    }
    .container {
        flex-direction: column;
        align-items: stretch;
        max-width: 100%;
        overflow-x: hidden;
    }
    nav {
        display: none;
    }
    main {
        max-width: 100%;
        padding: 2px;
        box-sizing: border-box;
        margin-left: 0;
        overflow-x: hidden;
    }
    .mobile-nav {
        position: fixed;
        display: block;
        height: 60px;
        top: auto;
        bottom: 0;
        left: 0;
        right: 0;
        width: 100%;
        box-sizing: border-box;
        overflow: hidden;
    }
    #drag-drop-area {
        display: none;
    }
    .profile-container {
        padding: 10px;
    }
    .profile-image .profile-pic {
        width: 100px;
        height: 100px;
    }
}

.table-container {
    width: 100%;
    overflow-x: auto;
    margin-bottom: 20px;
    /* 부드러운 스크롤 효과 추가 */
    scroll-behavior: smooth;
    /* 웹킷 기반 브라우저에서 스크롤바 스타일링 */
    &::-webkit-scrollbar {
        height: 8px;
    }
    &::-webkit-scrollbar-track {
        background: #f1f1f1;
        border-radius: 4px;
    }
    &::-webkit-scrollbar-thumb {
        background: #888;
        border-radius: 4px;
    }
    &::-webkit-scrollbar-thumb:hover {
        background: #555;
    }
}

/* 기본 (데스크톱) 스타일 */
#calendar table td {
    padding: 8px;
    margin: 4px;
}

#calendar table .big-text {
    font-size: 1.2em;
    margin-bottom: 4px;
}

#calendar table .kanji {
    margin: 3px 0;
}

#calendar table .lunar-date {
    font-size: 0.9em;
    margin-top: 4px;
}

/* 모바일 환경에서의 스타일 */
@media screen and (max-width: 800px) {
    #calendar table td {
        padding: 4px;
        margin: 2px;
    }

    #calendar table .big-text {
        font-size: 1.1em;
        margin-bottom: 2px;
    }

    #calendar table .kanji {
        margin: 2px 0;
        font-size: 0.9em;
    }

    #calendar table .lunar-date {
        font-size: 0.8em;
        margin-top: 2px;
    }
}