/* Quick News Posts Styles */
.qnp-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

.qnp-search-container {
    margin-bottom: 20px;
}

.qnp-search-input {
    width: 100%;
    padding: 12px 20px;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 15px;
    box-sizing: border-box;
    transition: border-color 0.3s;
}

.qnp-search-input:focus {
    outline: none;
    border-color: #0073aa;
}

.qnp-posts-container {
    margin-top: 20px;
}

.qnp-posts-list {
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 8px;
    overflow: hidden;
}

.qnp-post-item {
    display: flex;
    gap: 20px;
    padding: 20px;
    border-bottom: 1px solid #eee;
    transition: background 0.2s ease;
}

.qnp-post-item:last-child {
    border-bottom: none;
}

.qnp-post-item:not(.qnp-form-item):hover {
    background: #f9f9f9;
}

.qnp-form-item {
    background: #f8f9fa;
}

.qnp-post-thumbnail {
    flex-shrink: 0;
    width: 200px;
}

.qnp-form-thumbnail {
    display: flex;
    align-items: flex-start;
}

.qnp-image-preview-new {
    width: 100%;
    height: 150px;
    position: relative;
}

.qnp-upload-placeholder {
    width: 100%;
    height: 100%;
    border: 2px dashed #ddd;
    border-radius: 8px;
    background: #fff;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    transition: all 0.3s;
}

.qnp-upload-placeholder:hover {
    border-color: #0073aa;
    background: #f0f8ff;
}

.qnp-upload-icon {
    font-size: 32px;
    margin-bottom: 8px;
}

.qnp-upload-text {
    font-size: 14px;
    color: #666;
}

.qnp-image-preview-new.has-image {
    border: 1px solid #ddd;
    border-radius: 8px;
    overflow: hidden;
}

.qnp-image-preview-new.has-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    cursor: pointer;
    display: block;
}

.qnp-image-preview-new.has-image .qnp-upload-placeholder {
    display: none;
}

.qnp-post-image {
    width: 100%;
    height: auto;
    border-radius: 4px;
    object-fit: cover;
}

.qnp-no-image {
    width: 100%;
    height: 150px;
    background: #f0f0f0;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #999;
    font-size: 14px;
}

.qnp-post-content {
    flex: 1;
    min-width: 0;
}

.qnp-form-content form {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.qnp-form-title-group,
.qnp-form-description-group {
    position: relative;
}

.qnp-title-input {
    width: 100%;
    font-size: 1.3em;
    font-weight: 600;
    border: none;
    border-bottom: 2px solid transparent;
    padding: 8px 0;
    color: #333;
    background: transparent;
    transition: border-color 0.3s;
    box-sizing: border-box;
}

.qnp-title-input:focus {
    outline: none;
    border-bottom-color: #0073aa;
}

.qnp-description-input {
    width: 100%;
    border: none;
    border-bottom: 2px solid transparent;
    padding: 8px 0;
    font-size: 15px;
    line-height: 1.6;
    color: #555;
    resize: none;
    background: transparent;
    font-family: inherit;
    transition: border-color 0.3s;
    box-sizing: border-box;
}

.qnp-description-input:focus {
    outline: none;
    border-bottom-color: #0073aa;
}

.qnp-char-count {
    position: absolute;
    right: 0;
    bottom: -20px;
    font-size: 0.85em;
    color: #999;
}

.qnp-form-actions {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-top: 10px;
}

.qnp-btn-primary,
.qnp-btn-secondary,
.qnp-btn-edit,
.qnp-btn-delete,
.qnp-btn-cancel {
    padding: 8px 16px;
    border: none;
    border-radius: 4px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.qnp-btn-primary {
    background: #0073aa;
    color: #fff;
}

.qnp-btn-primary:hover {
    background: #005a87;
}

.qnp-btn-secondary {
    background: #f0f0f0;
    color: #333;
}

.qnp-btn-secondary:hover {
    background: #e0e0e0;
}

.qnp-btn-edit {
    background: #f0f0f0;
    color: #333;
}

.qnp-btn-edit:hover {
    background: #0073aa;
    color: #fff;
}

.qnp-btn-delete {
    background: #f0f0f0;
    color: #d63638;
}

.qnp-btn-delete:hover {
    background: #d63638;
    color: #fff;
}

.qnp-btn-cancel {
    background: #f0f0f0;
    color: #666;
}

.qnp-btn-cancel:hover {
    background: #ddd;
}

.qnp-message {
    padding: 8px 12px;
    border-radius: 4px;
    font-size: 13px;
    display: none;
}

.qnp-message.success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
    display: block;
}

.qnp-message.error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
    display: block;
}

.qnp-post-title {
    margin: 0 0 10px 0;
    color: #333;
    font-size: 1.3em;
    font-weight: 600;
}

.qnp-post-meta {
    margin-bottom: 10px;
    font-size: 0.9em;
    color: #666;
}

.qnp-post-meta span {
    margin-right: 15px;
}

.qnp-post-description {
    color: #555;
    line-height: 1.6;
    margin-bottom: 10px;
}

.qnp-post-actions {
    display: flex;
    gap: 10px;
    margin-top: 15px;
}

.qnp-load-more-container {
    text-align: center;
    margin-top: 20px;
}

.qnp-loading {
    text-align: center;
    padding: 40px;
    color: #999;
}

.qnp-no-posts {
    text-align: center;
    padding: 40px;
    color: #999;
}

.qnp-post-item.editing {
    background: #f8f9fa;
}

.qnp-post-item.editing .qnp-post-title,
.qnp-post-item.editing .qnp-post-description,
.qnp-post-item.editing .qnp-post-actions {
    display: none;
}

.qnp-edit-form {
    display: none;
}

.qnp-post-item.editing .qnp-edit-form {
    display: block;
}

.qnp-edit-form form {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.qnp-edit-title-input {
    width: 100%;
    font-size: 1.3em;
    font-weight: 600;
    border: none;
    border-bottom: 2px solid #0073aa;
    padding: 8px 0;
    color: #333;
    background: transparent;
    box-sizing: border-box;
}

.qnp-edit-title-input:focus {
    outline: none;
}

.qnp-edit-description-input {
    width: 100%;
    border: none;
    border-bottom: 2px solid #0073aa;
    padding: 8px 0;
    font-size: 15px;
    line-height: 1.6;
    color: #555;
    resize: vertical;
    background: transparent;
    font-family: inherit;
    box-sizing: border-box;
}

.qnp-edit-description-input:focus {
    outline: none;
}

.qnp-edit-actions {
    display: flex;
    gap: 10px;
    align-items: center;
}

.editable-thumbnail {
    cursor: pointer;
    opacity: 0.9;
    transition: opacity 0.3s;
}

.editable-thumbnail:hover {
    opacity: 1;
}

@media (max-width: 768px) {
    .qnp-post-item {
        flex-direction: column;
    }
    
    .qnp-post-thumbnail {
        width: 100%;
    }
    
    .qnp-image-preview-new {
        height: 200px;
    }
}