* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Arial', sans-serif;
    background: linear-gradient(135deg, #ff9ec7, #ffc9dd);
    min-height: 100vh;
}

.header {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-bottom: 2px solid #ff9ec7;
    box-shadow: 0 4px 20px rgba(255, 158, 199, 0.3);
}

.top-bar {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    padding: 20px 40px;
    max-width: 1200px;
    margin: 0 auto;
}

.logo {
    display: flex;
    align-items: center;
    gap: 15px;
    font-size: 32px;
    font-weight: bold;
    color: #e91e63;
    text-decoration: none;
    transition: transform 0.3s ease;
}

.logo:hover {
    transform: scale(1.05);
}

.logo-text {
    font-size: 36px;
    font-weight: 900;
    background: linear-gradient(45deg, #e91e63, #ff5722);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    text-shadow: 2px 2px 4px rgba(233, 30, 99, 0.3);
}

/* =====================================================
로고 가챠 머신 아이콘 (main.css에서 복사)
===================================================== */
.gacha-machine {
    width: 60px;
    height: 80px;
    position: relative;
    animation: bounce 2s infinite;
    margin-left: 10px;
    /* 로고 텍스트와의 간격 */
}

@keyframes bounce {

    0%,
    20%,
    50%,
    80%,
    100% {
        transform: translateY(0);
    }

    40% {
        transform: translateY(-10px);
    }

    60% {
        transform: translateY(-5px);
    }
}

.machine-top {
    width: 50px;
    height: 15px;
    background: linear-gradient(45deg, #1565c0, #0d47a1);
    border-radius: 10px 10px 5px 5px;
    border: 3px solid #0d47a1;
    position: relative;
}

.machine-top::before {
    content: '';
    position: absolute;
    top: 3px;
    left: 5px;
    width: 8px;
    height: 3px;
    background: #ffebee;
    border-radius: 2px;
}

.machine-top::after {
    content: '';
    position: absolute;
    top: 8px;
    left: 5px;
    width: 35px;
    height: 2px;
    background: #e53935;
}

.machine-body {
    width: 50px;
    height: 40px;
    background: linear-gradient(45deg, #4dd0e1, #26c6da);
    border: 3px solid #0d47a1;
    border-radius: 5px;
    position: relative;
    margin-top: -2px;
}

.machine-window {
    position: absolute;
    top: 5px;
    left: 8px;
    width: 30px;
    height: 25px;
    background: rgba(255, 255, 255, 0.9);
    border-radius: 3px;
    border: 2px solid #0d47a1;
}

.machine-ball {
    position: absolute;
    top: 8px;
    left: 12px;
    width: 15px;
    height: 15px;
    background: linear-gradient(45deg, #ffd54f, #ffb300);
    border-radius: 50%;
    border: 2px solid #0d47a1;
}

.machine-ball::after {
    content: '';
    position: absolute;
    top: 6px;
    left: 0;
    width: 100%;
    height: 1px;
    background: #e53935;
}

.machine-controls {
    width: 50px;
    height: 20px;
    background: linear-gradient(45deg, #e53935, #c62828);
    border: 3px solid #0d47a1;
    border-radius: 0 0 8px 8px;
    position: relative;
    margin-top: -2px;
}

.control-button {
    position: absolute;
    top: 3px;
    left: 8px;
    width: 12px;
    height: 12px;
    background: #ffebee;
    border-radius: 50%;
    border: 2px solid #0d47a1;
}

.control-knob {
    position: absolute;
    top: 5px;
    right: 8px;
    width: 8px;
    height: 8px;
    background: #90a4ae;
    border-radius: 50%;
    border: 2px solid #0d47a1;
}


.auth-buttons {
    display: flex;
    gap: 15px;
}

.btn {
    padding: 12px 24px;
    border: none;
    border-radius: 25px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    display: inline-block;
    text-align: center;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.btn-login {
    background: transparent;
    color: #e91e63;
    border: 2px solid #e91e63;
}

.btn-login:hover {
    background: #e91e63;
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(233, 30, 99, 0.3);
}

.btn-signup {
    background: linear-gradient(45deg, #e91e63, #ff5722);
    color: white;
}

.btn-signup:hover {
    background: linear-gradient(45deg, #c2185b, #e64a19);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(233, 30, 99, 0.4);
}

.welcome-message {
    color: #e91e63;
    font-weight: bold;
    align-self: center;
}

.nav-menu {
    background: rgba(255, 255, 255, 0.9);
    border-top: 1px solid #ffcdd2;
    padding: 0 40px;
    max-width: 1200px;
    margin: 0 auto;
}

.nav-list {
    display: flex;
    list-style: none;
    gap: 40px;
    padding: 15px 0;
}

.nav-item a {
    color: #e91e63;
    text-decoration: none;
    font-weight: 600;
    font-size: 16px;
    padding: 10px 15px;
    border-radius: 20px;
    transition: all 0.3s ease;
    position: relative;
}

.nav-item a::before {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 50%;
    width: 0;
    height: 2px;
    background: linear-gradient(45deg, #e91e63, #ff5722);
    transition: all 0.3s ease;
    transform: translateX(-50%);
}

.nav-item a:hover {
    background: rgba(233, 30, 99, 0.1);
    color: #c2185b;
    transform: translateY(-2px);
}

.nav-item a:hover::before {
    width: 100%;
}

.nav-item a.active {
    background: rgba(233, 30, 99, 0.1);
    color: #c2185b;
}

.nav-item a.active::before {
    width: 100%;
}

.main-content {
    background: white;
    min-height: calc(100vh - 200px);
    padding: 40px;
    max-width: 1200px;
    margin: 0 auto;
    border-radius: 20px 20px 0 0;
    box-shadow: 0 -10px 30px rgba(0, 0, 0, 0.1);
}

/* 게시판 스타일 */
.board-container {
    width: 100%;
}

.board-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 3px solid #ff9ec7;
}

.board-title {
    font-size: 28px;
    font-weight: bold;
    background: linear-gradient(45deg, #e91e63, #ff5722);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.btn-write {
    background: linear-gradient(45deg, #e91e63, #ff5722);
    color: white;
    padding: 12px 24px;
    border: none;
    border-radius: 25px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(233, 30, 99, 0.3);
}

.btn-write:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(233, 30, 99, 0.4);
}

/* 글 작성 폼 */
.write-form {
    background: rgba(255, 158, 199, 0.1);
    border: 2px solid #ff9ec7;
    border-radius: 15px;
    padding: 25px;
    margin-bottom: 30px;
    animation: slideDown 0.3s ease;
}

select.form-input {
    color: #e91e63;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.form-title {
    color: #e91e63;
    font-size: 20px;
    font-weight: bold;
    margin-bottom: 20px;
}

.form-group {
    margin-bottom: 15px;
}

.form-input {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid #ffcdd2;
    border-radius: 10px;
    font-size: 14px;
    transition: all 0.3s ease;
    background: white;
}

.form-input:focus {
    outline: none;
    border-color: #e91e63;
    box-shadow: 0 0 10px rgba(233, 30, 99, 0.2);
}

.form-textarea {
    width: 100%;
    min-height: 120px;
    padding: 12px 15px;
    border: 2px solid #ffcdd2;
    border-radius: 10px;
    font-size: 14px;
    font-family: inherit;
    resize: vertical;
    transition: all 0.3s ease;
    background: white;
}

.form-textarea:focus {
    outline: none;
    border-color: #e91e63;
    box-shadow: 0 0 10px rgba(233, 30, 99, 0.2);
}

.form-buttons {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
}

.btn-submit {
    background: linear-gradient(45deg, #e91e63, #ff5722);
    color: white;
}

.btn-cancel {
    background: #f5f5f5;
    color: #666;
    border: 2px solid #ddd;
}

.btn-submit:hover {
    background: linear-gradient(45deg, #c2185b, #e64a19);
}

.btn-cancel:hover {
    background: #e0e0e0;
    border-color: #bbb;
}

/* 게시글 목록 */
.post-list {
    margin-bottom: 30px;
}

.post-item {
    background: white;
    border: 2px solid #ffcdd2;
    border-radius: 15px;
    padding: 20px;
    margin-bottom: 15px;
    transition: all 0.3s ease;
    cursor: pointer;
}

.post-item:hover {
    border-color: #ff9ec7;
    box-shadow: 0 5px 20px rgba(255, 158, 199, 0.2);
    transform: translateY(-2px);
}

.post-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.post-title {
    color: #e91e63;
    font-size: 18px;
    font-weight: bold;
    margin: 0;
}

.post-date {
    color: #999;
    font-size: 12px;
}

.post-meta {
    display: flex;
    gap: 15px;
    margin-bottom: 10px;
    font-size: 12px;
    color: #666;
}

.post-author {
    font-weight: 600;
    color: #e91e63;
}

.post-preview {
    color: #333;
    line-height: 1.5;
    font-size: 14px;
}

/* 페이지네이션 */
.pagination {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-top: 30px;
}

.page-btn {
    padding: 8px 15px;
    border: 2px solid #ffcdd2;
    background: white;
    color: #e91e63;
    border-radius: 20px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s ease;
}

.page-btn:hover {
    background: #ff9ec7;
    color: white;
    border-color: #ff9ec7;
}

.page-btn.active {
    background: linear-gradient(45deg, #e91e63, #ff5722);
    color: white;
    border-color: transparent;
}

.page-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* 미디어 업로드 스타일 */
.media-upload-label {
    display: inline-block;
    padding: 12px 20px;
    background: linear-gradient(45deg, #ff9ec7, #ffc9dd);
    color: #e91e63;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s ease;
    border: 2px solid #ff9ec7;
    font-weight: 600;
}

.media-upload-label:hover {
    background: linear-gradient(45deg, #e91e63, #ff5722);
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(233, 30, 99, 0.3);
}

.upload-icon {
    font-size: 18px;
    margin-right: 8px;
}

.media-upload-input {
    display: none;
}

.media-preview {
    margin-top: 15px;
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
}

.media-item {
    position: relative;
    display: inline-block;
    /* 요소를 인라인 블록으로 설정 */
    margin: 5px;
    width: 150px;
    height: 150px;
    border-radius: 10px;
    overflow: hidden;
    border: 2px solid #ffcdd2;
}

.media-item img,
.media-item video {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* 'X' 버튼 스타일 */
.media-remove {
    position: absolute;
    /* 부모 요소 기준 절대 위치 */
    top: 5px;
    /* 상단에서 5px */
    right: 5px;
    /* 오른쪽에서 5px */
    background-color: rgba(0, 0, 0, 0.6);
    /* 반투명 검은색 배경 */
    color: white;
    /* 흰색 텍스트 */
    border: none;
    border-radius: 50%;
    /* 원형 모양 */
    width: 20px;
    height: 20px;
    font-size: 14px;
    line-height: 20px;
    /* 텍스트 세로 중앙 정렬 */
    text-align: center;
    /* 텍스트 가로 중앙 정렬 */
    cursor: pointer;
    /* 마우스 커서를 포인터로 변경 */
    font-weight: bold;
    padding: 0;
    z-index: 10;
    /* 다른 요소 위에 표시되도록 z-index 설정 */
    display: flex;
    /* flexbox로 중앙 정렬 (line-height 대안) */
    align-items: center;
    justify-content: center;
}

/* 'X' 버튼에 마우스를 올렸을 때 스타일 */
.media-remove:hover {
    background-color: rgba(255, 0, 0, 0.8);
    /* 더 진한 빨간색 배경 */
}

/* 게시물 상세 페이지 스타일 */
.post-detail {
    background: white;
    border-radius: 15px;
    padding: 25px;
    margin-bottom: 30px;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.1);
}

/* 게시물 작업 버튼 */
.post-actions {
    display: flex;
    gap: 10px;
    margin-top: 20px;
    justify-content: flex-end;
}

.btn-edit,
.btn-delete {
    padding: 8px 16px;
    border: none;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-edit {
    background: #4caf50;
    color: white;
}

.btn-edit:hover {
    background: #45a049;
    transform: translateY(-2px);
}

.btn-delete {
    background: #f44336;
    color: white;
}

.btn-delete:hover {
    background: #da190b;
    transform: translateY(-2px);
}

/* 댓글 섹션 */
.comments-section {
    margin-top: 30px;
    border-top: 2px solid #ffcdd2;
    padding-top: 20px;
}

.comments-title {
    color: #e91e63;
    font-size: 18px;
    font-weight: bold;
    margin-bottom: 20px;
}

.comment-form {
    background: rgba(255, 158, 199, 0.1);
    border: 2px solid #ffcdd2;
    border-radius: 10px;
    padding: 15px;
    margin-bottom: 20px;
}

.comment-input {
    width: 100%;
    padding: 10px;
    border: 2px solid #ffcdd2;
    border-radius: 8px;
    font-size: 14px;
    margin-bottom: 10px;
    background: white;
}

#editMediaPreview {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    max-width: 100%;
}

#editMediaPreview img {
    width: 100%;
    /* 혹은 고정 크기: 예) width: 200px; */
    max-width: 300px;
    height: auto;
    object-fit: cover;
    border-radius: 8px;
}

.comment-input:focus {
    outline: none;
    border-color: #e91e63;
}

.comment-textarea {
    width: 100%;
    min-height: 80px;
    padding: 10px;
    border: 2px solid #ffcdd2;
    border-radius: 8px;
    font-size: 14px;
    font-family: inherit;
    resize: vertical;
    background: white;
}

.comment-textarea:focus {
    outline: none;
    border-color: #e91e63;
}

.comment-submit {
    background: linear-gradient(45deg, #e91e63, #ff5722);
    color: white;
    padding: 8px 16px;
    border: none;
    border-radius: 20px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.comment-submit:hover {
    background: linear-gradient(45deg, #c2185b, #e64a19);
    transform: translateY(-2px);
}

.comments-list {
    margin-top: 20px;
}

.comment-item {
    background: white;
    border: 1px solid #ffcdd2;
    border-radius: 10px;
    padding: 15px;
    margin-bottom: 10px;
}

.comment-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.comment-author {
    color: #e91e63;
    font-weight: 600;
    font-size: 14px;
}

.comment-date {
    color: #999;
    font-size: 12px;
}

.comment-text {
    color: #333;
    font-size: 14px;
    line-height: 1.5;
}

.comment-actions {
    display: flex;
    gap: 5px;
    align-items: center;
}

.btn-comment-delete {
    background: #f44336;
    color: white;
    border: none;
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 11px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-comment-delete:hover {
    background: #da190b;
    transform: translateY(-1px);
}

/* 수정 폼 */
.edit-form {
    background: rgba(76, 175, 80, 0.1);
    border: 2px solid #4caf50;
    border-radius: 15px;
    padding: 25px;
    margin-bottom: 30px;
}

.edit-form .form-title {
    color: #4caf50;
}

.post-detail-header {
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 2px solid #ffcdd2;
}

select.form-input {
    color: #e91e63;
}

.btn-back {
    background: #f5f5f5;
    color: #666;
    border: 2px solid #ddd;
    padding: 10px 20px;
    border-radius: 20px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s ease;
}

.btn-back:hover {
    background: #e0e0e0;
    border-color: #bbb;
    transform: translateY(-2px);
}

.post-detail-title {
    color: #e91e63;
    font-size: 24px;
    font-weight: bold;
    margin-bottom: 15px;
    line-height: 1.4;
}

.post-detail-meta {
    display: flex;
    gap: 20px;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 1px solid #ffcdd2;
    font-size: 14px;
}

.post-detail-author {
    color: #e91e63;
    font-weight: 600;
}

.post-detail-date,
.post-detail-views {
    color: #999;
}

.post-detail-media {
    margin-bottom: 20px;
}

.post-detail-media img,
.post-detail-media video {
    max-width: 100%;
    height: auto;
    border-radius: 10px;
    margin: 5px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.post-detail-text {
    color: #333;
    line-height: 1.6;
    font-size: 16px;
    white-space: pre-wrap;
}

@media (max-width: 768px) {
    .top-bar {
        padding: 15px 20px;
        flex-direction: row;
        align-items: flex-start;
        gap: 10px;
    }

    .nav-menu {
        padding: 0 20px;
    }

    .nav-list {
        flex-wrap: wrap;
        gap: 20px;
        justify-content: center;
    }

    .main-content {
        padding: 20px;
        margin: 0 10px;
    }

    .logo-text {
        font-size: 28px;
    }

    .modal {
        margin: 20px;
        padding: 30px;
    }

    .board-header {
        flex-direction: column;
        gap: 15px;
        align-items: stretch;
    }

    .board-title {
        text-align: center;
    }

    .post-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 5px;
    }

    .form-buttons {
        flex-direction: column;
    }
}

.post-tag {
    display: inline-block;
    margin-right: 8px;
    padding: 2px 8px;
    font-size: 12px;
    font-weight: bold;
    color: white;
    background: linear-gradient(45deg, #e91e63, #ff5722);
    border-radius: 10px;
}


.like-button {
    background: none;
    border: none;
    font-size: 20px;
    cursor: pointer;
    color: #e91e63;
    display: flex;
    align-items: center;
    gap: 5px;
}

.like-button:hover {
    transform: scale(1.1);
}

.like-count {
    font-size: 14px;
    color: #e91e63;
    font-weight: bold;
}

/* 좋아요 상태별 하트 표시 */
.like-button.liked::before {
    content: "❤️";
}

.like-button.not-liked::before {
    content: "🤍";
}

.heart-icon {
    font-size: 20px;
    color: #e91e63;
}

/* 모달 오버레이 */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(5px);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    animation: fadeIn 0.3s ease;
}

.modal-overlay.active {
    display: flex;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

/* 모달 박스 */
.modal {
    background: white;
    padding: 40px;
    border-radius: 20px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.2);
    width: 100%;
    max-width: 400px;
    position: relative;
    animation: slideUp 0.3s ease;
}

@keyframes slideUp {
    from {
        transform: translateY(50px);
        opacity: 0;
    }

    to {
        transform: translateY(0);
        opacity: 1;
    }
}

/* 모달 닫기 버튼 */
.modal-close {
    position: absolute;
    top: 15px;
    right: 20px;
    background: none;
    border: none;
    font-size: 24px;
    color: #999;
    cursor: pointer;
    transition: color 0.3s ease;
}

.modal-close:hover {
    color: #e91e63;
}

/* 모달 제목 */
.modal-title {
    text-align: center;
    font-size: 28px;
    font-weight: 700;
    color: #e91e63;
    margin-bottom: 30px;
    background: linear-gradient(45deg, #e91e63, #ff5722);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* 폼 요소 */
.form-group {
    margin-bottom: 20px;
}

.form-label {
    display: block;
    margin-bottom: 8px;
    color: #333;
    font-weight: 600;
    font-size: 14px;
}

.form-input {
    width: 100%;
    padding: 15px;
    border: 2px solid #e0e0e0;
    border-radius: 12px;
    font-size: 16px;
    transition: all 0.3s ease;
    background: #fafafa;
}

.form-input:focus {
    outline: none;
    border-color: #e91e63;
    background: white;
    box-shadow: 0 0 0 3px rgba(233, 30, 99, 0.1);
}

.form-input::placeholder {
    color: #999;
}

.form-note {
    color: #999;
}

/* 폼 제출 버튼 */
.form-btn {
    width: 100%;
    padding: 15px;
    background: linear-gradient(45deg, #e91e63, #ff5722);
    color: white;
    border: none;
    border-radius: 12px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    margin: 20px 0;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(233, 30, 99, 0.3);
}

.form-btn:hover {
    background: linear-gradient(45deg, #c2185b, #e64a19);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(233, 30, 99, 0.4);
}

/* 모달 내 텍스트 링크 */
.switch-link {
    text-align: center;
    padding-top: 20px;
    border-top: 1px solid #eee;
    margin-top: 20px;
}

.switch-text {
    color: #666;
    font-size: 14px;
}

.switch-btn {
    color: #e91e63;
    background: none;
    border: none;
    font-weight: 600;
    margin-left: 5px;
    transition: color 0.3s ease;
    cursor: pointer;
    font-size: 14px;
}

.switch-btn:hover {
    color: #c2185b;
    text-decoration: underline;
}

.form-links {
    display: flex;
    justify-content: space-between;
    margin: 20px 0;
}

.form-link {
    color: #e91e63;
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    transition: color 0.3s ease;
}

.form-link:hover {
    color: #c2185b;
    text-decoration: underline;
}

.btn-small {
    padding: 6px 14px;
    font-size: 14px;
    height: 40px;
    background: #e91e63;
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    white-space: nowrap;
    display: inline-block;
    flex-shrink: 0;
}