/**
 * Blog Publisher Pro - Frontend Styles
 * Styled to match The Beauty Advice Clinic aesthetic
 * Primary: #C9A227 (gold), Secondary: #F9F6F0 (cream), Text: #333
 */

:root {
    --bpp-primary: #C9A227;
    --bpp-primary-hover: #B8911F;
    --bpp-primary-light: rgba(201, 162, 39, 0.1);
    --bpp-secondary: #F9F6F0;
    --bpp-text: #333333;
    --bpp-text-light: #666666;
    --bpp-text-muted: #999999;
    --bpp-border: #E5E5E5;
    --bpp-border-light: #F0F0F0;
    --bpp-white: #FFFFFF;
    --bpp-success: #4CAF50;
    --bpp-warning: #FFA726;
    --bpp-error: #EF5350;
    --bpp-radius: 4px;
    --bpp-radius-lg: 8px;
    --bpp-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    --bpp-shadow-lg: 0 4px 20px rgba(0, 0, 0, 0.1);
    --bpp-transition: all 0.3s ease;
    --bpp-font: 'Lato', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    --bpp-font-heading: 'Playfair Display', Georgia, serif;
}

/* Base Wrapper */
.bpp-submission-wrapper,
.bpp-user-posts-wrapper {
    max-width: 800px;
    margin: 0 auto;
    padding: 40px 20px;
    font-family: var(--bpp-font);
    color: var(--bpp-text);
    line-height: 1.6;
}

/* Form Styles */
.bpp-form {
    background: var(--bpp-white);
    border-radius: var(--bpp-radius-lg);
    box-shadow: var(--bpp-shadow);
    padding: 40px;
}

.bpp-form-section {
    margin-bottom: 32px;
}

.bpp-form-section:last-of-type {
    margin-bottom: 0;
}

.bpp-section-label {
    display: block;
    font-family: var(--bpp-font-heading);
    font-size: 18px;
    font-weight: 600;
    color: var(--bpp-primary);
    margin-bottom: 12px;
}

.bpp-section-label .required {
    color: var(--bpp-error);
}

.bpp-section-label .optional {
    font-weight: 400;
    font-size: 14px;
    color: var(--bpp-text-muted);
}

.bpp-sub-label {
    font-size: 15px;
    margin-top: 16px;
}

/* Input Styles */
.bpp-input,
.bpp-textarea {
    width: 100%;
    padding: 14px 16px;
    font-family: var(--bpp-font);
    font-size: 16px;
    color: var(--bpp-text);
    background: var(--bpp-white);
    border: 1px solid var(--bpp-border);
    border-radius: var(--bpp-radius);
    transition: var(--bpp-transition);
    box-sizing: border-box;
}

.bpp-input:focus,
.bpp-textarea:focus {
    outline: none;
    border-color: var(--bpp-primary);
    box-shadow: 0 0 0 3px var(--bpp-primary-light);
}

.bpp-input::placeholder,
.bpp-textarea::placeholder {
    color: var(--bpp-text-muted);
}

.bpp-field-hint {
    margin-top: 8px;
    font-size: 13px;
    color: var(--bpp-text-muted);
}

/* Image Uploader */
.bpp-image-uploader {
    position: relative;
    border: 2px dashed var(--bpp-border);
    border-radius: var(--bpp-radius-lg);
    background: var(--bpp-secondary);
    transition: var(--bpp-transition);
    overflow: hidden;
}

.bpp-image-uploader:hover {
    border-color: var(--bpp-primary);
    background: var(--bpp-primary-light);
}

.bpp-image-uploader.has-image {
    border-style: solid;
    background: var(--bpp-white);
}

.bpp-image-preview {
    display: none;
}

.bpp-image-uploader.has-image .bpp-image-preview {
    display: block;
}

.bpp-image-uploader.has-image .bpp-image-upload-area {
    display: none;
}

.bpp-image-preview img {
    width: 100%;
    height: 300px;
    object-fit: cover;
    display: block;
}

.bpp-image-upload-area {
    padding: 60px 20px;
    text-align: center;
    cursor: pointer;
}

.bpp-upload-icon {
    color: var(--bpp-primary);
    margin-bottom: 16px;
}

.bpp-upload-text {
    font-size: 16px;
    color: var(--bpp-text);
    margin: 0 0 8px 0;
}

.bpp-upload-hint {
    font-size: 13px;
    color: var(--bpp-text-muted);
    margin: 0;
}

.bpp-remove-image {
    position: absolute;
    top: 12px;
    right: 12px;
    width: 36px;
    height: 36px;
    background: var(--bpp-white);
    border: none;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: var(--bpp-shadow);
    transition: var(--bpp-transition);
    color: var(--bpp-text);
}

.bpp-remove-image:hover {
    background: var(--bpp-error);
    color: var(--bpp-white);
}

.bpp-upload-progress {
    padding: 20px;
    text-align: center;
}

.bpp-progress-bar {
    height: 4px;
    background: var(--bpp-border);
    border-radius: 2px;
    overflow: hidden;
    margin-bottom: 8px;
}

.bpp-progress-fill {
    height: 100%;
    background: var(--bpp-primary);
    width: 0;
    transition: width 0.3s ease;
    animation: progress-pulse 1.5s ease-in-out infinite;
}

@keyframes progress-pulse {
    0%, 100% { width: 30%; margin-left: 0; }
    50% { width: 60%; margin-left: 40%; }
}

.bpp-progress-text {
    font-size: 13px;
    color: var(--bpp-text-muted);
}

/* Social Options */
.bpp-social-options {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
}

/* Category Selection */
.bpp-category-select {
    margin-top: 8px;
}

.bpp-select {
    width: 100%;
    padding: 14px 16px;
    font-family: var(--bpp-font);
    font-size: 16px;
    color: var(--bpp-text);
    background: var(--bpp-white);
    border: 1px solid var(--bpp-border);
    border-radius: var(--bpp-radius);
    transition: var(--bpp-transition);
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23333' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 16px center;
    padding-right: 40px;
}

.bpp-select:focus {
    outline: none;
    border-color: var(--bpp-primary);
    box-shadow: 0 0 0 3px var(--bpp-primary-light);
}

.bpp-category-checkboxes {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

.bpp-category-checkbox {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 14px;
    background: var(--bpp-secondary);
    border-radius: var(--bpp-radius);
    cursor: pointer;
    transition: var(--bpp-transition);
    font-size: 14px;
}

.bpp-category-checkbox:hover {
    background: var(--bpp-primary-light);
}

.bpp-category-checkbox input {
    accent-color: var(--bpp-primary);
    width: 16px;
    height: 16px;
    cursor: pointer;
}

.bpp-category-checkbox input:checked + span {
    color: var(--bpp-primary);
    font-weight: 600;
}

.bpp-checkbox-label {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
    background: var(--bpp-secondary);
    border-radius: var(--bpp-radius);
    cursor: pointer;
    transition: var(--bpp-transition);
}

.bpp-checkbox-label:hover {
    background: var(--bpp-primary-light);
}

.bpp-checkbox-label input {
    display: none;
}

.bpp-checkbox-label input:checked + .bpp-checkbox-icon {
    color: var(--bpp-primary);
}

.bpp-checkbox-label input:checked ~ span:last-child {
    color: var(--bpp-primary);
    font-weight: 600;
}

.bpp-checkbox-icon {
    color: var(--bpp-text-muted);
    transition: var(--bpp-transition);
}

.bpp-social-caption-wrapper {
    margin-top: 20px;
}

/* Buttons */
.bpp-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 14px 28px;
    font-family: var(--bpp-font);
    font-size: 15px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border: none;
    border-radius: var(--bpp-radius);
    cursor: pointer;
    transition: var(--bpp-transition);
    text-decoration: none;
}

.bpp-button-primary {
    background: var(--bpp-primary);
    color: var(--bpp-white);
}

.bpp-button-primary:hover {
    background: var(--bpp-primary-hover);
    color: var(--bpp-white);
    transform: translateY(-1px);
    box-shadow: var(--bpp-shadow);
}

.bpp-button-secondary {
    background: transparent;
    color: var(--bpp-text);
    border: 1px solid var(--bpp-border);
}

.bpp-button-secondary:hover {
    border-color: var(--bpp-primary);
    color: var(--bpp-primary);
}

.bpp-button:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.bpp-form-actions {
    display: flex;
    gap: 16px;
    justify-content: flex-end;
    margin-top: 40px;
    padding-top: 32px;
    border-top: 1px solid var(--bpp-border-light);
}

.bpp-button-loading {
    display: inline-flex;
}

.bpp-spinner {
    animation: spin 1s linear infinite;
}

@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* Messages */
.bpp-form-messages {
    margin-top: 24px;
    padding: 16px 20px;
    border-radius: var(--bpp-radius);
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
}

.bpp-form-messages.bpp-success {
    background: rgba(76, 175, 80, 0.1);
    border: 1px solid var(--bpp-success);
    color: #2E7D32;
}

.bpp-form-messages.bpp-error {
    background: rgba(239, 83, 80, 0.1);
    border: 1px solid var(--bpp-error);
    color: #C62828;
}

.bpp-feedback-notice {
    background: #FFF3E0;
    border-left: 4px solid var(--bpp-warning);
    padding: 20px 24px;
    margin-bottom: 24px;
    border-radius: var(--bpp-radius);
}

.bpp-feedback-notice h4 {
    margin: 0 0 8px 0;
    font-family: var(--bpp-font-heading);
    color: #E65100;
}

.bpp-feedback-notice p {
    margin: 0;
    color: var(--bpp-text);
}

.bpp-success-notice {
    display: flex;
    align-items: flex-start;
    gap: 16px;
    background: rgba(76, 175, 80, 0.1);
    border: 1px solid var(--bpp-success);
    padding: 20px 24px;
    margin-bottom: 32px;
    border-radius: var(--bpp-radius);
    color: #2E7D32;
}

.bpp-success-notice svg {
    flex-shrink: 0;
    margin-top: 2px;
}

.bpp-success-notice h4 {
    margin: 0 0 4px 0;
    font-family: var(--bpp-font-heading);
}

.bpp-success-notice p {
    margin: 0;
    font-size: 14px;
}

/* Form Footer */
.bpp-form-footer {
    margin-top: 24px;
    text-align: center;
}

.bpp-link {
    color: var(--bpp-primary);
    text-decoration: none;
    font-weight: 500;
    transition: var(--bpp-transition);
}

.bpp-link:hover {
    color: var(--bpp-primary-hover);
}

/* User Posts Page */
.bpp-user-stats {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
    margin-bottom: 40px;
}

.bpp-stat-item {
    background: var(--bpp-white);
    border-radius: var(--bpp-radius-lg);
    padding: 24px;
    text-align: center;
    box-shadow: var(--bpp-shadow);
    border-left: 3px solid var(--bpp-border);
}

.bpp-stat-item.bpp-stat-draft {
    border-color: var(--bpp-text-muted);
}

.bpp-stat-item.bpp-stat-pending {
    border-color: var(--bpp-warning);
}

.bpp-stat-item.bpp-stat-published {
    border-color: var(--bpp-success);
}

.bpp-stat-value {
    display: block;
    font-family: var(--bpp-font-heading);
    font-size: 32px;
    font-weight: 600;
    color: var(--bpp-primary);
    line-height: 1;
    margin-bottom: 4px;
}

.bpp-stat-name {
    font-size: 13px;
    color: var(--bpp-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.bpp-posts-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
}

.bpp-posts-header h3 {
    font-family: var(--bpp-font-heading);
    font-size: 24px;
    color: var(--bpp-primary);
    margin: 0;
}

/* Empty State */
.bpp-empty-state {
    background: var(--bpp-secondary);
    border-radius: var(--bpp-radius-lg);
    padding: 60px 40px;
    text-align: center;
}

.bpp-empty-state svg {
    color: var(--bpp-primary);
    margin-bottom: 20px;
    opacity: 0.6;
}

.bpp-empty-state h4 {
    font-family: var(--bpp-font-heading);
    font-size: 22px;
    color: var(--bpp-text);
    margin: 0 0 8px 0;
}

.bpp-empty-state p {
    color: var(--bpp-text-muted);
    margin: 0 0 24px 0;
}

/* Posts List */
.bpp-posts-list {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.bpp-post-card {
    display: flex;
    background: var(--bpp-white);
    border-radius: var(--bpp-radius-lg);
    box-shadow: var(--bpp-shadow);
    overflow: hidden;
    transition: var(--bpp-transition);
}

.bpp-post-card:hover {
    box-shadow: var(--bpp-shadow-lg);
    transform: translateY(-2px);
}

.bpp-post-image {
    width: 200px;
    flex-shrink: 0;
    background: var(--bpp-secondary);
}

.bpp-post-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    min-height: 160px;
}

.bpp-post-no-image {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
    min-height: 160px;
    color: var(--bpp-text-muted);
}

.bpp-post-content {
    padding: 24px;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.bpp-post-meta {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 8px;
}

.bpp-post-status {
    display: inline-block;
    padding: 4px 10px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-radius: 3px;
}

.bpp-post-status.status-draft {
    background: #F5F5F5;
    color: #757575;
}

.bpp-post-status.status-pending {
    background: #FFF3E0;
    color: #E65100;
}

.bpp-post-status.status-approved {
    background: #E8F5E9;
    color: #2E7D32;
}

.bpp-post-status.status-rejected {
    background: #FFEBEE;
    color: #C62828;
}

.bpp-post-status.status-published {
    background: #E3F2FD;
    color: #1565C0;
}

.bpp-post-date {
    font-size: 13px;
    color: var(--bpp-text-muted);
}

.bpp-post-title {
    font-family: var(--bpp-font-heading);
    font-size: 18px;
    color: var(--bpp-text);
    margin: 0 0 8px 0;
    line-height: 1.3;
}

.bpp-post-excerpt {
    font-size: 14px;
    color: var(--bpp-text-light);
    margin: 0;
    flex: 1;
}

.bpp-post-feedback {
    margin-top: 12px;
    padding: 12px;
    background: #FFF3E0;
    border-radius: var(--bpp-radius);
    font-size: 13px;
    color: #E65100;
}

.bpp-post-actions {
    display: flex;
    gap: 16px;
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid var(--bpp-border-light);
}

.bpp-link-button {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 14px;
    color: var(--bpp-primary);
    background: none;
    border: none;
    cursor: pointer;
    text-decoration: none;
    transition: var(--bpp-transition);
}

.bpp-link-button:hover {
    color: var(--bpp-primary-hover);
}

.bpp-link-button.bpp-delete-draft {
    color: var(--bpp-text-muted);
}

.bpp-link-button.bpp-delete-draft:hover {
    color: var(--bpp-error);
}

/* WordPress Editor Overrides */
.bpp-form .wp-editor-area {
    font-family: var(--bpp-font);
    font-size: 16px;
    line-height: 1.7;
    padding: 20px;
}

.bpp-form .wp-editor-container {
    border: 1px solid var(--bpp-border);
    border-radius: var(--bpp-radius);
    overflow: hidden;
}

.bpp-form .wp-editor-tabs {
    padding: 0 8px;
}

.bpp-form .mce-toolbar-grp {
    border-bottom: 1px solid var(--bpp-border);
}

/* General Messages */
.bpp-message {
    padding: 24px;
    border-radius: var(--bpp-radius-lg);
    text-align: center;
}

.bpp-message h3 {
    font-family: var(--bpp-font-heading);
    color: var(--bpp-primary);
    margin: 0 0 12px 0;
}

.bpp-message p {
    margin: 0 0 20px 0;
    color: var(--bpp-text);
}

.bpp-message-info {
    background: var(--bpp-secondary);
    border: 1px solid var(--bpp-border);
}

.bpp-message-error {
    background: #FFEBEE;
    border: 1px solid var(--bpp-error);
}

/* Author Box Styles */
.bpp-author-box {
    display: flex;
    align-items: center;
    gap: 12px;
}

.bpp-author-box-small {
    gap: 8px;
}

.bpp-author-box-large {
    gap: 16px;
    padding: 24px;
    background: var(--bpp-secondary);
    border-radius: var(--bpp-radius-lg);
}

.bpp-author-image img {
    border-radius: 50%;
    object-fit: cover;
}

.bpp-author-info {
    display: flex;
    flex-direction: column;
}

.bpp-author-name {
    font-weight: 600;
    color: var(--bpp-text);
    font-size: 15px;
}

.bpp-author-title {
    font-size: 13px;
    color: var(--bpp-primary);
    font-style: italic;
}

/* Post Author in Cards */
.bpp-post-author {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid var(--bpp-border-light);
}

.bpp-post-author-image {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    object-fit: cover;
}

.bpp-post-author-details {
    display: flex;
    flex-direction: column;
}

.bpp-post-author-name {
    font-size: 13px;
    font-weight: 600;
    color: var(--bpp-text);
    line-height: 1.2;
}

.bpp-post-author-title {
    font-size: 11px;
    color: var(--bpp-primary);
    font-style: italic;
    line-height: 1.2;
}

/* Large Author Box for Published Posts */
.bpp-author-box-featured {
    display: flex;
    align-items: center;
    gap: 20px;
    padding: 24px;
    background: var(--bpp-secondary);
    border-radius: var(--bpp-radius-lg);
    margin-top: 32px;
}

.bpp-author-box-featured .bpp-author-image img {
    width: 80px;
    height: 80px;
}

.bpp-author-box-featured .bpp-author-name {
    font-family: var(--bpp-font-heading);
    font-size: 18px;
    color: var(--bpp-primary);
}

.bpp-author-box-featured .bpp-author-title {
    font-size: 14px;
    margin-top: 2px;
}

.bpp-author-box-featured .bpp-author-bio {
    font-size: 14px;
    color: var(--bpp-text-light);
    margin-top: 8px;
    line-height: 1.5;
}

/* Responsive */
@media (max-width: 768px) {
    .bpp-submission-wrapper,
    .bpp-user-posts-wrapper {
        padding: 20px 16px;
    }
    
    .bpp-form {
        padding: 24px 20px;
    }
    
    .bpp-form-actions {
        flex-direction: column;
    }
    
    .bpp-button {
        width: 100%;
    }
    
    .bpp-user-stats {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .bpp-posts-header {
        flex-direction: column;
        gap: 16px;
        align-items: stretch;
        text-align: center;
    }
    
    .bpp-post-card {
        flex-direction: column;
    }
    
    .bpp-post-image {
        width: 100%;
        height: 200px;
    }
    
    .bpp-social-options {
        flex-direction: column;
    }
}
