/* 🌐 기본 스타일 초기화 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body, html {
    font-family: 'Noto Sans KR', sans-serif;
    background-color: #f4f7fc;
    color: #333;
    line-height: 1.6;
}

/* 🏠 헤더 스타일 */
header {
    background-color: #2c3e50;
    color: white;
    padding: 20px 0;
    text-align: center;
}

header h1 {
    margin: 0;
    font-size: 24px;
    font-weight: bold;
}

/* ✅ 네비게이션 스타일 */
nav {
    margin-top: 20px;
    background-color: #34495e;
    padding: 10px;
    border-radius: 5px;
    display: flex;
    justify-content: center;
    gap: 10px;
}

nav a {
    text-decoration: none;
    color: white;
    padding: 10px 20px;
    border-radius: 5px;
    font-size: 14px;
    font-weight: bold;
    transition: background-color 0.3s;
}

nav a:hover {
    background-color: #2c3e50;
}

/* 📄 메인 섹션 */
main {
    max-width: 800px;
    margin: 20px auto;
    padding: 20px;
    background-color: white;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

h2 {
    margin-bottom: 20px;
    color: #2c3e50;
    font-size: 20px;
}

/* 📑 게시글 작성 폼 */
form {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 20px;
}

form input, form textarea {
    padding: 10px;
    font-size: 14px;
    border: 1px solid #ddd;
    border-radius: 5px;
}

form button {
    padding: 10px;
    background-color: #3498db;
    color: white;
    font-size: 16px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
}

form button:hover {
    background-color: #2980b9;
}

/* 💬 게시글 목록 */
.post-list {
    margin-top: 20px;
}

.post-list div {
    margin-bottom: 15px;
    padding: 15px;
    background-color: #f9f9f9;
    border-radius: 10px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

.post-list h3 {
    margin-bottom: 10px;
    color: #2c3e50;
    font-size: 18px;
}

.post-list p {
    margin-bottom: 10px;
    color: #555;
    font-size: 14px;
}

.post-list button {
    padding: 5px 10px;
    background-color: #e74c3c;
    color: white;
    font-size: 12px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
}

.post-list button:hover {
    background-color: #c0392b;
}

/* 🔄 페이징 버튼 스타일 */
.pagination {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-top: 20px;
}

.pagination button {
    padding: 8px 16px;
    background-color: #3498db;
    color: white;
    border: none;
    border-radius: 5px;
    font-size: 14px;
    cursor: pointer;
}

.pagination button:hover {
    background-color: #2980b9;
}

.pagination .disabled {
    background-color: #bdc3c7;
    cursor: not-allowed;
}

.pagination .current {
    background-color: #2c3e50;
}
/* 📱 반응형 디자인 (모바일 최적화) */
@media (max-width: 768px) {
    header {
        padding: 10px 0;
    }

    header h1 {
        font-size: 20px;
    }

    nav {
        flex-direction: column;
        gap: 5px;
    }

    nav a {
        padding: 8px 12px;
        font-size: 12px;
    }

    main {
        padding: 10px;
    }

    form input, form textarea {
        font-size: 12px;
        padding: 8px;
    }

    form button {
        font-size: 12px;
        padding: 8px;
    }

    .post-list div {
        padding: 10px;
    }

    .pagination button {
        padding: 6px 10px;
        font-size: 12px;
    }
}

/* 📱 초소형 기기 (스마트폰) */
@media (max-width: 480px) {
    header h1 {
        font-size: 18px;
    }

    nav a {
        font-size: 10px;
        padding: 6px 8px;
    }

    .post-list h3 {
        font-size: 16px;
    }

    .post-list p {
        font-size: 12px;
    }
}

/* 로그인 및 회원가입 버튼 스타일 */
.auth-buttons {
    margin-top: 20px;
}

.auth-buttons .btn {
    display: inline-block;
    padding: 10px 20px;
    margin: 5px;
    background-color: #4CAF50;
    color: white;
    text-decoration: none;
    border-radius: 5px;
    transition: background-color 0.3s ease;
}

.auth-buttons .btn:hover {
    background-color: #45a049;
}

/* 네비게이션 바 전체 */
.navbar {
    display: flex;
    justify-content: center; /* 모든 메뉴 중앙 정렬 */
    align-items: center; /* 세로 중앙 정렬 */
    padding: 10px 20px;
    gap: 20px; /* 메뉴 간 간격 */
    background-color: rgba(0, 0, 0, 0.171);
    color: white;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1); /* 살짝 그림자 효과 추가 */
}

/* 네비게이션 메뉴 */
.navbar a {
    text-decoration: none;
    color: white;
    padding: 8px 16px;
    border-radius: 4px;
    font-size: 14px;
    font-weight: bold;
    transition: background-color 0.3s ease;
}

/* hover 효과 */
.navbar a:hover {
    background-color: #555;
}

/* 오른쪽 버튼 */
.nav-right {
    display: flex;
    gap: 10px; /* 버튼 간격 */
}

/* 로그인/회원가입 버튼 */
.nav-right .btn {
    padding: 8px 16px;
    font-size: 14px;
    background-color: #555;
    color: white;
    text-decoration: none;
    border-radius: 4px;
    transition: background-color 0.3s ease;
}

.nav-right .btn:hover {
    background-color: #777;
}

.stats-container {
    display: flex;
    gap: 20px;
}

.stat-card {
    padding: 20px;
    background-color: #f8f9fa;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    text-align: center;
    width: 200px;
}

.stat-card h3 {
    margin-bottom: 10px;
}

.stat-card p {
    font-size: 24px;
    font-weight: bold;
    color: #007bff;
}

/* 드롭다운 메뉴 */
.dropdown {
    position: relative;
    display: inline-block;
}

.dropdown-menu {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    background-color: white;
    border: 1px solid #ddd;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
    z-index: 1000;
    min-width: 150px;
    border-radius: 5px;
}

.dropdown-menu a {
    color: #333;
    padding: 10px 15px;
    text-decoration: none;
    display: block;
    transition: background-color 0.2s ease;
}

.dropdown-menu a:hover {
    background-color: #f0f0f0;
}

.dropdown:hover .dropdown-menu {
    display: block;
}

.search-bar {
    margin-bottom: 20px;
    text-align: center;
}

.search-bar input[type="text"] {
    width: 300px;
    padding: 5px;
    font-size: 14px;
    border: 1px solid #ccc;
    border-radius: 5px;
}

.search-bar button {
    padding: 5px 10px;
    font-size: 14px;
    background-color: #007bff;
    color: #fff;
    border: none;
    border-radius: 5px;
    cursor: pointer;
}

.search-bar button:hover {
    background-color: #0056b3;
}

.flash-messages {
    margin: 20px auto;
    max-width: 800px;
    padding: 10px;
    text-align: center;
}

.alert {
    padding: 10px 15px;
    border-radius: 5px;
    margin-bottom: 10px;
    font-size: 14px;
}

.alert-success {
    background-color: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.alert-danger {
    background-color: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.comment-count {
    font-size: 12px;
    color: #888;
    margin-left: 5px;
}

.new-post {
    display: inline-block;
    margin-left: 5px;
    padding: 2px 5px;
    font-size: 12px;
    font-weight: bold;
    color: #fff;
    background-color: #f00;
    border-radius: 3px;
}

/* 버튼 크기 조정 */
.btn-search {
    padding: 6px 12px;
    font-size: 14px;
    border: 1px solid #ccc;
    border-radius: 4px;
    background-color: #007bff;
    color: white;
    cursor: pointer;
    width: 80px; /* 버튼 너비를 고정 */
    height: 36px;
}

/* 호버 효과 */
.btn-search:hover {
    background-color: #0056b3;
}

.post-meta {
    display: flex;             /* Flexbox 활성화 */
    gap: 10px;                 /* 작성일과 작성자 사이 간격 */
    justify-content: flex-start; /* 왼쪽 정렬 */
    align-items: center;       /* 세로 정렬 (중앙) */
    margin-top: 10px;          /* 위쪽 여백 */
    font-size: 14px;           /* 텍스트 크기 */
    color: #555;               /* 텍스트 색상 */
}

/* 구분선 스타일 */
.post-divider {
    border: 0;                   /* 기본 테두리 제거 */
    height: 1px;                 /* 선의 두께 */
    background: #ccc;            /* 선의 색상 */
    margin: 20px 0;              /* 위아래 여백 */
}

/* 사이드바 사진 */
.sidebar-images {
    position: fixed;
    top: 50%;
    transform: translateY(-50%);
    right: 20px;
    display: flex;
    flex-direction: column;
    gap: 15px; /* 이미지와 텍스트 간격 조절 */
    z-index: 1000;
    text-align: center;
}

.image-box {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.image-box img {
    width: 150px;
    height: auto;
    border-radius: 10px;
    box-shadow: 2px 2px 10px rgba(0, 0, 0, 0.3);
    transition: 0.3s;
}

.image-box img:hover {
    opacity: 0.8;
}

.image-box p {
    margin: 5px 0 0;
    font-size: 14px;
    font-weight: bold;
}

.image-box p a {
    text-decoration: none;
    color: #ff5e00; /* 링크 색상 */
}

.image-box p a:hover {
    text-decoration: underline;
}

body {
    font-family: 'Arial', sans-serif;
    background-color: #f4f4f4;
    margin: 0;
    padding: 20px;
    text-align: center;
}

h2 {
    color: #333;
}

#live_prices_section {
    background: white;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0px 0px 10px rgba(0, 0, 0, 0.1);
    max-width: 800px;
    margin: 0 auto;
}

input, button {
    padding: 10px;
    margin: 5px;
    border-radius: 5px;
    border: 1px solid #ccc;
    font-size: 16px;
}

button {
    background: #007bff;
    color: white;
    cursor: pointer;
    border: none;
}

button:hover {
    background: #0056b3;
}

table {
    width: 100%;
    margin-top: 20px;
    border-collapse: collapse;
}

th, td {
    padding: 12px;
    border-bottom: 1px solid #ddd;
    text-align: center;
}

th {
    background-color: #007bff;
    color: white;
}

td {
    font-size: 18px;
}

.price-up {
    color: green;
    font-weight: bold;
}

.price-down {
    color: red;
    font-weight: bold;
}

@media screen and (max-width: 600px) {
    table {
        font-size: 14px;
    }

    input, button {
        font-size: 14px;
        padding: 8px;
    }
}
