/* Board Common Styles */
body {
    transform: translateZ(0);
    backface-visibility: hidden;
}

/* Board Top Banner */
.board-top-banner {
    width: 100%;
    background-image: url('../images/assets/board_top.png');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    padding: 160px 0 0 0;
    margin-top: 0;
    position: relative;
    transform: translateZ(0);
    backface-visibility: hidden;
}

.board-top-content {
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 20px 60px;
    text-align: center;
}

.board-top-subtitle {
    color: rgba(255, 255, 255, 0.50);
    font-family: 'Sumana', serif;
    font-size: 16px;
    font-style: normal;
    font-weight: 700;
    line-height: 120%;
    margin-bottom: 12px;
}

.board-top-title {
    color: #FFF;
    font-family: 'Pretendard', sans-serif;
    font-size: 40px;
    font-style: normal;
    font-weight: 700;
    line-height: 160%;
    margin-bottom: 40px;
}

.board-category-tabs {
    display: inline-flex;
    justify-content: center;
    gap: 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
}

.category-tab {
    padding: 16px 32px;
    color: rgba(255, 255, 255, 0.6);
    font-family: 'Pretendard', sans-serif;
    font-size: 16px;
    font-weight: 600;
    text-decoration: none;
    border-bottom: 3px solid transparent;
    transition: all 0.3s ease;
    cursor: pointer;
    position: relative;
    will-change: color, border-color;
}

.category-tab:hover {
    color: rgba(255, 255, 255, 0.9);
}

.category-tab.active {
    color: #FFF;
    border-bottom-color: #FFF;
}

/* 페이지 전환 시 깜빡임 방지 */
.board-container {
    opacity: 1;
    transition: opacity 0.2s ease-in-out;
}

.board-table {
    will-change: contents;
    transform: translateZ(0);
}

/* Board List Styles */
.board-container {
    max-width: 1360px;
    margin: 0 auto;
    padding: 60px;
}

/* Gallery Grid */
.gallery-grid {
    display: grid;
    grid-template-columns: repeat(4, 300px);
    gap: 20px;
    margin-bottom: 40px;
}

.gallery-item-wrapper {
    width: 100%;
}

.gallery-item {
    display: block;
    width: 100%;
    height: 100%;
    text-decoration: none;
    color: inherit;
    transition: transform 0.3s ease;
}

.gallery-item:hover {
    transform: translateY(-5px);
}

.gallery-info {
    margin-bottom: 12px;
}

.gallery-category {
    background: #003E76;
    display: inline-flex;
    justify-content: center;
    align-items: center;
    padding: 6px 12px;
    margin-bottom: 8px;
    color: #FFF;
    font-family: 'Pretendard', sans-serif;
    font-size: 14px;
    font-style: normal;
    font-weight: 700;
    line-height: normal;
}

.gallery-title {
    color: #333;
    font-family: 'Pretendard', sans-serif;
    font-size: 18px;
    font-style: normal;
    font-weight: 700;
    line-height: normal;
    margin-bottom: 12px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.gallery-image {
    width: 300px;
    height: 200px;
    flex-shrink: 0;
    overflow: hidden;
    background: #f0f0f0;
    border: 1px solid #e0e0e0;
    border-radius: 15px;
    margin-bottom: 12px;
}

.gallery-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.gallery-meta {
    display: flex;
    justify-content: space-between;
    color: #999;
    font-family: 'Pretendard', sans-serif;
    font-size: 12px;
    font-style: normal;
    font-weight: 500;
    line-height: normal;
}

.gallery-date,
.gallery-author {
    color: #999;
    font-family: 'Pretendard', sans-serif;
    font-size: 12px;
    font-style: normal;
    font-weight: 500;
    line-height: normal;
}

.board-header {
    display: none;
}

.board-controls {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    margin-top: 30px;
}

.board-info {
    color: #7f8c8d;
    font-size: 14px;
}

.btn-write {
    padding: 12px 24px;
    background: #2c3e50;
    color: white;
    text-decoration: none;
    border-radius: 4px;
    font-weight: 600;
    transition: all 0.3s;
}

.btn-write:hover {
    background: #34495e;
}

.btn-write-normal {
    display: flex;
    width: 80px;
    height: 40px;
    justify-content: center;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
    border: 1px solid #0E385E;
    background: white;
    color: #0E385E;
    font-family: 'Pretendard', sans-serif;
    font-size: 14px;
    font-style: normal;
    font-weight: 700;
    line-height: normal;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.3s;
}

.btn-write-normal:hover {
    background: #0E385E;
    color: white;
}

/* Floating Write Button */
.floating-write-btn {
    position: fixed;
    right: 40px;
    bottom: 40px;
    width: 64px;
    height: 64px;
    background: #2c3e50;
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    transition: all 0.3s ease;
    z-index: 1000;
    font-size: 24px;
}

.floating-write-btn:hover {
    background: #34495e;
    transform: scale(1.1);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.4);
}

.floating-write-btn svg {
    width: 24px;
    height: 24px;
    fill: white;
}

.board-table {
    width: 100%;
    background: white;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

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

.board-table thead {
    background: #2c3e50;
    color: white;
}

.board-table th {
    padding: 16px;
    text-align: center;
    font-weight: 600;
}

.board-table td {
    padding: 16px;
    text-align: center;
    border-bottom: 1px solid #ecf0f1;
}

.board-table tbody tr:hover {
    background: #f8f9fa;
}

.board-table .col-num {
    width: 80px;
}

.board-table .col-title {
    width: auto;
    text-align: left;
}

.board-table .col-author {
    width: 120px;
}

.board-table .col-date {
    width: 120px;
}

.board-table .col-views {
    width: 80px;
}

.board-table .title-link {
    color: #2c3e50;
    text-decoration: none;
    font-weight: 500;
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.board-table .title-link:hover {
    color: #3498db;
}

.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 12px;
    margin-top: 60px;
    margin-bottom: 40px;
}

.page-arrow {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    text-decoration: none;
    cursor: pointer;
}

.page-arrow.disabled {
    cursor: not-allowed;
    opacity: 0.5;
}

.page-number {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    color: #333;
    font-family: 'Pretendard', sans-serif;
    font-size: 15px;
    font-style: normal;
    font-weight: 600;
    line-height: normal;
    text-decoration: none;
    border-radius: 50%;
    transition: all 0.3s;
}

.page-number:hover {
    background: #f0f0f0;
}

.page-number.active {
    color: #FFF;
    font-family: 'Pretendard', sans-serif;
    font-size: 15px;
    font-style: normal;
    font-weight: 600;
    line-height: normal;
    background: #0E385E;
}

.empty-message {
    text-align: center;
    padding: 60px 20px;
    color: #7f8c8d;
}

.empty-message p {
    font-size: 18px;
    margin-bottom: 20px;
}

/* Board Write/Edit Styles */
.write-container,
.edit-container {
    max-width: 1280px;
    margin: 0 auto;
    padding: 60px;
}

.write-header,
.edit-header {
    text-align: center;
    margin-bottom: 40px;
}

.write-header h1,
.edit-header h1 {
    font-size: 36px;
    font-weight: 700;
    color: #2c3e50;
}

.form-group {
    margin-bottom: 24px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    color: #2c3e50;
    font-weight: 600;
    font-size: 14px;
}

.form-group input[type="text"],
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
    font-family: inherit;
    transition: border-color 0.3s;
}

.form-group input[type="text"]:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #3498db;
}

.form-group textarea {
    min-height: 400px;
    resize: vertical;
    line-height: 1.6;
}

.form-actions {
    display: flex;
    gap: 12px;
    justify-content: center;
    margin-top: 32px;
}

.btn {
    padding: 14px 32px;
    border: none;
    border-radius: 4px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    text-decoration: none;
    display: inline-block;
}

.btn-primary {
    background: #2c3e50;
    color: white;
}

.btn-primary:hover {
    background: #34495e;
}

.btn-secondary {
    background: #95a5a6;
    color: white;
}

.btn-secondary:hover {
    background: #7f8c8d;
}

.error-message {
    background: #e74c3c;
    color: white;
    padding: 12px 20px;
    border-radius: 4px;
    margin-bottom: 20px;
}

/* Board View Styles */
.view-container {
    max-width: 1000px;
    margin: 0 auto;
    padding: 20px;
}

.view-header {
    background: white;
}

.view-category {
    display: inline-block;
    padding: 6px 16px;
    background: #3498db;
    color: white;
    border-radius: 4px;
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 16px;
}

.view-title {
    font-size: 32px;
    font-weight: 700;
    color: #2c3e50;
    line-height: 1.4;
}

.view-meta {
    display: flex;
    gap: 20px;
    padding-top: 10px;
    border-top: 1px solid #ecf0f1;
    color: #7f8c8d;
    font-size: 14px;
    justify-content: flex-end;
}

.view-meta span {
    display: flex;
    align-items: center;
    gap: 6px;
}

.view-content {
    background: white;
    margin-top: 2px;
}

.view-text {
    font-size: 16px;
    line-height: 1.8;
    color: #2c3e50;
}

.view-text img {
    max-width: 100%;
    height: auto;
    display: block;
    margin: 16px 0;
}

.view-text p {
    margin-bottom: 16px;
}

.view-text b,
.view-text strong {
    font-weight: 700;
}

.view-actions {
    display: flex;
    gap: 12px;
    justify-content: center;
    margin-top: 40px;
}

.btn-list {
    background: #95a5a6;
    color: white;
    padding: 12px 24px;
    border: none;
    border-radius: 4px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    text-decoration: none;
    display: inline-block;
}

.btn-list:hover {
    background: #7f8c8d;
}

.btn-edit {
    background: #3498db;
    color: white;
    padding: 12px 24px;
    border: none;
    border-radius: 4px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    text-decoration: none;
    display: inline-block;
}

.btn-edit:hover {
    background: #2980b9;
}

.btn-delete {
    background: #e74c3c;
    color: white;
    padding: 12px 24px;
    border: none;
    border-radius: 4px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    text-decoration: none;
    display: inline-block;
}

.btn-delete:hover {
    background: #c0392b;
}

.success-message {
    background: #2ecc71;
    color: white;
    padding: 12px 20px;
    border-radius: 4px;
    margin-bottom: 20px;
}

/* Custom Editor Styles */
.editor-toolbar {
    display: flex;
    gap: 8px;
    padding: 12px;
    background: #f8f9fa;
    border: 1px solid #ddd;
    border-bottom: none;
    border-radius: 4px 4px 0 0;
    flex-wrap: wrap;
}

.editor-btn {
    width: 44px;
    height: 44px;
    border: 1px solid #ddd;
    background: white;
    border-radius: 4px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    transition: all 0.2s;
    -webkit-tap-highlight-color: transparent;
}

.editor-btn:hover {
    background: #e9ecef;
    border-color: #adb5bd;
}

.editor-btn:active {
    background: #dee2e6;
    transform: scale(0.95);
}

.custom-editor {
    width: 100%;
    min-height: 400px;
    padding: 16px;
    border: 1px solid #ddd;
    border-radius: 0 0 4px 4px;
    font-size: 16px;
    line-height: 1.6;
    background: white;
    outline: none;
    overflow-y: auto;
}

.custom-editor:focus {
    border-color: #3498db;
}

.custom-editor img {
    max-width: 100%;
    height: auto;
    display: block;
    margin: 16px 0;
}

.custom-editor p {
    margin: 0 0 16px 0;
}

.custom-editor:empty:before {
    content: '내용을 입력하세요';
    color: #adb5bd;
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .board-top-banner {
        padding: 100px 0 0 0;
        margin-top: 0;
    }

    .board-container {
        padding: 40px 15px;
        display: flex;
        flex-direction: column;
        align-items: center;
    }

    .gallery-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
        max-width: 100%;
        margin: 0 auto 40px;
    }

    .gallery-item-wrapper {
        width: 100%;
    }

    .gallery-item {
        display: block;
        width: 100%;
        height: 100%;
    }

    .gallery-image {
        width: 100%;
        height: 120px;
    }

    .gallery-category {
        font-size: 10px;
        padding: 3px 8px;
    }

    .gallery-title {
        font-size: 12px;
        margin-bottom: 6px;
        line-height: 1.3;
        max-height: 2.6em;
        overflow: hidden;
        text-overflow: ellipsis;
        display: -webkit-box;
        -webkit-line-clamp: 2;
        -webkit-box-orient: vertical;
    }

    .gallery-info {
        margin-bottom: 8px;
    }

    .gallery-meta,
    .gallery-date,
    .gallery-author {
        font-size: 10px;
    }

    .editor-toolbar {
        padding: 8px;
        gap: 6px;
    }

    .editor-btn {
        width: 40px;
        height: 40px;
        font-size: 14px;
    }

    .custom-editor {
        min-height: 300px;
        padding: 12px;
        font-size: 16px;
    }

    .board-top-content {
        padding: 0 20px 40px;
    }

    .board-top-title {
        font-size: 28px;
    }

    .board-category-tabs {
        display: inline-flex;
        overflow-x: auto;
        justify-content: flex-start;
        -webkit-overflow-scrolling: touch;
    }

    .category-tab {
        padding: 14px 20px;
        font-size: 14px;
        white-space: nowrap;
    }

    .board-header h1 {
        font-size: 32px;
    }

    .board-table .col-author,
    .board-table .col-date,
    .board-table .col-views {
        display: none;
    }

    .board-controls {
        flex-direction: column;
        gap: 16px;
        align-items: flex-start;
    }

    .board-container {
        padding: 20px;
    }

    .floating-write-btn {
        right: 20px;
        bottom: 20px;
        width: 56px;
        height: 56px;
    }

    .floating-write-btn svg {
        width: 20px;
        height: 20px;
    }

    .write-form,
    .edit-form {
        padding: 24px;
    }

    .write-header h1,
    .edit-header h1 {
        font-size: 28px;
    }

    .form-actions {
        flex-direction: column;
    }

    .btn {
        width: 100%;
    }

    .view-header,
    .view-content {
        padding: 24px;
    }

    .view-title {
        font-size: 24px;
    }

    .view-meta {
        flex-direction: column;
        gap: 8px;
    }

    .view-actions {
        flex-direction: column;
    }

    .btn-list,
    .btn-edit,
    .btn-delete {
        width: 100%;
    }
}

/* 작은 모바일 (480px 이하) */
@media (max-width: 480px) {
    .gallery-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
        max-width: 100%;
    }

    .gallery-image {
        height: 100px;
    }

    .gallery-category {
        font-size: 9px;
        padding: 3px 6px;
    }

    .gallery-title {
        font-size: 11px;
        margin-bottom: 5px;
        line-height: 1.3;
    }

    .gallery-info {
        margin-bottom: 6px;
    }

    .gallery-meta,
    .gallery-date,
    .gallery-author {
        font-size: 9px;
    }
}

.btn-write-new {
    background: #2c3e50;
    color: white;
    padding: 12px 24px;
    border: none;
    border-radius: 4px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    text-decoration: none;
    display: inline-block;
}

.btn-write-new:hover {
    background: #34495e;
}
