/**
 * 평창군건강협의체건강위원회 스타일시트
 */

/* ========== 기본 설정 ========== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-color: #00A5A5;
    --secondary-color: #00CED1;
    --accent-color: #00B8B8;
    --text-color: #333;
    --text-light: #666;
    --border-color: #e0e0e0;
    --bg-color: #fff;
    --bg-light: #f8f9fa;
    --bg-dark: #f5f5f5;
    --header-bg: #fff;
    --shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    --shadow-hover: 0 4px 12px rgba(0, 0, 0, 0.12);
}

body {
    font-family: 'Noto Sans KR', -apple-system, BlinkMacSystemFont, 'Malgun Gothic', sans-serif;
    line-height: 1.6;
    color: var(--text-color);
    background-color: var(--bg-light);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

a {
    color: inherit;
    text-decoration: none;
    transition: all 0.3s;
}

/* ========== 최상단 바 (평창군청 바로가기) ========== */
.top-bar {
    background-color: #f5f5f5;
    color: #666;
    padding: 8px 0;
    font-size: 13px;
    border-bottom: 1px solid #e0e0e0;
}

.top-bar .container {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 20px;
}

.top-bar a {
    color: #666;
    padding: 5px 10px;
    border-radius: 3px;
    transition: all 0.3s;
}

.top-bar a:hover {
    color: var(--primary-color);
}

/* ========== 헤더 ========== */
header {
    background-color: var(--header-bg);
    color: #333;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    border-bottom: 3px solid var(--primary-color);
}

.header-main {
    padding: 4px 0;
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo-section {
    display: flex;
    align-items: center;
    gap: 15px;
    text-decoration: none;
    color: inherit;
}

a.logo-section:hover {
    text-decoration: none;
}

.logo-section h1 {
    font-size: 24px;
    font-weight: 700;
    color: #333;
    cursor: pointer;
    transition: color 0.3s;
}

.logo-section h1:hover {
    color: var(--primary-color);
}

.logo-image {
    width: 112px;
    height: 112px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

.logo-image img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

/* ========== 네비게이션 ========== */
nav.main-nav {
    background-color: #fff;
    border-top: 1px solid #e0e0e0;
}

.nav-menu {
    display: flex;
    list-style: none;
}

.nav-menu li {
    flex: 1;
}

.nav-menu a {
    display: block;
    padding: 16px 20px;
    text-align: center;
    color: #333;
    font-size: 16px;
    font-weight: 500;
    border-right: 1px solid #e0e0e0;
    transition: all 0.3s;
    position: relative;
}

.nav-menu li:last-child a {
    border-right: none;
}

.nav-menu a:hover,
.nav-menu a.active {
    color: var(--primary-color);
    background-color: #f8f9fa;
}

.nav-menu a.active::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 3px;
    background-color: var(--primary-color);
}

/* ========== 컨테이너 ========== */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* ========== 메인 컨텐츠 ========== */
main {
    flex: 1;
    padding: 40px 0;
}

.page-title {
    font-size: 32px;
    margin-bottom: 30px;
    color: var(--primary-color);
    border-bottom: 3px solid var(--primary-color);
    padding-bottom: 15px;
}

/* ========== 컨텐츠 블록 (기존 호환) ========== */
.content-blocks {
    background: white;
    padding: 0;
}

.block {
    margin-bottom: 30px;
}

.block:last-child {
    margin-bottom: 0;
}

.block-image {
    text-align: center;
}

.block-image img {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
    box-shadow: var(--shadow);
}

.block-text p {
    font-size: 16px;
    line-height: 1.8;
    color: var(--text-color);
}

/* HTML 컨텐츠 (새 에디터) */
.post-html-content {
    line-height: 1.8;
    font-size: 16px;
}
.post-html-content p {
    margin: 0 0 10px;
}
.post-html-content img {
    max-width: 100%;
    height: auto;
    border-radius: 6px;
    margin: 6px 0;
}

/* ========== 게시판 목록 ========== */
.board-list {
    background: white;
    border-radius: 8px;
    box-shadow: var(--shadow);
    overflow: hidden;
}

.board-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 30px;
    background: var(--bg-dark);
    border-bottom: 2px solid var(--border-color);
}

.board-table {
    width: 100%;
    border-collapse: collapse;
}

.board-table thead {
    background-color: var(--bg-dark);
}

.board-table th {
    padding: 15px 20px;
    text-align: center;
    font-weight: 600;
    color: var(--text-color);
    border-bottom: 2px solid var(--border-color);
}

.board-table td {
    padding: 15px 20px;
    text-align: center;
    border-bottom: 1px solid var(--border-color);
}

.board-table tbody tr {
    transition: background 0.2s;
}

.board-table tbody tr:hover {
    background-color: var(--bg-light);
}

.board-table .title {
    text-align: left;
    font-weight: 500;
}

.board-table .title a:hover {
    color: var(--primary-color);
}

.board-table .number {
    width: 80px;
}

.board-table .date {
    width: 150px;
    color: var(--text-light);
    font-size: 13px;
}

.board-table .views {
    width: 80px;
    color: var(--text-light);
}

/* ========== 게시글 상세 ========== */
.post-detail {
    background: white;
    border-radius: 8px;
    box-shadow: var(--shadow);
    overflow: hidden;
}

.post-header {
    padding: 30px;
    border-bottom: 2px solid var(--border-color);
}

.post-title {
    font-size: 24px;
    margin-bottom: 15px;
    color: var(--text-color);
}

.post-meta {
    display: flex;
    gap: 20px;
    font-size: 14px;
    color: var(--text-light);
}

.post-content {
    padding: 30px;
    min-height: 300px;
}

/* ========== 첨부파일 표시 ========== */
.post-attachments {
    padding: 16px 30px 20px;
    border-top: 1px solid #eee;
    background: #f9fafb;
}

.post-attachments h4 {
    font-size: 14px;
    font-weight: 600;
    color: #444;
    margin-bottom: 10px;
}

.post-attachments ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.post-attachments li {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 7px 0;
    font-size: 14px;
    border-bottom: 1px solid #eee;
}

.post-attachments li:last-child {
    border-bottom: none;
}

.post-attachments a {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 500;
}

.post-attachments a:hover {
    text-decoration: underline;
}

.post-attachments .att-size {
    color: #999;
    font-size: 12px;
}

.post-actions {
    padding: 20px 30px;
    background: var(--bg-dark);
    display: flex;
    gap: 10px;
    justify-content: flex-end;
}

/* ========== 활동사진 갤러리 ========== */
.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
}

.gallery-item {
    background: white;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: var(--shadow);
    transition: all 0.3s;
}

.gallery-item:hover {
    box-shadow: var(--shadow-hover);
    transform: translateY(-5px);
}

.gallery-thumbnail {
    width: 100%;
    height: 250px;
    object-fit: cover;
    display: block;
}

.gallery-info {
    padding: 15px;
}

.gallery-title {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 8px;
}

.gallery-meta {
    font-size: 13px;
    color: var(--text-light);
}

/* ========== 버튼 ========== */
.btn {
    display: inline-block;
    padding: 10px 20px;
    border: none;
    border-radius: 4px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s;
    text-align: center;
}

.btn-primary {
    background-color: var(--primary-color);
    color: white;
}

.btn-primary:hover {
    background-color: var(--secondary-color);
}

.btn-secondary {
    background-color: var(--bg-dark);
    color: var(--text-color);
    border: 1px solid var(--border-color);
}

.btn-secondary:hover {
    background-color: var(--border-color);
}

.btn-danger {
    background-color: #dc3545;
    color: white;
}

.btn-danger:hover {
    background-color: #c82333;
}

/* ========== 폼 ========== */
.form-container {
    background: white;
    padding: 30px;
    border-radius: 8px;
    box-shadow: var(--shadow);
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: var(--text-color);
}

.form-group input[type="text"],
.form-group input[type="password"],
.form-group textarea,
.form-group input[type="file"] {
    width: 100%;
    padding: 10px 15px;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    font-size: 14px;
    transition: border-color 0.3s;
}

.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary-color);
}

.form-group textarea {
    resize: vertical;
    min-height: 150px;
}

.form-actions {
    display: flex;
    gap: 10px;
    margin-top: 30px;
}

/* ========== 에디터 컨테이너 ========== */
.editor-container {
    background: white;
    padding: 30px;
    border-radius: 8px;
    box-shadow: var(--shadow);
}

.form-control {
    width: 100%;
    padding: 10px 15px;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    font-size: 14px;
    font-family: inherit;
    transition: border-color 0.3s;
}

.form-control:focus {
    outline: none;
    border-color: var(--primary-color);
}

/* ========== 메시지 ========== */
.message {
    padding: 15px 20px;
    border-radius: 4px;
    margin-bottom: 20px;
}

.message.success {
    background-color: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.message.error {
    background-color: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

/* ========== 페이징 ========== */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 20px;
    margin-top: 30px;
    padding: 20px;
}

.pagination-btn {
    padding: 8px 16px;
    background: var(--bg-color);
    border: 1px solid var(--border-color);
    border-radius: 4px;
    color: var(--text-color);
}

.pagination-btn:hover {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

/* ========== 푸터 ========== */
footer {
    background-color: #2c3e50;
    color: #ecf0f1;
    padding: 15px 0;
    margin-top: auto;
}

.footer-content {
    text-align: center;
}

.footer-content p {
    margin: 5px 0;
    font-size: 14px;
}

/* ========== 관리자 네비게이션 ========== */
.admin-nav {
    display: flex;
    gap: 10px;
    align-items: center;
}

.admin-nav span {
    color: #333;
    font-size: 13px;
    font-weight: 500;
    margin-right: 4px;
}

.admin-nav .btn-admin {
    color: #333;
    font-size: 13px;
    font-weight: 500;
    padding: 6px 14px;
    border-radius: 5px;
    background: rgba(0, 0, 0, 0.05);
    border: 1px solid #ccc;
    transition: background 0.2s, border-color 0.2s;
    text-decoration: none;
}

.admin-nav .btn-admin:hover {
    background: rgba(0, 0, 0, 0.1);
    border-color: #999;
}

.admin-nav .btn-logout {
    color: #dc3545;
    font-size: 13px;
    font-weight: 500;
    padding: 6px 14px;
    border-radius: 5px;
    background: rgba(220, 53, 69, 0.08);
    border: 1px solid rgba(220, 53, 69, 0.4);
    transition: background 0.2s;
    text-decoration: none;
}

.admin-nav .btn-logout:hover {
    background: rgba(220, 53, 69, 0.15);
    color: #c82333;
}

/* ========== 로그인 페이지 ========== */
.login-container {
    max-width: 400px;
    margin: 100px auto;
    background: white;
    padding: 40px;
    border-radius: 8px;
    box-shadow: var(--shadow);
}

.login-container h1 {
    text-align: center;
    color: var(--primary-color);
    margin-bottom: 30px;
}

/* ========== 대시보드 ========== */
.dashboard-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 40px;
}

.stat-card {
    background: white;
    padding: 25px;
    border-radius: 8px;
    box-shadow: var(--shadow);
    text-align: center;
    border-left: 4px solid var(--primary-color);
}

.stat-card h3 {
    font-size: 14px;
    color: var(--text-light);
    margin-bottom: 10px;
}

.stat-number {
    font-size: 32px;
    font-weight: 700;
    color: var(--primary-color);
}

/* ========== 에디터 (블록 편집) ========== */
.block-editor {
    margin-bottom: 20px;
}

.block-item {
    background: var(--bg-light);
    padding: 20px;
    border-radius: 4px;
    margin-bottom: 15px;
    border: 1px solid var(--border-color);
}

.block-controls {
    display: flex;
    gap: 10px;
    margin-bottom: 15px;
}

.block-controls button {
    padding: 5px 10px;
    font-size: 12px;
}

/* ========== 방문자 통계 (관리자) ========== */
.visitor-stats {
    margin-bottom: 30px;
}

.visitor-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 15px;
    margin-bottom: 25px;
}

.visitor-card {
    background: white;
    padding: 20px;
    border-radius: 8px;
    box-shadow: var(--shadow);
    text-align: center;
}

.visitor-card h4 {
    font-size: 13px;
    color: var(--text-light);
    margin-bottom: 8px;
    font-weight: 500;
}

.visitor-card .visitor-num {
    font-size: 28px;
    font-weight: 700;
    color: var(--primary-color);
}

.visitor-card .visitor-num small {
    font-size: 14px;
    color: var(--text-light);
    font-weight: 400;
}

.visitor-chart-section {
    background: white;
    border-radius: 8px;
    box-shadow: var(--shadow);
    padding: 25px;
}

.visitor-chart-section h3 {
    font-size: 16px;
    margin-bottom: 20px;
    color: var(--text-color);
}

.chart-tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 20px;
}

.chart-tab {
    padding: 8px 16px;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    background: white;
    color: var(--text-color);
    cursor: pointer;
    font-size: 13px;
    transition: all 0.2s;
}

.chart-tab.active,
.chart-tab:hover {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

.bar-chart {
    display: flex;
    align-items: flex-end;
    gap: 6px;
    height: 200px;
    padding: 0 5px;
    border-bottom: 1px solid var(--border-color);
}

.bar-item {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-end;
    height: 100%;
    min-width: 0;
}

.bar-fill {
    width: 100%;
    max-width: 40px;
    background: var(--primary-color);
    border-radius: 3px 3px 0 0;
    min-height: 2px;
    transition: height 0.3s;
    position: relative;
}

.bar-fill:hover {
    background: var(--secondary-color);
}

.bar-value {
    font-size: 11px;
    color: var(--text-light);
    margin-bottom: 4px;
    white-space: nowrap;
}

.bar-label {
    font-size: 11px;
    color: var(--text-light);
    margin-top: 8px;
    text-align: center;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
}

/* ========== 반응형 ========== */
@media (max-width: 768px) {
    .header-content {
        flex-direction: column;
        text-align: center;
    }

    .logo-section h1 {
        font-size: 18px;
    }

    .nav-menu {
        flex-direction: column;
    }

    .nav-menu a {
        border-right: none;
        border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    }

    .board-table {
        font-size: 14px;
    }

    .board-table th,
    .board-table td {
        padding: 10px;
    }

    .gallery-grid {
        grid-template-columns: 1fr;
    }

    .page-title {
        font-size: 24px;
    }

    .post-title {
        font-size: 20px;
    }
}

/* ========== 유틸리티 ========== */
.text-center {
    text-align: center;
}

.empty-content {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-light);
}

.no-image {
    background: #f0f0f0;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #999;
    font-size: 14px;
}
