/* 공통 스타일 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    /* 컬러 변수 - 화이트톤 + 연분홍 포인트 */
    --color-white: #ffffff;
    --color-bg: #fafafa;
    --color-pink: #e8b4b8;
    --color-pink-light: #f5dfe1;
    --color-pink-dark: #c9979b;
    --color-text: #333333;
    --color-text-light: #666666;
    --color-border: #e0e0e0;
    --color-error: #d32f2f;
    --color-success: #388e3c;
}

html, body {
    overflow-x: hidden;
    width: 100%;
}

body {
    font-family: 'Noto Sans KR', sans-serif;
    background-color: var(--color-bg);
    color: var(--color-text);
    line-height: 1.6;
}

a {
    color: inherit;
    text-decoration: none;
}

ul {
    list-style: none;
}

/* 메인 콘텐츠 */
.main-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 40px 20px;
    min-height: calc(100vh - 160px);
}

.page-section {
    background: var(--color-white);
    padding: 40px;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}

.page-section h1 {
    margin-bottom: 30px;
    color: var(--color-text);
    font-size: 28px;
    border-bottom: 2px solid var(--color-pink);
    padding-bottom: 15px;
}

/* 버튼 공통 */
.btn,
button {
    display: inline-block;
    padding: 10px 20px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.2s;
}

.btn-submit {
    background: var(--color-pink);
    color: var(--color-white);
}

.btn-submit:hover {
    background: var(--color-pink-dark);
}

.btn-cancel {
    background: var(--color-border);
    color: var(--color-text);
}

.btn-cancel:hover {
    background: #ccc;
}

/* 관리자 로그인 페이지 취소 버튼 */
.admin-login .btn-cancel {
    display: block;
    width: 100%;
    padding: 14px;
    margin-top: 10px;
    background: #f5f5f5;
    color: #666;
    border: none;
    border-radius: 4px;
    font-size: 15px;
    text-align: center;
    text-decoration: none;
    transition: all 0.2s;
}

.admin-login .btn-cancel:hover {
    background: #e0e0e0;
    color: #333;
}

/* 폼 공통 */
.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
}

.form-group input,
.form-group textarea {
    width: 100%;
    padding: 12px;
    border: 1px solid var(--color-border);
    border-radius: 4px;
    font-size: 14px;
}

.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--color-pink);
}

.form-actions {
    margin-top: 30px;
    display: flex;
    gap: 10px;
}

/* 메시지 */
.error {
    color: var(--color-error);
    margin-bottom: 15px;
}

.success-message {
    text-align: center;
    padding: 40px;
}

.success-message p {
    margin-bottom: 20px;
    font-size: 18px;
}

/* 푸터 */
.footer {
    background: #fff;
    padding: 25px 20px;
    box-shadow: 0 -2px 10px rgba(0,0,0,0.05);
}

.footer-inner {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 20px;
}

.footer-left {
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.footer-brand {
    font-size: 16px;
    font-weight: 600;
    color: #c9979b;
    margin-bottom: 5px;
}

.footer-address {
    color: #888;
    font-size: 13px;
}

.footer-phone {
    color: #666;
    font-weight: 500;
    font-size: 13px;
}

.footer-copyright {
    color: #999;
    font-size: 12px;
    margin-top: 5px;
}

.footer-credit {
    font-size: 11px;
    color: #bbb;
    margin-left: 5px;
}

.footer-right {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 15px;
}

.footer-social {
    display: flex;
    gap: 15px;
}

.admin-login-btn {
    font-size: 11px;
    color: #bbb;
    margin-top: 8px;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.admin-login-btn i {
    font-size: 9px;
}

.admin-login-btn:hover {
    color: #c9979b;
}

/* 관리자 로그인 상태 표시 */
.admin-status {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-top: 10px;
    padding: 8px 12px;
    background: #fff5f5;
    border-radius: 6px;
    border: 1px solid #f0d0d0;
}

.admin-status-text {
    font-size: 11px;
    color: #c9979b;
    font-weight: 500;
}

.admin-status-text i {
    margin-right: 4px;
}

.admin-link {
    font-size: 11px;
    color: #888;
    padding: 4px 8px;
    border-radius: 4px;
    transition: all 0.2s;
}

.admin-link:hover {
    color: #c9979b;
    background: #fff;
}

.admin-link.logout {
    color: #999;
}

.admin-link.logout:hover {
    color: #d32f2f;
}

.social-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: #f5f5f5;
    color: #666;
    font-size: 18px;
    transition: all 0.3s ease;
}

.social-icon:hover {
    background: #c9979b;
    color: #fff;
}

@media (max-width: 768px) {
    .main-content {
        padding: 20px 15px;
        min-height: calc(100vh - 100px);
    }

    .page-section {
        padding: 25px 15px;
    }

    .page-section h1 {
        font-size: 22px;
        margin-bottom: 20px;
    }

    .footer-inner {
        flex-direction: column;
        align-items: flex-start;
        gap: 20px;
    }

    .footer-social {
        align-self: flex-start;
    }

    .footer {
        padding: 20px 15px;
    }

    .footer-brand {
        font-size: 14px;
    }

    .footer-address,
    .footer-phone {
        font-size: 12px;
    }

    .footer-copyright {
        font-size: 11px;
    }
}

@media (max-width: 480px) {
    .main-content {
        padding: 15px 10px;
    }

    .page-section {
        padding: 20px 12px;
        border-radius: 6px;
    }

    .page-section h1 {
        font-size: 20px;
        padding-bottom: 12px;
    }

    .form-group label {
        font-size: 13px;
    }

    .form-group input,
    .form-group textarea {
        padding: 10px;
        font-size: 13px;
    }

    .form-actions {
        flex-direction: column;
    }

    .btn,
    button {
        padding: 12px 16px;
        font-size: 13px;
        width: 100%;
    }
}

/* 내 글 조회 페이지 스타일 */
.my-posts-section {
    margin-bottom: 40px;
}

.my-posts-section h2 {
    font-size: 20px;
    color: var(--color-text);
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--color-border);
}

.my-posts-section .info-text {
    color: var(--color-text-light);
    margin-bottom: 20px;
}

.my-posts-section .empty {
    color: #999;
    text-align: center;
    padding: 30px;
    background: #f9f9f9;
    border-radius: 8px;
}

/* 내 글 카드 스타일 */
.my-post-card {
    background: #fff;
    border: 1px solid var(--color-border);
    border-radius: 8px;
    margin-bottom: 15px;
    overflow: hidden;
    transition: box-shadow 0.2s;
}

.my-post-card:hover {
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.my-post-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
    background: #fafafa;
    border-bottom: 1px solid var(--color-border);
}

.my-post-title {
    font-size: 16px;
    font-weight: 600;
    color: var(--color-text);
    flex: 1;
}

.my-post-title a {
    color: inherit;
    transition: color 0.2s;
}

.my-post-title a:hover {
    color: var(--color-pink-dark);
}

.my-post-meta {
    display: flex;
    align-items: center;
    gap: 15px;
    font-size: 13px;
    color: #888;
}

.my-post-date {
    display: flex;
    align-items: center;
    gap: 5px;
}

.my-post-date i {
    font-size: 12px;
}

.my-post-actions {
    display: flex;
    gap: 8px;
}

.my-post-actions .btn-edit,
.my-post-actions .btn-delete {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 6px 12px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 500;
    transition: all 0.2s;
}

.my-post-actions .btn-edit {
    background: var(--color-pink-light);
    color: var(--color-pink-dark);
    border: 1px solid var(--color-pink);
}

.my-post-actions .btn-edit:hover {
    background: var(--color-pink);
    color: #fff;
}

.my-post-actions .btn-delete {
    background: #fff;
    color: #d32f2f;
    border: 1px solid #ffcdd2;
}

.my-post-actions .btn-delete:hover {
    background: #d32f2f;
    color: #fff;
}

.my-post-content {
    padding: 20px;
}

.my-post-content-label {
    font-size: 12px;
    color: #888;
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 5px;
}

.my-post-content-text {
    font-size: 14px;
    color: var(--color-text);
    line-height: 1.7;
    white-space: pre-wrap;
    word-break: break-word;
}

/* 댓글 섹션 (내 글 조회용) */
.my-post-comments {
    border-top: 1px solid var(--color-border);
    padding: 15px 20px;
    background: #fefefe;
}

.my-post-comments-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
    cursor: pointer;
}

.my-post-comments-title {
    font-size: 14px;
    font-weight: 500;
    color: var(--color-text);
    display: flex;
    align-items: center;
    gap: 8px;
}

.comment-count-badge {
    background: var(--color-pink);
    color: #fff;
    font-size: 11px;
    padding: 2px 8px;
    border-radius: 10px;
    font-weight: 600;
}

.my-post-comments-toggle {
    font-size: 12px;
    color: var(--color-pink-dark);
    display: flex;
    align-items: center;
    gap: 4px;
}

.my-post-comments-list {
    margin-top: 15px;
    display: none;
}

.my-post-comments-list.show {
    display: block;
}

.my-comment-item {
    padding: 12px;
    background: #f9f9f9;
    border-radius: 6px;
    margin-bottom: 10px;
}

.my-comment-item.admin-comment {
    background: #fff5f5;
    border-left: 3px solid var(--color-pink);
}

.my-comment-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.my-comment-author {
    font-size: 13px;
    font-weight: 600;
    color: var(--color-text);
}

.my-comment-item.admin-comment .my-comment-author {
    color: var(--color-pink-dark);
}

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

.my-comment-content {
    font-size: 13px;
    color: var(--color-text);
    line-height: 1.6;
}

.my-comment-form {
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px dashed var(--color-border);
}

.my-comment-form textarea {
    width: 100%;
    padding: 10px;
    border: 1px solid var(--color-border);
    border-radius: 4px;
    font-size: 13px;
    resize: vertical;
    min-height: 60px;
}

.my-comment-form textarea:focus {
    outline: none;
    border-color: var(--color-pink);
}

.my-comment-form-row {
    display: flex;
    gap: 10px;
    margin-top: 10px;
}

.my-comment-form-row input {
    flex: 1;
    padding: 8px 10px;
    border: 1px solid var(--color-border);
    border-radius: 4px;
    font-size: 13px;
}

.my-comment-form-row input:focus {
    outline: none;
    border-color: var(--color-pink);
}

.my-comment-form-row .btn-comment-submit {
    padding: 8px 16px;
    background: var(--color-pink);
    color: #fff;
    border: none;
    border-radius: 4px;
    font-size: 13px;
    cursor: pointer;
    transition: background 0.2s;
}

.my-comment-form-row .btn-comment-submit:hover {
    background: var(--color-pink-dark);
}

.no-comments {
    text-align: center;
    color: #999;
    font-size: 13px;
    padding: 15px;
}

/* 내 글 조회 2열 그리드 레이아웃 */
.my-posts-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
    margin-bottom: 30px;
}

.my-posts-column {
    min-width: 0;
}

.my-posts-section h2 {
    display: flex;
    align-items: center;
    gap: 8px;
}

.my-posts-section h2 .total-count {
    font-size: 14px;
    font-weight: 400;
    color: #888;
}

/* 페이지네이션 스타일 */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 5px;
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid var(--color-border);
}

.page-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 32px;
    height: 32px;
    padding: 0 10px;
    border: 1px solid var(--color-border);
    border-radius: 4px;
    font-size: 13px;
    color: var(--color-text);
    background: #fff;
    transition: all 0.2s;
}

.page-btn:hover {
    border-color: var(--color-pink);
    color: var(--color-pink-dark);
}

.page-btn.active {
    background: var(--color-pink);
    border-color: var(--color-pink);
    color: #fff;
}

.page-btn.prev,
.page-btn.next {
    padding: 0 8px;
}

.page-btn i {
    font-size: 11px;
}

/* 폼 액션 가운데 정렬 */
.form-actions.center {
    justify-content: center;
}

/* 잠금 아이콘 */
.lock-icon {
    color: #999;
    font-size: 12px;
    margin-right: 6px;
}

/* 반응형: 모바일에서 1열로 변경 */
@media (max-width: 992px) {
    .my-posts-grid {
        grid-template-columns: 1fr;
        gap: 40px;
    }
}

@media (max-width: 768px) {
    .my-post-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }

    .my-post-meta {
        width: 100%;
        justify-content: space-between;
    }

    .my-post-actions {
        flex-wrap: wrap;
    }
}
