/* Guest Post Plugin - Frontend Styles */

:root {
    --gpp-primary-color: #0073aa;
    --gpp-primary-hover: #005a87;
    --gpp-border-color: #ddd;
    --gpp-background-color: #f9f9f9;
    --gpp-text-color: #333;
    --gpp-error-color: #d63638;
    --gpp-success-color: #00a32a;
    --gpp-warning-color: #dba617;
}

/* Form Container */
.gpp-form-container {
    max-width: 800px;
    margin: 20px 0;
    padding: 30px;
    background: #fff;
    border: 1px solid var(--gpp-border-color);
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.gpp-form-title {
    margin: 0 0 25px 0;
    font-size: 24px;
    color: var(--gpp-text-color);
    border-bottom: 2px solid var(--gpp-primary-color);
    padding-bottom: 10px;
}

/* Form Layouts */
.gpp-post-form.layout-vertical .gpp-form-field {
    margin-bottom: 20px;
}

.gpp-post-form.layout-horizontal {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
}

.gpp-post-form.layout-horizontal .gpp-form-field {
    flex: 1;
    min-width: 300px;
}

.gpp-post-form.layout-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
}

/* Form Fields */
.gpp-form-field label {
    display: block;
    margin-bottom: 8px;
    font-weight: bold;
    color: var(--gpp-text-color);
}

.gpp-form-field .required {
    color: var(--gpp-error-color);
}

.gpp-form-field input[type="text"],
.gpp-form-field input[type="url"],
.gpp-form-field textarea {
    width: 100%;
    padding: 12px;
    border: 1px solid var(--gpp-border-color);
    border-radius: 4px;
    font-size: 16px;
    transition: border-color 0.3s ease;
    box-sizing: border-box;
}

.gpp-form-field input:focus,
.gpp-form-field textarea:focus {
    outline: none;
    border-color: var(--gpp-primary-color);
    box-shadow: 0 0 0 2px rgba(0, 115, 170, 0.2);
}

.gpp-form-field textarea {
    resize: vertical;
    min-height: 120px;
}

.gpp-form-field .description {
    display: block;
    margin-top: 5px;
    font-size: 14px;
    color: #666;
}

/* Submit Button */
.gpp-form-submit {
    text-align: center;
    margin-top: 30px;
}

.gpp-submit-button {
    background: var(--gpp-primary-color);
    color: white;
    border: none;
    padding: 15px 30px;
    font-size: 16px;
    border-radius: 4px;
    cursor: pointer;
    transition: background-color 0.3s ease;
    min-width: 150px;
}

.gpp-submit-button:hover {
    background: var(--gpp-primary-hover);
}

.gpp-submit-button:disabled {
    background: #ccc;
    cursor: not-allowed;
}

/* Loading Indicator */
.gpp-loading {
    margin-top: 10px;
    color: var(--gpp-primary-color);
    font-style: italic;
}

/* Messages */
.gpp-message {
    margin: 20px 0;
    padding: 15px;
    border-radius: 4px;
    font-weight: bold;
}

.gpp-message.success {
    background: #d1e7dd;
    color: var(--gpp-success-color);
    border: 1px solid #badbcc;
}

.gpp-message.error {
    background: #f8d7da;
    color: var(--gpp-error-color);
    border: 1px solid #f5c2c7;
}

.gpp-login-required {
    background: #fff3cd;
    color: var(--gpp-warning-color);
    border: 1px solid #ffecb5;
    padding: 15px;
    border-radius: 4px;
    text-align: center;
}

.gpp-login-required a {
    color: var(--gpp-primary-color);
    text-decoration: none;
    font-weight: bold;
}

.gpp-login-required a:hover {
    text-decoration: underline;
}

/* Posts List */
.gpp-posts-list {
    max-width: 900px;
    margin: 20px 0;
}

.gpp-post-item {
    background: #fff;
    border: 1px solid var(--gpp-border-color);
    border-radius: 8px;
    margin-bottom: 20px;
    overflow: hidden;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
    transition: box-shadow 0.3s ease;
}

.gpp-post-item:hover {
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.15);
}

.gpp-post-image {
    width: 100%;
    height: 200px;
    overflow: hidden;
}

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

.gpp-post-content {
    padding: 20px;
}

.gpp-post-title {
    margin: 0 0 15px 0;
    font-size: 22px;
    color: var(--gpp-text-color);
}

.gpp-post-meta {
    margin-bottom: 15px;
    font-size: 14px;
    color: #666;
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
}

.gpp-post-author,
.gpp-post-date {
    display: inline-flex;
    align-items: center;
}

.gpp-post-excerpt {
    margin-bottom: 15px;
    font-style: italic;
    color: #555;
    border-left: 3px solid var(--gpp-primary-color);
    padding-left: 15px;
}

.gpp-post-text {
    line-height: 1.6;
    color: var(--gpp-text-color);
}

.gpp-post-text p {
    margin-bottom: 15px;
}

.gpp-post-text p:last-child {
    margin-bottom: 0;
}

/* No Posts Message */
.gpp-no-posts {
    text-align: center;
    padding: 40px;
    background: var(--gpp-background-color);
    border-radius: 8px;
    color: #666;
    font-style: italic;
}

/* Pagination */
.gpp-pagination {
    text-align: center;
    margin-top: 30px;
}

.gpp-pagination .page-numbers {
    display: inline-block;
    padding: 8px 12px;
    margin: 0 4px;
    background: #fff;
    border: 1px solid var(--gpp-border-color);
    color: var(--gpp-primary-color);
    text-decoration: none;
    border-radius: 4px;
    transition: all 0.3s ease;
}

.gpp-pagination .page-numbers:hover {
    background: var(--gpp-primary-color);
    color: white;
    border-color: var(--gpp-primary-color);
}

.gpp-pagination .page-numbers.current {
    background: var(--gpp-primary-color);
    color: white;
    border-color: var(--gpp-primary-color);
}

.gpp-pagination .page-numbers.prev,
.gpp-pagination .page-numbers.next {
    font-weight: bold;
}

/* Responsive Design */
@media (max-width: 768px) {
    .gpp-form-container {
        padding: 20px;
        margin: 10px;
    }
    
    .gpp-post-form.layout-horizontal {
        flex-direction: column;
    }
    
    .gpp-post-form.layout-horizontal .gpp-form-field {
        min-width: auto;
    }
    
    .gpp-post-meta {
        flex-direction: column;
        gap: 8px;
    }
    
    .gpp-post-title {
        font-size: 20px;
    }
    
    .gpp-submit-button {
        width: 100%;
    }
}

/* Image Upload Styles */
.gpp-image-upload-container {
    margin-top: 10px;
}

.gpp-media-button {
    background: var(--gpp-primary-color);
    color: white;
    border: none;
    padding: 8px 15px;
    border-radius: 4px;
    cursor: pointer;
    margin-left: 10px;
    font-size: 14px;
}

.gpp-media-button:hover {
    background: var(--gpp-primary-hover);
}

.gpp-image-preview {
    margin-top: 15px;
    padding: 15px;
    border: 1px solid var(--gpp-border-color);
    border-radius: 4px;
    background: var(--gpp-background-color);
}

.gpp-preview-img {
    max-width: 300px;
    max-height: 200px;
    width: auto;
    height: auto;
    display: block;
    margin-bottom: 10px;
    border-radius: 4px;
}

.gpp-remove-image {
    background: var(--gpp-error-color);
    color: white;
    border: none;
    padding: 5px 10px;
    border-radius: 3px;
    cursor: pointer;
    font-size: 12px;
}

.gpp-remove-image:hover {
    background: #b32d2e;
}

/* Post Footer */
.gpp-post-footer {
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px solid var(--gpp-border-color);
}

.gpp-read-more {
    color: var(--gpp-primary-color);
    text-decoration: none;
    font-weight: bold;
}

.gpp-read-more:hover {
    text-decoration: underline;
}

.gpp-post-title a {
    color: inherit;
    text-decoration: none;
}

.gpp-post-title a:hover {
    color: var(--gpp-primary-color);
}

@media (max-width: 480px) {
    .gpp-form-title {
        font-size: 20px;
    }
    
    .gpp-post-content {
        padding: 15px;
    }
    
    .gpp-post-image {
        height: 150px;
    }
    
    .gpp-media-button {
        width: 100%;
        margin: 10px 0 0 0;
    }
    
    .gpp-preview-img {
        max-width: 100%;
    }
}