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

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #f8f9fa;
}

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

.market-header {
    background-color: #fff;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    padding: 1rem 0;
    width: 100%;
}

.market-header .container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 15px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    display: flex;
    align-items: center;
}

.logo a {
    color: #333;
    text-decoration: none;
    font-size: 1.5rem;
    font-weight: bold;
    white-space: nowrap;
}

.nav {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-left: auto;
}

/* 버튼 */
.btn {
    display: inline-block;
    padding: 0.5rem 1rem;
    border-radius: 4px;
    text-decoration: none;
    cursor: pointer;
    border: none;
    font-size: 1rem;
    transition: background-color 0.2s;
}

.btn-primary {
    background-color: #007bff;
    color: #fff;
}

.btn-primary:hover {
    background-color: #0056b3;
}

.btn-secondary {
    background-color: #6c757d;
    color: #fff;
}

.btn-secondary:hover {
    background-color: #545b62;
}

.btn-danger {
    background-color: #dc3545;
    color: #fff;
}

.btn-danger:hover {
    background-color: #c82333;
}

.btn-google {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background-color: #fff;
    color: #333;
    border: 1px solid #ddd;
}

.btn-google:hover {
    background-color: #f8f9fa;
}

.btn-google img {
    width: 18px;
    height: 18px;
}

.btn-naver {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background-color: #03C75A;
    color: #fff;
    border: none;
}

.btn-naver:hover {
    background-color: #02b351;
}

.btn-naver img {
    width: 18px;
    height: 18px;
}

/* 사용자 메뉴 */
.user-menu {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    white-space: nowrap;
}

.profile-image {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
}

.nickname {
    font-weight: 500;
    margin-right: 0.5rem;
}

/* 검색 필터 */
.search-filter {
    background-color: #fff;
    padding: 1rem;
    border-radius: 4px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    margin: 1rem 0;
}

.search-form {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    align-items: center;
}

.search-form input[type="text"],
.search-form select {
    padding: 0.5rem;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 1rem;
    min-width: 120px;
}

.search-form input[type="text"] {
    flex: 1;
    min-width: 150px;
}

.search-form select {
    width: auto;
    min-width: 100px;
}

.search-form button {
    padding: 0.5rem 1rem;
    background-color: #007bff;
    color: #fff;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 1rem;
    white-space: nowrap;
}

.search-form button:hover {
    background-color: #0056b3;
}

/* 게시글 그리드 */
.posts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 1rem;
    margin: 1rem 0;
}

.post-card {
    background-color: #fff;
    border-radius: 4px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    overflow: hidden;
    transition: transform 0.2s;
}

.post-card:hover {
    transform: translateY(-2px);
}

.post-link {
    text-decoration: none;
    color: inherit;
}

.post-image {
    position: relative;
    width: 100%;
    height: 200px;
    overflow: hidden;
}

.post-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
}

.post-info {
    padding: 1rem;
}

.post-title {
    font-size: 1rem;
    margin-bottom: 0.5rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.post-price {
    font-weight: bold;
    color: #007bff;
    margin-bottom: 0.5rem;
}

.post-meta {
    display: flex;
    justify-content: space-between;
    font-size: 0.875rem;
    color: #6c757d;
}

/* 페이지네이션 */
.pagination {
    display: flex;
    justify-content: center;
    gap: 0.5rem;
    margin: 2rem 0;
}

.pagination a {
    padding: 0.5rem 1rem;
    border: 1px solid #ddd;
    border-radius: 4px;
    text-decoration: none;
    color: #333;
}

.pagination a:hover {
    background-color: #f8f9fa;
}

.pagination .active {
    background-color: #007bff;
    color: #fff;
    border-color: #007bff;
}

/* 게시글 상세 */
.post-detail {
    background-color: #fff;
    border-radius: 4px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    padding: 2rem;
    margin: 1rem 0;
}

.post-header {
    margin-bottom: 2rem;
}

.post-header .post-title {
    font-size: 1.5rem;
    margin-bottom: 1rem;
}

.post-images {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    margin-bottom: 2rem;
}

.post-image {
    position: relative;
    width: 100%;
    height: 200px;
    overflow: hidden;
}

.post-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
}

.post-body {
    margin-top: 2rem;
    position: relative;
    z-index: 1;
}

.post-description {
    white-space: pre-wrap;
    line-height: 1.6;
}

.post-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 1rem;
    border-top: 1px solid #ddd;
}

.post-author {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    background-color: #f8f9fa;
    border-radius: 4px;
}

.author-image {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    object-fit: cover;
}

/* 폼 */
.write-form {
    background-color: #fff;
    border-radius: 4px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    padding: 2rem;
    margin: 1rem 0;
}

.form-group {
    margin-bottom: 1.5rem;
}

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

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 0.5rem;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 1rem;
}

.form-group textarea {
    resize: vertical;
    min-height: 200px;
}

.image-preview-container {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin: 10px 0;
}

.image-preview {
    position: relative;
    display: inline-block;
    margin: 5px;
}

.image-preview img {
    max-width: 200px;
    max-height: 200px;
    object-fit: cover;
    border-radius: 4px;
}

.remove-image {
    position: absolute;
    top: -10px;
    right: -10px;
    background: red;
    color: white;
    border: none;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    line-height: 1;
}

.remove-image:hover {
    background: darkred;
}

/* 로그인 */
.login-form {
    max-width: 400px;
    margin: 2rem auto;
    background-color: #fff;
    border-radius: 4px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    padding: 2rem;
}

.login-description {
    text-align: center;
    margin-bottom: 2rem;
}

.login-options {
    margin-bottom: 2rem;
}

.login-info {
    background-color: #f8f9fa;
    padding: 1rem;
    border-radius: 4px;
}

.login-info ul {
    list-style: none;
    margin-top: 0.5rem;
}

.login-info li {
    margin-bottom: 0.5rem;
    padding-left: 1.5rem;
    position: relative;
}

.login-info li:before {
    content: "✓";
    position: absolute;
    left: 0;
    color: #28a745;
}

/* 에러/성공 페이지 */
.error-page,
.success-page {
    max-width: 600px;
    margin: 4rem auto;
    text-align: center;
}

.error-content,
.success-content {
    background-color: #fff;
    border-radius: 4px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    padding: 2rem;
}

.error-message,
.success-message {
    margin: 1rem 0 2rem;
    color: #6c757d;
}

.error-actions,
.success-actions {
    display: flex;
    justify-content: center;
    gap: 1rem;
}

/* 로딩 스피너 */
#loading {
    display: none;
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 50px;
    height: 50px;
    border: 5px solid #f3f3f3;
    border-top: 5px solid #007bff;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: translate(-50%, -50%) rotate(0deg); }
    100% { transform: translate(-50%, -50%) rotate(360deg); }
}

/* 반응형 */
@media (max-width: 768px) {
    .market-header .container {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }
    
    .nav {
        width: 100%;
        justify-content: space-between;
        margin-left: 0;
    }
    
    .user-menu {
        flex-shrink: 0;
    }

    .btn-primary {
        margin-right: auto;
    }
    
    .search-form {
        flex-wrap: nowrap;
        gap: 0.5rem;
    }
    
    .search-form input[type="text"] {
        min-width: 0;
        flex: 1;
    }
    
    .search-form #select_category {
        min-width: 30px;
        max-width: 66px;
    }
    .search-form #select_status {
        min-width: 40px;
        max-width: 80px;
    }
    .search-form button {
        padding: 0.5rem;
        font-size: 0.9rem;
    }
    
    .post-footer {
        flex-direction: column;
        gap: 1rem;
    }
    
    .post-actions {
        display: flex;
        gap: 10px;
        width: 100%;
    }

    .post-actions .btn {
        flex: 1;
        margin: 0;
        text-align: center;
        display: flex;
        align-items: center;
        justify-content: center;
    }

    .posts-grid {
        grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
        gap: 0.5rem;
    }
}

.post-thumbnail {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* style.css에 추가 */
.loading-spinner {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 9999;
    justify-content: center;
    align-items: center;
}

.spinner {
    width: 50px;
    height: 50px;
    border: 5px solid #f3f3f3;
    border-top: 5px solid #3498db;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Footer 스타일 */
.market-footer {
    margin-top: 3rem;
    padding: 2rem 0;
    background-color: #f8f9fa;
    border-top: 1px solid #e9ecef;
    width: 100%;
}

.market-footer .container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 15px;
}

.footer-content {
    max-width: 800px;
    margin: 0 auto;
    text-align: center;
    font-size: 0.9rem;
    line-height: 1.6;
    color: #495057;
}

.footer-content p {
    margin-bottom: 1rem;
}

.footer-content p:last-child {
    margin-bottom: 0;
}

.footer-content strong {
    color: #343a40;
    font-weight: 600;
}

.footer-content .warning {
    color: #dc3545;
    font-weight: 500;
}

/* 로그인 페이지 footer 스타일 */
.login-footer {
    margin-top: 2rem;
    padding: 1.5rem 0;
    background-color: #f8f9fa;
    border-top: 1px solid #e9ecef;
    width: 100%;
}

.login-footer .container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 15px;
}

.login-footer .footer-content {
    max-width: 600px;
    margin: 0 auto;
    font-size: 0.85rem;
}

/* 이미지 슬라이더 스타일 */
.image-slider {
    position: relative;
    width: 100%;
    margin-bottom: 2rem;
}

.slider-container {
    position: relative;
    width: 100%;
    height: 500px;
    overflow: hidden;
}

.slider-image {
    width: 100%;
    height: 100%;
    object-fit: contain;
    background-color: #f8f9fa;
}

.slider-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 40px;
    height: 40px;
    background: rgba(0, 0, 0, 0.5);
    color: white;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    z-index: 2;
}

.slider-prev {
    left: 10px;
}

.slider-next {
    right: 10px;
}

.slider-thumbnails {
    display: flex;
    gap: 10px;
    margin-top: 10px;
    overflow-x: auto;
    padding: 10px 0;
}

.thumbnail {
    width: 80px;
    height: 80px;
    object-fit: cover;
    border-radius: 4px;
    cursor: pointer;
    opacity: 0.6;
    transition: opacity 0.3s;
}

.thumbnail.active {
    opacity: 1;
    border: 2px solid #007bff;
}

/* 모달 스타일 */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
    z-index: 1000;
}

.modal-content {
    position: relative;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-image {
    max-width: 90%;
    max-height: 90vh;
    object-fit: contain;
}

.modal-close {
    position: absolute;
    top: 20px;
    right: 20px;
    color: white;
    font-size: 30px;
    cursor: pointer;
    background: none;
    border: none;
}

.modal-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 50px;
    height: 50px;
    background: rgba(255, 255, 255, 0.2);
    color: white;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
}

.modal-prev {
    left: 20px;
}

.modal-next {
    right: 20px;
} 

.bump-button {
    background-color: #4CAF50;
    color: white;
    border: none;
    padding: 5px 10px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 12px;
    margin-top: 5px;
    transition: background-color 0.3s;
}

.bump-button:hover {
    background-color: #45a049;
}

.status-badge {
    position: absolute;
    top: 10px;
    right: 10px;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: bold;
    color: white;
    z-index: 1;
}

.status-badge.selling {
    background-color: #28a745;
}

.status-badge.sold {
    background-color: #dc3545;
} 
