/* ========================================
   Modern Board Styles - 최적화 버전
   게시판 너비: 화면의 80%
   ======================================== */

/* Board Section */
.board-section {
    min-height: 100vh;
    padding: 8rem 0 4rem;
    background: linear-gradient(180deg, #f7fafc 0%, #ffffff 100%);
}

/* ✅ 수정: 컨테이너 너비를 80%로 확장 */
.board-section .container {
    max-width: 80%; /* 기존: 1200px → 수정: 80% */
    width: 100%;
    margin: 0 auto;
    padding: 0 2rem;
}

/* Board Header */
.board-header {
    background: white;
    border-radius: 1.5rem;
    padding: 2.5rem;
    margin-bottom: 2rem;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
}

.board-title-area {
    margin-bottom: 2rem;
}

.board-title {
    font-size: clamp(1.75rem, 4vw, 2.5rem);
    font-weight: 900;
    color: #1a1a2e;
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 0.5rem;
}

.board-title i {
    color: #667eea;
    font-size: 2rem;
}

.board-description {
    font-size: 1.1rem;
    color: #718096;
    margin: 0;
}

/* Search Container */
.search-container {
    display: flex;
    justify-content: center;
}

.search-form {
    display: flex;
    gap: 0.75rem;
    max-width: 600px;
    width: 100%;
}

.search-select {
    padding: 0.875rem 1rem;
    border: 2px solid #e2e8f0;
    border-radius: 0.75rem;
    font-size: 1rem;
    font-weight: 500;
    color: #2d3748;
    background: white;
    cursor: pointer;
    transition: all 0.3s ease;
    min-width: 120px;
}

.search-select:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.search-input-wrapper {
    flex: 1;
    position: relative;
    display: flex;
}

.search-input {
    flex: 1;
    padding: 0.875rem 3.5rem 0.875rem 1.25rem;
    border: 2px solid #e2e8f0;
    border-radius: 0.75rem;
    font-size: 1rem;
    color: #2d3748;
    transition: all 0.3s ease;
}

.search-input:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.search-input::placeholder {
    color: #a0aec0;
}

.search-button {
    position: absolute;
    right: 0.5rem;
    top: 50%;
    transform: translateY(-50%);
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border: none;
    border-radius: 0.5rem;
    color: white;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.search-button:hover {
    transform: translateY(-50%) scale(1.05);
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.3);
}

/* Board Stats */
.board-stats {
    display: flex;
    gap: 2rem;
    margin-bottom: 1.5rem;
    padding: 1.25rem 1.5rem;
    background: white;
    border-radius: 1rem;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.stat-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    color: #4a5568;
    font-size: 0.95rem;
}

.stat-item i {
    color: #667eea;
    font-size: 1.25rem;
}

.stat-item strong {
    color: #2d3748;
    font-weight: 700;
}

/* Board Table */
.board-table-wrapper {
    background: white;
    border-radius: 1.5rem;
    overflow: hidden;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
    margin-bottom: 2rem;
}

.board-table {
    width: 100%;
    border-collapse: collapse;
}

.board-table thead {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.board-table thead tr {
    border-bottom: none;
}

.board-table thead th {
    padding: 1.25rem 1rem;
    font-weight: 700;
    font-size: 0.95rem;
    color: white;
    text-align: center;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.board-table tbody tr {
    border-bottom: 1px solid #e2e8f0;
    transition: all 0.3s ease;
}

.board-table tbody tr:last-child {
    border-bottom: none;
}

.board-table tbody tr:hover {
    background: linear-gradient(to right, rgba(102, 126, 234, 0.05), transparent);
    transform: translateX(5px);
}

.board-table tbody td {
    padding: 1.25rem 1rem;
    color: #4a5568;
    vertical-align: middle;
    text-align: center;
}

/* Column Widths */
.col-num {
    width: 8%;
}

.col-title {
    width: 50%;
    text-align: left !important;
}

.col-author {
    width: 15%;
}

.col-date {
    width: 15%;
}

.col-views {
    width: 12%;
}

/* Post Number */
.post-number {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 35px;
    height: 35px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-radius: 0.5rem;
    font-weight: 700;
    font-size: 0.9rem;
}

/* Post Title */
.post-title {
    color: #2d3748;
    text-decoration: none;
    font-weight: 600;
    font-size: 1rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    transition: all 0.3s ease;
}

.post-title:hover {
    color: #667eea;
    padding-left: 0.5rem;
}

/* Badge */
.badge {
    padding: 0.25rem 0.75rem;
    border-radius: 1rem;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.badge-new {
    background: linear-gradient(135deg, #ff6b6b 0%, #ee5a6f 100%);
    color: white;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.7;
    }
}

/* Author Info */
.author-info {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    background: #f7fafc;
    border-radius: 2rem;
    font-weight: 500;
}

.author-info i {
    color: #667eea;
    font-size: 1.1rem;
}

/* Date & Views */
.col-date,
.col-views {
    font-weight: 500;
}

.col-date i,
.col-views i {
    margin-right: 0.5rem;
    color: #667eea;
}

/* Empty State */
.empty-message {
    padding: 4rem 2rem !important;
}

.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
    color: #a0aec0;
}

.empty-state i {
    font-size: 4rem;
    opacity: 0.5;
}

.empty-state p {
    font-size: 1.125rem;
    margin: 0;
}

/* Board Footer */
.board-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 2rem;
    flex-wrap: wrap;
}

.pagination-wrapper {
    flex: 1;
    display: flex;
    justify-content: center;
}

/* Pagination */
.pagination {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.page-link {
    min-width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 0.75rem;
    background: white;
    border: 2px solid #e2e8f0;
    border-radius: 0.5rem;
    color: #4a5568;
    text-decoration: none;
    font-weight: 600;
    transition: all 0.3s ease;
}

.page-link:hover {
    border-color: #667eea;
    color: #667eea;
    transform: translateY(-2px);
}

.page-link.active {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-color: transparent;
    color: white;
    box-shadow: 0 4px 10px rgba(102, 126, 234, 0.3);
}

.page-first,
.page-last {
    font-weight: 700;
}

/* Write Button */
.btn-write {
    display: inline-flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.875rem 2rem;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    text-decoration: none;
    border-radius: 0.75rem;
    font-weight: 700;
    font-size: 1rem;
    box-shadow: 0 4px 10px rgba(102, 126, 234, 0.3);
    transition: all 0.3s ease;
}

.btn-write:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.4);
    color: white;
}

.btn-write i {
    font-size: 1.1rem;
}

/* Scroll to Top Button */
.scroll-to-top {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    width: 50px;
    height: 50px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border: none;
    border-radius: 50%;
    color: white;
    font-size: 1.25rem;
    cursor: pointer;
    box-shadow: 0 10px 25px rgba(102, 126, 234, 0.3);
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    z-index: 1000;
}

.scroll-to-top.show {
    opacity: 1;
    visibility: visible;
}

.scroll-to-top:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 35px rgba(102, 126, 234, 0.4);
}

/* ========================================
   반응형 디자인
   ======================================== */

@media (max-width: 1024px) {
    .board-section .container {
        max-width: 90%; /* 중간 화면에서는 90% */
    }
    
    .board-table thead th {
        padding: 1rem 0.75rem;
        font-size: 0.875rem;
    }
    
    .board-table tbody td {
        padding: 1rem 0.75rem;
    }
    
    .col-num {
        width: 10%;
    }
    
    .col-title {
        width: 45%;
    }
}

@media (max-width: 768px) {
    .board-section {
        padding: 6rem 0 3rem;
    }
    
    .board-section .container {
        max-width: 95%; /* 모바일에서는 95% */
        padding: 0 1rem;
    }
    
    .board-header {
        padding: 1.5rem;
    }
    
    .board-title {
        font-size: 1.5rem;
    }
    
    .board-title i {
        font-size: 1.5rem;
    }
    
    .board-description {
        font-size: 0.95rem;
    }
    
    .search-form {
        flex-direction: column;
    }
    
    .search-select {
        width: 100%;
    }
    
    .board-stats {
        flex-direction: column;
        gap: 1rem;
    }
    
    /* Mobile Table View */
    .board-table {
        font-size: 0.875rem;
    }
    
    .board-table thead {
        display: none;
    }
    
    .board-table tbody tr {
        display: block;
        margin-bottom: 1rem;
        border: 1px solid #e2e8f0;
        border-radius: 1rem;
        overflow: hidden;
    }
    
    .board-table tbody tr:hover {
        transform: none;
    }
    
    .board-table tbody td {
        display: block;
        text-align: left !important;
        padding: 0.75rem 1rem;
        border-bottom: 1px solid #f7fafc;
    }
    
    .board-table tbody td:last-child {
        border-bottom: none;
    }
    
    .board-table tbody td::before {
        content: attr(data-label);
        font-weight: 700;
        color: #667eea;
        margin-right: 1rem;
        display: inline-block;
        min-width: 80px;
    }
    
    .col-title {
        background: #f7fafc;
    }
    
    .post-title {
        padding-left: 0 !important;
    }
    
    .board-footer {
        flex-direction: column-reverse;
        gap: 1.5rem;
    }
    
    .pagination-wrapper {
        width: 100%;
    }
    
    .pagination {
        width: 100%;
        justify-content: center;
        flex-wrap: wrap;
    }
    
    .page-link {
        min-width: 35px;
        height: 35px;
        font-size: 0.875rem;
    }
    
    .btn-write {
        width: 100%;
        justify-content: center;
    }
}

@media (max-width: 480px) {
    .board-header {
        padding: 1.25rem;
    }
    
    .pagination {
        gap: 0.25rem;
    }
    
    .page-link {
        min-width: 32px;
        height: 32px;
        padding: 0 0.5rem;
        font-size: 0.8125rem;
    }
}

/* Print Styles */
@media print {
    .board-header,
    .board-stats,
    .board-footer,
    .scroll-to-top {
        display: none;
    }
    
    .board-table thead {
        background: #f7fafc !important;
        color: black !important;
    }
}
