/**
 * 메인 스타일시트
 * 당구매니아 사이트
 */

/* ==========================================================================
   1. 기본 설정
   ========================================================================== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Malgun Gothic', 'Apple SD Gothic Neo', sans-serif;
    font-size: 15px;
    line-height: 1.6;
    color: #333;
    background-color: #f0f2f5;
}

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

img {
    max-width: 100%;
    height: auto;
    vertical-align: middle;
}

/* ==========================================================================
   2. 컨테이너 및 레이아웃
   ========================================================================== */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

/* ==========================================================================
   3. 버튼
   ========================================================================== */
.btn {
    display: inline-block;
    padding: 10px 20px;
    border: none;
    border-radius: 5px;
    font-size: 14px;
    font-weight: 500;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s;
}

.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-block {
    display: block;
    width: 100%;
}

.btn-search {
    background-color: #28a745;
    color: #fff;
}

.btn-more {
    font-size: 13px;
    color: #333333;
    font-weight: 600;
    text-decoration: none;
    transition: color 0.2s;
}
.btn-more:hover {
    color: #000000;
    text-decoration: none;
}

/* ==========================================================================
   4. 폼 스타일
   ========================================================================== */
.form-group {
    margin-bottom: 20px;
}

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

.required {
    color: #dc3545;
}

input[type="text"],
input[type="password"],
input[type="email"],
input[type="tel"],
textarea,
select {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 5px;
    font-size: 14px;
    transition: border-color 0.3s;
}

input:focus,
textarea:focus,
select:focus {
    outline: none;
    border-color: #007bff;
}

textarea {
    resize: vertical;
    min-height: 150px;
}

/* ==========================================================================
   5. 알림 메시지
   ========================================================================== */
.alert {
    padding: 15px;
    margin-bottom: 20px;
    border-radius: 5px;
    font-size: 14px;
}

.alert-success {
    background-color: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.alert-error {
    background-color: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

/* ==========================================================================
   6. 로그인/회원가입 페이지
   ========================================================================== */
.login-container,
.join-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.login-box,
.join-box {
    width: 100%;
    max-width: 450px;
    padding: 40px;
    background: #fff;
    border-radius: 10px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
}

.login-box h1,
.join-box h1 {
    margin-bottom: 30px;
    text-align: center;
    font-size: 28px;
    color: #333;
}

.login-footer,
.join-footer {
    margin-top: 20px;
    text-align: center;
    font-size: 14px;
}

.login-footer a,
.join-footer a {
    color: #007bff;
    font-weight: 500;
}

/* ==========================================================================
   7. 게시판 목록
   ========================================================================== */
.board-header {
    margin-bottom: 30px;
}

.board-header h2 {
    font-size: 26px;
    margin-bottom: 10px;
}

.search-box {
    margin-bottom: 20px;
}

.search-box form {
    display: flex;
    gap: 10px;
}

.search-box input {
    flex: 1;
}

.list-container {
    background: #fff;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

.list-header,
.list-row {
    display: flex;
    align-items: center;
    padding: 15px 20px;
    border-bottom: 1px solid #f0f0f0;
}

.list-header {
    background: #f8f9fa;
    font-weight: 600;
    color: #666;
    font-size: 14px;
}

.list-row:hover {
    background: #f9f9f9;
}

.col-id {
    width: 80px;
    text-align: center;
    color: #999;
}

.col-title {
    flex: 1;
    padding: 0 15px;
}

.col-title a {
    color: #333;
    font-weight: 500;
}

.col-title a:hover {
    color: #007bff;
}

.col-author {
    width: 120px;
    text-align: center;
}

.col-date {
    width: 100px;
    text-align: center;
    color: #999;
    font-size: 13px;
}

.col-hit {
    width: 80px;
    text-align: center;
    color: #999;
}

.empty-board {
    padding: 80px 20px;
    text-align: center;
    color: #999;
}

.board-buttons {
    margin-top: 30px;
    text-align: right;
}

/* ==========================================================================
   8. 페이징
   ========================================================================== */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 5px;
    margin: 30px 0;
}

.pg-btn {
    display: inline-block;
    padding: 8px 12px;
    background: #fff;
    border: 1px solid #ddd;
    color: #333;
    border-radius: 5px;
    font-size: 14px;
    transition: 0.2s;
}

.pg-btn:hover {
    background: #f0f2f5;
    border-color: #007bff;
}

.pg-btn.active {
    background: #007bff;
    color: #fff;
    border-color: #007bff;
    font-weight: bold;
}

/* ==========================================================================
   9. 게시글 보기
   ========================================================================== */
.view-container {
    background: #fff;
    border-radius: 10px;
    padding: 30px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

.view-header {
    padding-bottom: 20px;
    border-bottom: 2px solid #333;
    margin-bottom: 30px;
}

.view-header h2 {
    font-size: 24px;
    margin-bottom: 15px;
}

.view-info {
    display: flex;
    gap: 20px;
    font-size: 14px;
    color: #666;
}

.view-content {
    min-height: 300px;
    padding: 30px 0;
    line-height: 1.8;
}

.view-buttons {
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px solid #eee;
    display: flex;
    gap: 10px;
}

.view-nav {
    margin-top: 30px;
    border-top: 1px solid #eee;
}

.view-nav .nav-item {
    padding: 15px;
    border-bottom: 1px solid #eee;
    display: flex;
    gap: 15px;
}

.nav-label {
    color: #999;
    font-size: 13px;
    min-width: 60px;
}

/* ==========================================================================
   10. 글쓰기
   ========================================================================== */
.write-container {
    background: #fff;
    border-radius: 10px;
    padding: 30px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

.write-container h2 {
    margin-bottom: 30px;
    font-size: 24px;
}

.form-buttons {
    margin-top: 30px;
    display: flex;
    gap: 10px;
    justify-content: center;
}

/* ==========================================================================
   11. 메인 배너
   ========================================================================== */
.main-banner {
    position: relative;
    overflow: hidden;
    background: #333;
}

.banner-slider {
    width: 100%;
    height: 100%;
}

.banner-item {
    width: 100%;
    height: 100%;
}

.banner-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.banner-text {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
    color: #fff;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
}

.banner-text h2 {
    font-size: 48px;
    font-weight: bold;
}

/* ==========================================================================
   12. 최신 게시글
   ========================================================================== */
.latest-posts {
    margin: 40px 0;
}

.latest-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
}

.latest-box {
    background: #fff;
    border-radius: 10px;
    padding: 20px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

.latest-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 2px solid #007bff;
}

.latest-header h3 {
    font-size: 18px;
}

.latest-list {
    list-style: none;
}

.latest-list li {
    border-bottom: 1px solid #f0f0f0;
}

.latest-list li:last-child {
    border-bottom: none;
}

.latest-list li a {
    display: flex;
    justify-content: space-between;
    padding: 12px 0;
    transition: 0.3s;
    color: #111111;
    text-decoration: none;
}

.latest-list li a:hover {
    color: #333333;
    text-decoration: none;
}

.latest-list .subject {
    flex: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    color: #111111;
}

.latest-list .date {
    color: #999;
    font-size: 13px;
    margin-left: 10px;
}

.latest-list .empty {
    padding: 30px 0;
    text-align: center;
    color: #999;
}

/* ==========================================================================
   13. 반응형
   ========================================================================== */
@media (max-width: 768px) {
    .container {
        padding: 15px;
    }
    
    .list-header {
        display: none;
    }
    
    .list-row {
        flex-wrap: wrap;
        padding: 15px;
    }
    
    .col-id {
        display: none;
    }
    
    .col-title {
        width: 100%;
        padding: 0 0 10px 0;
        font-size: 15px;
    }
    
    .col-author,
    .col-date,
    .col-hit {
        width: auto;
        font-size: 12px;
    }
    
    .banner-text h2 {
        font-size: 28px;
    }
    
    .latest-grid {
        grid-template-columns: 1fr;
    }
}

/* ===== 메인 히어로 검색 ===== */
.hero-search-section {
    background: linear-gradient(135deg, #1565c0 0%, #0d47a1 50%, #1a237e 100%);
    padding: 60px 20px;
    text-align: center;
}
.hero-search-inner {
    max-width: 700px;
    margin: 0 auto;
}
.hero-title {
    color: #fff;
    font-size: 1.8rem;
    font-weight: 700;
    margin: 0 0 10px;
    letter-spacing: -0.5px;
    text-shadow: 0 1px 4px rgba(0,0,0,0.3);
}
.hero-sub {
    color: rgba(255,255,255,0.8);
    font-size: 0.95rem;
    margin: 0 0 28px;
}
.hero-search-form {
    width: 100%;
}
.hero-search-box {
    display: flex;
    border-radius: 50px;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(0,0,0,0.3);
    background: #fff;
}
.hero-search-box input[type=text] {
    flex: 1;
    border: none;
    outline: none;
    padding: 16px 24px;
    font-size: 1.05rem;
    color: #333;
    background: transparent;
}
.hero-search-box input[type=text]::placeholder {
    color: #aaa;
}
.hero-search-box button {
    border: none;
    background: #e53935;
    color: #fff;
    padding: 16px 32px;
    font-size: 1rem;
    font-weight: 700;
    cursor: pointer;
    transition: background .2s;
    white-space: nowrap;
}
.hero-search-box button:hover {
    background: #c62828;
}
.hero-search-box button i {
    margin-right: 6px;
}

/* 모바일 */
@media (max-width: 600px) {
    .hero-title { font-size: 1.3rem; }
    .hero-search-box input[type=text] { padding: 13px 16px; font-size: 0.95rem; }
    .hero-search-box button { padding: 13px 20px; font-size: 0.9rem; }
}
