/* ============================
   Article List Page
   ============================ */

.article-list-container {
    max-width: 1100px;
    margin: 60px auto;
    padding: 40px 20px 20px;
    font-family: 'Arial', sans-serif;
    box-sizing: border-box;
    overflow-wrap: break-word;
}

.article-list-title {
    text-align: center;
    color: #08386c;
    font-size: 36px;
    font-weight: bold;
    margin-bottom: 30px;
}

.article-filters {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 40px;
}

.filter-btn {
    padding: 8px 20px;
    border-radius: 20px;
    text-decoration: none;
    font-size: 14px;
    font-weight: 600;
    color: #08386c;
    background: #f0f4f8;
    border: 2px solid #e0e6ed;
    transition: all 0.3s;
}

.filter-btn:hover {
    background: #08386c;
    color: #fff;
    border-color: #08386c;
}

.filter-btn.active {
    background: #08386c;
    color: #fff;
    border-color: #08386c;
}

.article-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(min(320px, 100%), 1fr));
    gap: 25px;
}

.article-card {
    background: #fff;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.08);
    transition: transform 0.3s, box-shadow 0.3s;
}

.article-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.12);
}

.article-cover {
    width: 100%;
    height: 200px;
    overflow: hidden;
}

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

.article-cover-placeholder {
    background: #f0f4f8;
    display: flex;
    align-items: center;
    justify-content: center;
}

.article-card-body {
    padding: 20px;
}

.article-category-badge {
    display: inline-block;
    padding: 4px 12px;
    background: #e8f0fe;
    color: #08386c;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
    margin-bottom: 10px;
}

.article-card-title {
    color: #08386c;
    font-size: 20px;
    font-weight: 600;
    margin-bottom: 10px;
    line-height: 1.3;
}

.article-card-summary {
    font-size: 14px;
    color: #555;
    line-height: 1.6;
    margin-bottom: 12px;
}

.article-card-meta {
    display: flex;
    justify-content: space-between;
    font-size: 13px;
    color: #888;
    margin-bottom: 15px;
}

.article-read-btn {
    display: inline-block;
    padding: 10px 24px;
    background: #08386c;
    color: #fff;
    border-radius: 6px;
    text-decoration: none;
    font-weight: 600;
    font-size: 14px;
    transition: background 0.3s;
}

.article-read-btn:hover {
    background: #062b52;
}

.no-articles {
    text-align: center;
    color: #555;
    font-size: 16px;
    margin-top: 60px;
}

/* ============================
   Article Detail Page
   ============================ */

.article-detail-container {
    max-width: 900px;
    margin: 60px auto;
    padding: 0 20px 60px;
    font-family: 'Arial', sans-serif;
    box-sizing: border-box;
    overflow-wrap: break-word;
    word-wrap: break-word;
}

.article-detail-header {
    margin-bottom: 30px;
}

.back-link {
    display: inline-block;
    margin-bottom: 20px;
    color: #08386c;
    text-decoration: none;
    font-weight: 600;
    font-size: 15px;
}

.back-link:hover {
    text-decoration: underline;
}

.article-detail-cover {
    width: 100%;
    max-height: 400px;
    border-radius: 12px;
    overflow: hidden;
    margin-bottom: 25px;
}

.article-detail-cover img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.article-detail-top {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 15px;
}

.article-status-badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
}

.article-status-published {
    background: #d4edda;
    color: #155724;
}

.article-status-draft {
    background: #fff3cd;
    color: #856404;
}

.article-detail-title {
    color: #08386c;
    font-size: 32px;
    font-weight: bold;
    line-height: 1.3;
    margin-bottom: 15px;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

.article-detail-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 12px 20px;
    font-size: 14px;
    color: #666;
    margin-bottom: 20px;
}

.article-meta-item {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    flex-wrap: nowrap;
    min-width: 0;
}

.article-meta-item svg {
    flex-shrink: 0;
}

.article-detail-summary {
    padding: 15px 20px;
    background: #f8f9fa;
    border-left: 4px solid #08386c;
    border-radius: 0 8px 8px 0;
    font-size: 16px;
    color: #333;
    line-height: 1.6;
    margin-bottom: 25px;
    overflow-wrap: break-word;
    word-wrap: break-word;
}

.article-detail-description {
    font-size: 16px;
    color: #333;
    line-height: 1.8;
    margin-bottom: 30px;
    text-align: justify;
    overflow-wrap: break-word;
    word-wrap: break-word;
}

.article-detail-description a {
    color: #08386c;
    text-decoration: underline;
    font-weight: 600;
    transition: color 0.2s;
    word-break: break-word;
}

.article-detail-description a:hover {
    color: #062b52;
}

.article-pdf-actions {
    display: flex;
    gap: 15px;
    margin-bottom: 30px;
    flex-wrap: wrap;
}

.pdf-action-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 24px;
    border-radius: 8px;
    text-decoration: none;
    font-weight: 600;
    font-size: 15px;
    transition: all 0.3s;
    min-width: 0;
    flex-shrink: 0;
}

.pdf-view {
    background: #08386c;
    color: #fff;
}

.pdf-view:hover {
    background: #062b52;
}

.pdf-download {
    background: #28a745;
    color: #fff;
}

.pdf-download:hover {
    background: #218838;
}

.article-pdf-viewer-section h3 {
    color: #08386c;
    font-size: 20px;
    margin-bottom: 15px;
}

.pdf-viewer-wrapper {
    width: 100%;
    height: 80vh;
    border: 2px solid #ddd;
    border-radius: 8px;
    overflow: hidden;
    background: #f5f5f5;
}

.pdf-viewer {
    width: 100%;
    height: 100%;
    border: none;
}

/* ============================
   Article Form (Create/Edit)
   ============================ */

.article-form-container {
    max-width: 700px;
    margin: 60px auto;
    background: #fff;
    padding: 35px;
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08);
    font-family: Arial, sans-serif;
}

.article-form-container h2 {
    text-align: center;
    color: #08386c;
    margin-bottom: 25px;
    font-size: 28px;
    font-weight: bold;
}

.article-form .form-group {
    margin-bottom: 20px;
}

.article-form label {
    display: block;
    margin-bottom: 6px;
    font-size: 15px;
    font-weight: 600;
    color: #333;
}

.article-form label .required {
    color: #e74c3c;
}

.article-form input[type="text"],
.article-form input[type="file"],
.article-form textarea,
.article-form select {
    width: 100%;
    padding: 12px;
    border: 1px solid #ccc;
    border-radius: 8px;
    font-size: 14px;
    background: #f9f9f9;
    transition: border 0.3s;
}

.article-form input:focus,
.article-form textarea:focus,
.article-form select:focus {
    border-color: #08386c;
    outline: none;
    box-shadow: 0 0 5px rgba(8, 56, 108, 0.2);
}

.article-form textarea {
    resize: vertical;
}

.form-row {
    display: flex;
    gap: 20px;
}

.form-group-half {
    flex: 1;
}

.form-error {
    color: #e74c3c;
    font-size: 13px;
    margin-top: 5px;
}

.form-error-global {
    background: #f8d7da;
    padding: 12px;
    border-radius: 8px;
    margin-bottom: 20px;
}

.form-help {
    display: block;
    margin-top: 5px;
    color: #888;
    font-size: 12px;
}

.current-file a {
    color: #08386c;
    font-weight: 600;
}

.form-actions {
    display: flex;
    gap: 15px;
    margin-top: 25px;
}

.article-submit-btn {
    flex: 1;
    padding: 14px;
    background: #08386c;
    color: #fff;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
    transition: background 0.3s;
}

.article-submit-btn:hover {
    background: #062b52;
}

.article-cancel-btn {
    padding: 14px 24px;
    background: #6c757d;
    color: #fff;
    border-radius: 8px;
    text-decoration: none;
    font-weight: 600;
    font-size: 16px;
    transition: background 0.3s;
}

.article-cancel-btn:hover {
    background: #5a6268;
}

/* ============================
   Article Manage (Table)
   ============================ */

.article-manage-container {
    max-width: 1100px;
    margin: 60px auto;
    padding: 0 20px 60px;
    font-family: Arial, sans-serif;
}

.article-manage-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
}

.article-manage-header h2 {
    color: #08386c;
    font-size: 28px;
    font-weight: bold;
}

.article-create-btn {
    display: inline-block;
    padding: 12px 24px;
    background: #28a745;
    color: #fff;
    border-radius: 8px;
    text-decoration: none;
    font-weight: 600;
    font-size: 15px;
    transition: background 0.3s;
}

.article-create-btn:hover {
    background: #218838;
}

.article-table-wrapper {
    overflow-x: auto;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08);
}

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

.article-table th {
    background: #08386c;
    color: #fff;
    padding: 14px 16px;
    text-align: left;
    font-size: 14px;
    font-weight: 600;
}

.article-table td {
    padding: 14px 16px;
    border-bottom: 1px solid #eee;
    font-size: 14px;
    color: #333;
}

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

.article-table-title a {
    color: #08386c;
    text-decoration: none;
    font-weight: 600;
}

.article-table-title a:hover {
    text-decoration: underline;
}

.article-table-actions {
    display: flex;
    gap: 8px;
    align-items: center;
    flex-wrap: wrap;
}

.action-btn {
    display: inline-block;
    padding: 6px 14px;
    border-radius: 6px;
    text-decoration: none;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    border: none;
    transition: background 0.3s;
}

.action-edit {
    background: #ffc107;
    color: #212529;
}

.action-edit:hover {
    background: #e0a800;
}

.action-publish {
    background: #28a745;
    color: #fff;
}

.action-publish:hover {
    background: #218838;
}

.action-unpublish {
    background: #fd7e14;
    color: #fff;
}

.action-unpublish:hover {
    background: #e8590c;
}

.action-delete {
    background: #dc3545;
    color: #fff;
}

.action-delete:hover {
    background: #c82333;
}

.action-cancel {
    background: #6c757d;
    color: #fff;
}

.action-cancel:hover {
    background: #5a6268;
}

.inline-form {
    display: inline;
}

.no-articles-manage {
    text-align: center;
    color: #555;
    font-size: 16px;
    margin-top: 60px;
}

.no-articles-manage .article-create-btn {
    margin-top: 15px;
}

/* ============================
   Confirm Delete Page
   ============================ */

.article-confirm-container {
    max-width: 500px;
    margin: 80px auto;
    padding: 0 20px;
}

.article-confirm-box {
    background: #fff;
    padding: 40px;
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08);
    text-align: center;
    font-family: Arial, sans-serif;
}

.article-confirm-box h2 {
    color: #e74c3c;
    font-size: 26px;
    margin-bottom: 20px;
}

.article-confirm-icon {
    margin-bottom: 20px;
}

.article-confirm-box p {
    font-size: 16px;
    color: #333;
    margin-bottom: 10px;
}

.confirm-warning {
    color: #888;
    font-size: 14px;
}

.confirm-actions {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin-top: 25px;
}

/* ============================
   Messages
   ============================ */

.article-messages {
    margin-bottom: 20px;
}

.article-message {
    padding: 12px 20px;
    border-radius: 8px;
    margin-bottom: 10px;
    font-size: 14px;
    font-weight: 500;
}

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

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

.article-message-warning {
    background: #fff3cd;
    color: #856404;
    border: 1px solid #ffeeba;
}

/* ============================
   Responsive
   ============================ */

@media (max-width: 768px) {
    .article-list-title {
        font-size: 28px;
    }

    .article-grid {
        grid-template-columns: 1fr;
    }

    .article-detail-container {
        padding: 0 15px 40px;
        margin: 30px auto;
    }

    .article-detail-title {
        font-size: 24px;
    }

    .article-detail-cover {
        max-height: 250px;
        margin-bottom: 15px;
        border-radius: 8px;
    }

    .article-detail-summary {
        padding: 12px 15px;
        font-size: 15px;
        margin-bottom: 20px;
    }

    .article-detail-description {
        font-size: 15px;
    }

    .article-detail-meta {
        gap: 8px 15px;
        font-size: 13px;
    }

    .article-meta-item {
        gap: 4px;
    }

    .pdf-viewer-wrapper {
        height: 60vh;
    }

    .form-row {
        flex-direction: column;
        gap: 0;
    }

    .form-group-half {
        width: 100%;
    }

    .article-manage-header {
        flex-direction: column;
        gap: 15px;
        align-items: flex-start;
    }

    .article-table th:nth-child(4),
    .article-table td:nth-child(4) {
        display: none;
    }

    .article-table-actions {
        flex-direction: column;
        align-items: flex-start;
    }

    .pdf-action-btn {
        width: 100%;
        justify-content: center;
    }

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

@media (max-width: 480px) {
    .article-list-container {
        padding: 30px 12px 15px;
        margin: 20px auto;
    }

    .article-list-title {
        font-size: 22px;
        margin-bottom: 20px;
    }

    .article-card-body {
        padding: 15px;
    }

    .article-card-title {
        font-size: 17px;
    }

    .article-card-summary {
        font-size: 13px;
    }

    .article-read-btn {
        padding: 8px 18px;
        font-size: 13px;
    }

    .article-detail-container {
        padding: 0 12px 30px;
        margin: 15px auto;
    }

    .back-link {
        font-size: 14px;
        margin-bottom: 12px;
    }

    .article-detail-title {
        font-size: 20px;
        margin-bottom: 10px;
    }

    .article-detail-top {
        gap: 8px;
        margin-bottom: 10px;
    }

    .article-category-badge {
        font-size: 11px;
        padding: 3px 10px;
    }

    .article-status-badge {
        font-size: 11px;
        padding: 3px 10px;
    }

    .article-detail-meta {
        flex-direction: column;
        gap: 6px;
        font-size: 12px;
    }

    .article-detail-summary {
        padding: 10px 12px;
        font-size: 14px;
        border-left-width: 3px;
        margin-bottom: 15px;
    }

    .article-detail-description {
        font-size: 14px;
        line-height: 1.7;
        margin-bottom: 20px;
    }

    .article-pdf-actions {
        gap: 10px;
        margin-bottom: 20px;
    }

    .pdf-action-btn {
        padding: 10px 16px;
        font-size: 13px;
        gap: 6px;
    }
}

@media (max-width: 360px) {
    .article-list-container {
        padding: 25px 10px 10px;
    }

    .article-detail-container {
        padding: 0 10px 20px;
    }

    .article-detail-title {
        font-size: 18px;
    }

    .article-detail-summary {
        padding: 8px 10px;
        font-size: 13px;
    }

    .pdf-action-btn {
        padding: 8px 12px;
        font-size: 12px;
    }
}
