/**
 * Frontend Post Manager Styles
 *
 * @package iCode
 */

/* Container */
.fpm-post-manager {
    max-width: 1200px;
    margin: 40px auto;
    padding: 0 20px;
}

/* Header */
.fpm-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 2px solid #e0e0e0;
}

.fpm-header h2 {
    margin: 0;
    font-size: 28px;
    color: #333;
}

.fpm-add-new {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

/* Messages */
.fpm-messages {
    margin-bottom: 20px;
}

.fpm-alert {
    padding: 15px 20px;
    border-radius: 4px;
    margin-bottom: 15px;
    font-size: 14px;
}

.fpm-alert-success {
    background-color: #d4edda;
    border: 1px solid #c3e6cb;
    color: #155724;
}

.fpm-alert-error {
    background-color: #f8d7da;
    border: 1px solid #f5c6cb;
    color: #721c24;
}

/* Post List Table */
.fpm-post-list {
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    overflow: hidden;
}

.fpm-table {
    width: 100%;
    border-collapse: collapse;
}

.fpm-table thead {
    background: #f8f9fa;
}

.fpm-table th {
    padding: 15px 20px;
    text-align: left;
    font-weight: 600;
    color: #495057;
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.fpm-table td {
    padding: 15px 20px;
    border-top: 1px solid #e9ecef;
    vertical-align: middle;
}

.fpm-table tbody tr {
    transition: background-color 0.2s;
}

.fpm-table tbody tr:hover {
    background-color: #f8f9fa;
}

.fpm-post-title {
    display: flex;
    align-items: center;
    gap: 12px;
}

.fpm-thumbnail img {
    width: 50px;
    height: 50px;
    object-fit: cover;
    border-radius: 4px;
}

/* Status Badges */
.fpm-status {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
}

.fpm-status-publish {
    background: #d4edda;
    color: #155724;
}

.fpm-status-draft {
    background: #fff3cd;
    color: #856404;
}

.fpm-status-pending {
    background: #d1ecf1;
    color: #0c5460;
}

.fpm-status-private {
    background: #e2e3e5;
    color: #383d41;
}

/* Action Buttons */
.fpm-actions {
    display: flex;
    gap: 8px;
}

.fpm-actions .btn {
    padding: 6px 12px;
}

/* No Posts */
.fpm-no-posts {
    text-align: center;
    padding: 60px 20px;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.fpm-no-posts p {
    font-size: 18px;
    color: #6c757d;
    margin-bottom: 20px;
}

/* Pagination */
.fpm-pagination {
    margin-top: 30px;
    text-align: center;
}

.fpm-pagination .page-numbers {
    display: inline-block;
    padding: 8px 12px;
    margin: 0 4px;
    background: #fff;
    border: 1px solid #dee2e6;
    border-radius: 4px;
    color: #007bff;
    text-decoration: none;
    transition: all 0.2s;
}

.fpm-pagination .page-numbers:hover {
    background: #007bff;
    color: #fff;
    border-color: #007bff;
}

.fpm-pagination .page-numbers.current {
    background: #007bff;
    color: #fff;
    border-color: #007bff;
}

/* Form Styles */
.fpm-form {
    background: #fff;
    padding: 30px;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.fpm-field {
    margin-bottom: 25px;
}

.fpm-field label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #495057;
    font-size: 14px;
}

.fpm-field .required {
    color: #dc3545;
}

.fpm-input-full {
    width: 100%;
    padding: 10px 15px;
    border: 1px solid #ced4da;
    border-radius: 4px;
    font-size: 14px;
    transition: border-color 0.2s;
}

.fpm-input-full:focus {
    outline: none;
    border-color: #80bdff;
    box-shadow: 0 0 0 0.2rem rgba(0,123,255,.25);
}

.fpm-help-text {
    display: block;
    margin-top: 5px;
    font-size: 12px;
    color: #6c757d;
}

/* Row and Columns */
.fpm-row {
    display: flex;
    gap: 30px;
    margin-bottom: 25px;
}

.fpm-col-6 {
    flex: 1;
}

/* Checkbox Styles */
.fpm-checkbox {
    margin-bottom: 10px;
}

.fpm-checkbox input[type="checkbox"] {
    margin-right: 8px;
}

.fpm-checkbox label {
    display: inline;
    font-weight: normal;
    cursor: pointer;
}

/* Featured Image */
.fpm-featured-image-wrapper {
    border: 1px dashed #ced4da;
    border-radius: 4px;
    padding: 20px;
    text-align: center;
}

.fpm-featured-image-preview {
    margin-bottom: 15px;
    min-height: 200px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f8f9fa;
    border-radius: 4px;
}

.fpm-featured-image-preview img {
    max-width: 100%;
    height: auto;
    border-radius: 4px;
}

.fpm-no-image {
    text-align: center;
    color: #6c757d;
}

.fpm-no-image i {
    font-size: 48px;
    margin-bottom: 10px;
    opacity: 0.5;
}

.fpm-image-buttons {
    display: flex;
    gap: 10px;
    justify-content: center;
}

/* Form Footer */
.fpm-form-footer {
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px solid #e9ecef;
    display: flex;
    gap: 15px;
}

.fpm-submit-btn {
    min-width: 150px;
}

/* WordPress Editor Wrapper */
.wp-editor-wrap {
    border: 1px solid #ced4da;
    border-radius: 4px;
}

/* Responsive */
@media (max-width: 768px) {
    .fpm-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 15px;
    }

    .fpm-table {
        font-size: 14px;
    }

    .fpm-table th,
    .fpm-table td {
        padding: 10px;
    }

    .fpm-thumbnail img {
        width: 40px;
        height: 40px;
    }

    .fpm-actions {
        flex-direction: column;
    }

    .fpm-row {
        flex-direction: column;
        gap: 0;
    }

    .fpm-form {
        padding: 20px;
    }
}

@media (max-width: 576px) {
    .fpm-table thead {
        display: none;
    }

    .fpm-table,
    .fpm-table tbody,
    .fpm-table tr,
    .fpm-table td {
        display: block;
        width: 100%;
    }

    .fpm-table tr {
        margin-bottom: 20px;
        border: 1px solid #e9ecef;
        border-radius: 4px;
        padding: 15px;
    }

    .fpm-table td {
        border: none;
        padding: 8px 0;
        text-align: left;
    }

    .fpm-table td:before {
        content: attr(data-label);
        font-weight: 600;
        display: inline-block;
        width: 100px;
    }

    .fpm-actions {
        flex-direction: row;
        margin-top: 10px;
    }
}
