@charset "utf-8";
/* =============================================
   Board Common CSS - Board pages only
   Location: /css/board_common.css
   
   Mobile-First Responsive Design
   Breakpoint: 768px (Mobile - PC)
   
   Used by: list.php, view.php, write.php, edit.php, search.php
   
   Structure:
   1. Board Buttons (Write, Delete, Edit, etc.)
   2. Forms
   3. Pagination
   4. Search Form
   5. Post List
   6. Post View
   7. Comments
   8. File Upload
   9. Media Wrappers
   10. Share Popup
   11. Media Query (768px)
   ============================================= */

/* =============================================
   1. BOARD BUTTONS
   ============================================= */

/* Write Button */
.write-btn,
.submit-btn {
    background-color: #007bff;
    color: #fff;
}

.write-btn:hover,
.submit-btn:hover {
    background-color: #0056b3;
}

/* Delete Button */
.delete-btn {
    background-color: #dc3545;
    color: #fff;
}

.delete-btn:hover {
    background-color: #c82333;
}

/* Edit Button */
.edit-btn {
    background-color: #fd7e14;
    color: #fff;
}

.edit-btn:hover {
    background-color: #e56a00;
}

/* Cancel/List Button */
.cancel-btn,
.list-btn {
    background-color: #6c757d;
    color: #fff;
}

.cancel-btn:hover,
.list-btn:hover {
    background-color: #545b62;
}

/* Download Button */
.download-btn,
.search-btn {
    background-color: #28a745;
    color: #fff;
}

.download-btn:hover,
.search-btn:hover {
    background-color: #1e7e34;
}

/* Share Button */
.share-btn {
    background-color: #6c757d;
    color: #fff;
}

.share-btn:hover {
    background-color: #545b62;
}

/* Vote Buttons */
.vote-btn {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 10px;
    font-size: 0.9rem;
    background: #f8f9fa;
    color: #333;
    border: 1px solid #ddd;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s;
    box-shadow: none;
}

.vote-btn:hover {
    background: #e9ecef;
    transform: none;
}

.vote-btn.active {
    background: #007bff;
    color: #fff;
    border-color: #007bff;
}

.vote-btn.disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.like-btn:hover {
    border-color: #28a745;
    color: #28a745;
}

.like-btn.active {
    background: #28a745;
    color: #fff;
    border-color: #28a745;
}

.dislike-btn:hover {
    border-color: #dc3545;
    color: #dc3545;
}

.dislike-btn.active {
    background: #dc3545;
    color: #fff;
    border-color: #dc3545;
}

.like-count,
.dislike-count {
    font-weight: bold;
}

/* Comment Buttons */
.btn-comment-submit {
    padding: 8px 16px;
    background: #007bff;
    color: #fff;
    border: none;
    border-radius: 4px;
    font-size: 0.9rem;
    cursor: pointer;
    transition: background 0.2s;
}

.btn-comment-submit:hover {
    background: #0056b3;
}

.btn-comment-edit {
    padding: 4px 10px;
    background: #fd7e14;
    color: #fff;
    border: none;
    border-radius: 4px;
    font-size: 0.8rem;
    text-decoration: none;
    cursor: pointer;
    transition: background 0.2s;
}

.btn-comment-edit:hover {
    background: #e56a00;
    color: #fff;
}

.btn-comment-cancel {
    padding: 8px 16px;
    background: #6c757d;
    color: #fff;
    border: none;
    border-radius: 4px;
    font-size: 0.9rem;
    text-decoration: none;
    cursor: pointer;
    transition: background 0.2s;
}

.btn-comment-cancel:hover {
    background: #545b62;
    color: #fff;
}

/* Form Button Wrappers */
.btn-wrap,
.btn-wrap-w,
.btn-wrap-e {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    justify-content: center;
    margin-top: 1.5rem;
}

.btn-w,
.btn-e {
    display: block;
    width: 100%;
    padding: 0.75rem;
    font-size: 1rem;
    font-weight: 600;
    border: none;
    border-radius: 5px;
    text-decoration: none;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s;
    background-color: #007bff;
    color: #fff;
}

.btn-w:hover,
.btn-e:hover {
    background-color: #0056b3;
}

/* =============================================
   2. FORM ELEMENTS
   ============================================= */
.form-group {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    margin-bottom: 1rem;
}

.form-group label {
    font-size: 1rem;
    font-weight: 500;
    color: #333;
}

input[type="text"],
input[type="email"],
input[type="password"],
input[type="url"],
input[type="tel"],
input[type="number"] {
    width: 100%;
    padding: 0.6rem;
    font-size: 1rem;
    border: 1px solid #ccc;
    border-radius: 4px;
    box-sizing: border-box;
    transition: border-color 0.2s, box-shadow 0.2s;
}

input[type="text"]:focus,
input[type="email"]:focus,
input[type="password"]:focus,
input[type="url"]:focus,
input[type="tel"]:focus,
input[type="number"]:focus {
    outline: none;
    border-color: #007bff;
    box-shadow: 0 0 0 2px rgba(0, 123, 255, 0.25);
}

textarea {
    width: 100%;
    padding: 0.6rem;
    font-size: 1rem;
    border: 1px solid #ccc;
    border-radius: 4px;
    box-sizing: border-box;
    resize: vertical;
    min-height: 100px;
    line-height: 1.6;
    transition: border-color 0.2s, box-shadow 0.2s;
}

textarea:focus {
    outline: none;
    border-color: #007bff;
    box-shadow: 0 0 0 2px rgba(0, 123, 255, 0.25);
}

textarea::placeholder {
    color: #999;
}

select {
    width: 100%;
    padding: 0.6rem;
    font-size: 1rem;
    border: 1px solid #ccc;
    border-radius: 4px;
    box-sizing: border-box;
    background-color: #fff;
    appearance: none;
    -webkit-appearance: none;
    background-image: url("data:image/svg+xml;charset=US-ASCII,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath fill='%23333' d='M0 0l5 6 5-6z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.75rem center;
    transition: border-color 0.2s, box-shadow 0.2s;
}

select:focus {
    outline: none;
    border-color: #007bff;
    box-shadow: 0 0 0 2px rgba(0, 123, 255, 0.25);
}

/* =============================================
   3. PAGINATION
   ============================================= */
.pagination {
    margin: 1.5rem 0;
    text-align: center;
}

.pagination a,
.pagination span {
    display: inline-block;
    padding: 0.4rem 0.8rem;
    margin: 0 0.15rem;
    border: 1px solid #ccc;
    border-radius: 3px;
    text-decoration: none;
    color: #333;
    font-size: 0.85rem;
    transition: all 0.2s;
}

.pagination a:hover {
    background: #e9ecef;
    border-color: #007bff;
}

.pagination .active {
    background: #007bff;
    color: #fff;
    border-color: #007bff;
}

.pagination .disabled {
    color: #999;
    cursor: not-allowed;
}

/* =============================================
   4. SEARCH FORM
   ============================================= */
.search-form-board {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin: 0 auto 1rem;
}

.search-input {
    width: 100%;
    padding: 0.6rem;
    font-size: 1rem;
    border: 1px solid #ccc;
    border-radius: 4px;
    box-sizing: border-box;
}

.search-input:focus {
    outline: none;
    border-color: #007bff;
    box-shadow: 0 0 0 2px rgba(0, 123, 255, 0.25);
}

.search-category {
    width: 100%;
    padding: 0.6rem;
    font-size: 1rem;
    border: 1px solid #ccc;
    border-radius: 4px;
    box-sizing: border-box;
    background: #fff;
}

.search-button {
    width: 100%;
    padding: 0.6rem;
    font-size: 1rem;
    background: #28a745;
    color: #fff;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: background 0.2s;
}

.search-button:hover {
    background: #1e7e34;
}

/* Admin Controls */
.select-all {
    display: flex;
    justify-content: flex-start;
    align-items: center;
    margin: 0.5rem 0;
    font-size: 0.9rem;
}

.select-all input[type="checkbox"] {
    margin-right: 0.5rem;
}

/* =============================================
   5. POST LIST
   ============================================= */
.post-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.post-item {
    display: grid;
    grid-template-columns: 90px 1fr;
    gap: 12px;
    padding: 10px 5px;
    align-items: center;
    border-bottom: 1px solid #ddd;
    background: #fff;
}

.post-item .checkbox {
    grid-column: 1 / -1;
    margin-bottom: -5px;
}

.thumb {
    width: 90px;
    height: 63px;
    object-fit: cover;
    border-radius: 4px;
}

.post-summary {
    display: flex;
    flex-direction: column;
    justify-content: center;
    min-width: 0;
}

.post-title {
    font-size: 1rem;
    font-weight: bold;
    margin: 0 0 6px 0;
    color: #111;
}

.post-title a {
    color: #111;
    text-decoration: none;
}

.post-title a:hover {
    color: #007bff;
}

.post-meta {
    font-size: 0.8rem;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 5px;
    color: #555;
}

.post-meta .info {
    color: #666;
}

.edit-link {
    color: #6c757d;
    text-decoration: none;
    font-size: 0.8rem;
}

.edit-link:hover {
    color: #333;
}

/* Write Button (block style for list page) */
a.write-btn {
    display: block;
    width: 90%;
    max-width: 400px;
    margin: 1rem auto;
    padding: 0.75rem;
    font-size: 1rem;
    text-align: center;
    border-radius: 5px;
}

/* =============================================
   6. POST VIEW
   ============================================= */
.post-info-top {
    display: flex;
    align-items: center;
    gap: 1rem;
    font-size: 1rem;
    color: #555;
    font-weight: bold;
    padding-top: 0.5rem;
    margin-top: 0.5rem;
    margin-bottom: 1rem;
}

.post-info-top .board-type,
.post-info-top .board-category {
    font-size: inherit;
}

.title {
    font-size: 1.3rem;
    font-weight: bold;
    margin-bottom: 0.5rem;
    margin-top: 0;
}

.info {
    font-size: 0.85rem;
    color: #666;
    margin-bottom: 1rem;
}

.content {
    white-space: pre-wrap;
    margin-bottom: 1rem;
    line-height: 1.6;
}

.post-img {
    max-width: 100%;
    width: auto;
    max-height: 600px;
    height: auto;
    cursor: pointer;
    display: block;
    margin: 0 auto 1rem;
    border-radius: 5px;
}

.attachments ul {
    list-style: none;
    padding: 0;
    margin: 0 0 1rem 0;
}

.attachments li {
    margin-bottom: 0.3rem;
}

.attachments a {
    color: #007bff;
    text-decoration: none;
}

.attachments a:hover {
    text-decoration: underline;
}

.post-actions {
    display: flex;
    justify-content: center;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
    margin: 1.5rem 0;
    position: relative;
}

.post-actions .likes {
    margin: 0;
}

.likes {
    margin: 1rem 0;
    text-align: center;
}

/* =============================================
   7. COMMENTS
   ============================================= */
.comment-title {
    font-size: 1.2rem;
    margin: 1rem 0 0.5rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid #333;
}

.comments {
    margin-top: 0.5rem;
    padding: 0;
    background-color: #fafafa;
    width: 100%;
}

.comment {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    padding: 1rem;
    border-bottom: 1px solid #eee;
    background: #fff;
}

.comment-text,
.comments .text {
    font-size: 1rem;
    line-height: 1.5;
    white-space: pre-wrap;
    word-break: break-word;
    padding: 0.5rem;
    background-color: #f5f5f5;
    border-radius: 4px;
}

.comment-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    font-size: 0.85rem;
    color: #666;
}

.comment-author {
    font-weight: bold;
    color: #333;
}

.comment-date {
    color: #999;
}

.comment-actions,
.comment .actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    align-items: center;
}

.comment-form-wrapper {
    margin-top: 1.5rem;
    padding: 1rem;
    background: #f9f9f9;
    border-radius: 8px;
}

.comment-form-wrapper h3 {
    margin: 0 0 0.5rem;
    font-size: 1rem;
}

.comment-form {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.comment-form textarea {
    width: 100%;
    padding: 0.8rem;
    font-size: 1rem;
    line-height: 1.5;
    border: 1px solid #ccc;
    border-radius: 5px;
    resize: vertical;
    min-height: 80px;
    box-sizing: border-box;
}

.comment-form-buttons {
    display: flex;
    gap: 0.5rem;
}

.login-prompt {
    margin-top: 1rem;
    padding: 1rem;
    text-align: center;
    background: #f5f5f5;
    border-radius: 4px;
    color: #666;
}

.login-prompt a {
    color: #007bff;
    text-decoration: none;
    font-weight: bold;
}

.login-prompt a:hover {
    text-decoration: underline;
}

/* =============================================
   8. FILE UPLOAD
   ============================================= */
#fileInputsContainer {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    padding: 1rem;
    border: 1px dashed #ccc;
    border-radius: 8px;
    background-color: #fafafa;
}

.file-input-wrapper {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 0.5rem;
    border-bottom: 1px solid #eee;
}

.file-input-wrapper:last-child {
    border-bottom: none;
}

.file-input-wrapper input[type="file"] {
    flex: 1;
    padding: 0.5rem;
    font-size: 0.9rem;
    border: 1px solid #ddd;
    border-radius: 4px;
    background: #fff;
}

.existing-file {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
    margin: 0.5rem 0;
    padding: 0.5rem;
    background: #e9f7ef;
    border-radius: 4px;
    font-size: 0.9rem;
}

.existing-file .file-name {
    flex: 1;
    min-width: 0;
    word-break: break-all;
}

.existing-file .file-name a {
    color: #28a745;
    text-decoration: none;
}

.existing-file .file-name a:hover {
    text-decoration: underline;
}

.delete-checkbox-label {
    display: inline-flex;
    align-items: center;
    font-weight: normal;
    color: #dc3545;
    cursor: pointer;
    font-size: 0.85rem;
}

.delete-checkbox-label input[type="checkbox"] {
    margin-right: 5px;
    width: auto;
}

.btn-add-file {
    display: inline-block;
    padding: 8px 16px;
    margin-top: 10px;
    background: #17a2b8;
    color: #fff;
    border: none;
    border-radius: 4px;
    font-size: 0.9rem;
    cursor: pointer;
    transition: background 0.2s;
}

.btn-add-file:hover {
    background: #138496;
}

.btn-add-file:disabled {
    background: #ccc;
    cursor: not-allowed;
}

.btn-remove-file {
    display: inline-block;
    padding: 4px 10px;
    margin-left: 8px;
    background: #dc3545;
    color: #fff;
    border: none;
    border-radius: 4px;
    font-size: 0.8rem;
    cursor: pointer;
    transition: background 0.2s;
}

.btn-remove-file:hover {
    background: #c82333;
}

/* =============================================
   9. MEDIA WRAPPERS
   ============================================= */
.audio-wrapper {
    margin: 20px 0;
    text-align: center;
}

.audio-wrapper audio {
    width: 100%;
    max-width: 100%;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.video-wrapper {
    margin: 20px 0;
    text-align: center;
}

.video-wrapper video {
    width: 100%;
    max-width: 100%;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.youtube-wrapper {
    margin: 20px 0;
    text-align: center;
}

.youtube-wrapper iframe {
    width: 100%;
    max-width: 100%;
    height: 250px;
    border-radius: 8px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.15);
}

.youtube-wrapper-inline {
    position: relative;
    padding-bottom: 56.25%;
    height: 0;
    overflow: hidden;
    max-width: 100%;
    margin: 20px auto;
    border-radius: 8px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.15);
}

.youtube-wrapper-inline iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: 0;
    border-radius: 8px;
}

/* =============================================
   10. SHARE POPUP
   ============================================= */
.share-popup {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    justify-content: center;
    align-items: center;
}

.share-popup.active {
    display: flex;
}

.share-popup-content {
    background: #fff;
    border-radius: 12px;
    width: 90%;
    max-width: 320px;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    animation: popupSlide 0.2s ease;
}

@keyframes popupSlide {
    from {
        transform: translateY(20px);
        opacity: 0;
    }

    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.share-popup-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
    border-bottom: 1px solid #eee;
    font-weight: bold;
    font-size: 1.1rem;
}

.share-popup-close {
    background: none;
    border: none;
    font-size: 1.3rem;
    cursor: pointer;
    color: #999;
    padding: 0;
    line-height: 1;
}

.share-popup-close:hover {
    color: #333;
}

.share-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.share-list li {
    border-bottom: 1px solid #f0f0f0;
}

.share-list li:last-child {
    border-bottom: none;
}

.share-list button {
    width: 100%;
    padding: 15px 20px;
    background: none;
    border: none;
    text-align: left;
    font-size: 1rem;
    cursor: pointer;
    transition: background 0.2s;
}

.share-list button:hover {
    background: #f8f9fa;
}

.share-toggle {
    background: #6c757d;
}

.share-toggle:hover {
    background: #5a6268;
}

/* =============================================
   11. MEDIA QUERY - PC (min-width: 768px)
   ============================================= */
@media (min-width: 768px) {

    /* Button Wrappers - PC */
    .btn-wrap,
    .btn-wrap-w,
    .btn-wrap-e {
        flex-direction: row;
        gap: 1rem;
    }

    .btn-w,
    .btn-e {
        width: auto;
        min-width: 150px;
        padding: 14px 40px;
        font-size: 1.1rem;
    }

    /* Form Group - PC (Horizontal) */
    .form-group {
        flex-direction: row;
        align-items: flex-start;
    }

    .form-group label {
        width: 120px;
        flex-shrink: 0;
        margin-right: 1rem;
        text-align: right;
        padding-top: 0.6rem;
    }

    .form-group select,
    .form-group input,
    .form-group textarea {
        flex: 1;
    }

    /* Pagination - PC */
    .pagination a,
    .pagination span {
        padding: 0.5rem 0.9rem;
        font-size: 0.9rem;
    }

    /* Search Form - PC (Row Layout) */
    .search-form-board {
        flex-direction: row;
        gap: 0.5rem;
    }

    .search-input {
        flex: 1;
        width: auto;
    }

    .search-category {
        width: 180px;
    }

    .search-button {
        width: 100px;
    }

    /* Post List - PC */
    .post-item {
        grid-template-columns: 120px 1fr;
        gap: 1.5rem;
        padding: 15px 20px;
    }

    .thumb {
        width: 120px;
        height: 80px;
    }

    .post-title {
        font-size: 1.1rem;
    }

    .post-meta {
        font-size: 0.9rem;
    }

    /* Comments - PC (Row Layout) */
    .comment {
        flex-direction: row;
        flex-wrap: wrap;
        align-items: flex-start;
        gap: 1rem;
    }

    .comment-text,
    .comments .text {
        flex: 1;
        min-width: 60%;
    }

    .comment-meta {
        flex: 0 0 150px;
        flex-direction: column;
        gap: 0.25rem;
    }

    .comment-actions,
    .comment .actions {
        flex: 0 0 auto;
        align-self: center;
    }

    .comment-author {
        flex: 0 0 120px;
    }

    /* Comment Form - PC (Row Layout) */
    .comment-form {
        flex-direction: row;
        align-items: flex-start;
    }

    .comment-form textarea {
        flex: 1;
    }

    .comment-form-buttons {
        flex-direction: column;
        margin-left: 0.5rem;
    }

    .btn-comment-submit,
    .btn-comment-cancel {
        flex: none;
        min-width: 100px;
    }

    /* File Inputs - PC */
    #fileInputsContainer {
        max-width: 600px;
    }

    .existing-file {
        flex-wrap: nowrap;
    }

    /* Media Wrappers - PC */
    .audio-wrapper audio {
        max-width: 600px;
    }

    .video-wrapper video {
        max-width: 800px;
    }

    .youtube-wrapper iframe {
        max-width: 800px;
        height: 480px;
    }

    .youtube-wrapper-inline {
        max-width: 800px;
    }
}