
/* Settings not set warning */
.avir-fbp-warning.settings-required {
    background-color: #fff8e5;
    border-left: 4px solid #ffb900;
    padding: 12px 15px;
    margin-bottom: 15px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.avir-fbp-warning.settings-required p {
    margin: 0;
}

.avir-fbp-warning.settings-required .button {
    display: inline-block;
    margin-top: 5px;
}

/* Posted Notice */
.avir-fbp-posting-notice {
    margin: 15px 0;
    padding: 10px;
    background: #f5f5f5;
    border-left: 4px solid #0073aa;
}
.avir-fbp-posting-notice p {
    margin: 0;
    font-size: 14px;
}

/* Meta Box Styles */
#avir_fbp_share_box { 
	background-color: #E6F6FF;
	border-radius:10px;
}
#avir_fbp_share_box .inside { 
    padding: 2px 12px 4px 12px; 
}

/* Make notices inside meta box */
#avir_fbp_share_box .notice {
    margin: 10px 0;
    padding: 8px 12px;
}

.avir-fbp-status-display {
    padding: 8px;
    margin-bottom: 12px;
    border-radius: 4px;
    background: #f5f5f5;
}

.avir-fbp-status-display.published {
    background: #e8f5e9;
    border-left: 4px solid #4caf50;
}

.avir-fbp-status-display.not-published {
    background: #ffebee;
    border-left: 4px solid #f44336;
}


#avir_fbp_facebook_editor h3,
#avir_fbp_instagram_editor h3 {
	margin-top: 0.2em;
	margin-bottom: 0;
}
#avir_fbp_facebook_editor,
#avir_fbp_instagram_editor {
	border: 1px solid #0073aa;
	border-radius: 4px;
	margin-top: 10px;
	padding: 0px 10px;
	padding-bottom: 10px;
}
#avir_fbp_facebook_editor {
	background: #DCF3FF;
}
#avir_fbp_instagram_editor {
	background: #FFDADA;
}
.avir-fbp-labels {
  display:block;
  font-size: 1.1em;
  color: #555;
  font-weight: 600;
  letter-spacing: 0.5px;
  padding-top: 5px;
  padding-bottom: 1px;
  margin-top: 0.2em;
  margin-bottom: 0.2em;
}

.avir-fbp-status-display a {
    text-decoration: none;
    color: #1877f2;
}

.avir-fbp-status-display a:hover {
    text-decoration: underline;
}

#avir_fbp_excerpt_editor {
    background: #f9f9f9;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
}

#avir_fbp_custom_excerpt,
#avir_fbp_instagram_custom_excerpt {
    white-space: pre-wrap;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
    line-height: 1.4;
}

.avir-fbp-info-box { 
    background: #FFFDED; 
    border: 1px dotted #999;
    padding: 10px; 
    margin-top: 8px; 
    border-radius: 4px; 
    overflow: auto; 
}

.avir-fbp-checkbox {
    margin-top: 8px; 
}

.avir-fbp-toggle {
    margin-top: 8px; 
    margin-bottom: 8px; 
    font-weight:500;
}

.avir-fbp-cb-label {
    margin-top: 0; 
    display:block!important;
    cursor:pointer;
}

.avir-fbp-image-preview {
    margin-top: 10px; 
    border: 0px dotted #999;
	border-radius: 4px; 
    padding: 0px; 
	text-align:center;
}
.avir-fbp-warning { 
    background: #FFD47F; 
    border: 1px dotted #999;
    padding: 15px; 
    margin-top: 8px; 
    border-radius: 4px; 
    overflow: auto; 
}

.avir-fbp-warning.yellow { 
    background: #FBF983; 
    border: 2px dotted #999;
}

.avir-fbp-feat_subtitles {
    margin-top: 14px;
    margin-bottom: 4px;
    font-weight:600;
}

/* Add to admin.css */
.avir-fbp-sharing-options {
    margin: 15px 0;
}

.avir-fbp-sharing-options label {
    display: block;
    margin-bottom: 8px;
}

/* 
	Modal Window Preview Styling 
*/
.avir-fbp-modal {
    display: none;
    position: fixed;
    z-index: 100000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.7);
}

.avir-fbp-modal-content {
    background-color: #333;
    margin: 5% auto;
    padding: 14px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.3);
    border: 3px solid #666;
    border-radius: 3px;
    width: 80%;
    max-width: 600px;
    border-radius: 20px;
    max-height: 90vh; /* Limit height to 90% of viewport height */
    display: flex;
    flex-direction: column;
    position: relative; /* Ensure proper stacking context */
}

/* Modal header styling */
.avir-fbp-modal-header {
  position: relative;
  padding: 0px 5px 2px 0px;
  margin-bottom: 10px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  box-sizing: border-box;
}

.avir-fbp-modal-header h3 {
    margin: 0;
    padding: 0;
	color:#CECECE;
    font-size: 18px;
    line-height: 1.4;
    font-weight: 600;
    flex-grow: 1;
}

.avir-fbp-modal-close {
  font-size: 24px;
  font-weight: bold;
  cursor: pointer;
  color: #DDD;
  line-height: 1;
  transition: color 0.2s ease;
  margin-top: -25px;
}

.avir-fbp-modal-close:hover {
    color: #d63638;
}

.avir-fbp-preview-container {
    overflow-y: auto; /* Enable scrolling for the preview content */
    margin-bottom: 0px;
    padding: 15px;
    background: #FFFFFF;
    border: 2px solid #666;
    border-radius: 15px;
    max-height: calc(80vh - 120px); /* Adjust based on header/footer height */
}

.avir-fbp-preview-content {
	font-size:1.2em;
    white-space: pre-wrap;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
    line-height: 1.5;
}
/* Image preview styling */
.avir-fbp-preview-image {
    text-align: center;
    margin: 15px auto;
    max-width: 100%;
}

.avir-fbp-preview-image img {
    max-width: 600px;
    width: 100%;
    height: auto;
    border: 1px solid #ddd;
	border-radius: 10px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.5);
    display: block;
    margin: 0 auto;
}

/* Ensure the preview container can handle the image */
.avir-fbp-preview-container {
    margin-bottom: 20px;
    padding: 15px;
    background: #FFFFFF;
    border: 2px solid #666;
    border-radius: 15px;
}
.avir-fbp-preview-actions {
    text-align:right;
}


/* Spinner animation */
.avir-fbp-spinner {
    display: inline-block;
    vertical-align: middle;
    margin-right: 8px;
    border: 2px solid rgba(0, 115, 170, 0.2);
    border-top-color: #0073aa;
    border-radius: 50%;
    width: 16px;
    height: 16px;
    animation: avir-fbp-spin 1s linear infinite;
}

@keyframes avir-fbp-spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Posting status container */
.avir-fbp-posting-status {
    margin: 10px 0;
}

.avir-fbp-posting-notice {
    background-color: #f0f6fc;
    border-left: 4px solid #0073aa;
    padding: 8px 12px;
    margin-bottom: 10px;
}

/* Posting notice styling */
.avir-fbp-posting-notice {
    background-color: #e6f6fb;
    border-left: 4px solid #00a0d2;
    padding: 8px 12px;
    margin-bottom: 10px;
    position: relative;
}

/* Success and error notices */
.avir-fbp-meta-box-notice {
    margin: 10px 0;
    padding: 8px 12px;
    border-left: 4px solid #46b450;
    background: #f7fff7;
}

.avir-fbp-meta-box-notice.error {
    border-left-color: #dc3232;
    background: #fef7f7;
}


/* Improve counter display */
.avir-fbp-count-display {
    text-align: right;
    margin: 5px 0;
    font-size: 12px;
    color: #666;
    background: rgba(255, 255, 255, 0.7);
    padding: 3px 8px;
    border-radius: 3px;
    display: inline-block;
    float: right;
}

.avir-fbp-over-limit {
    color: #d63638 !important;
    font-weight: bold !important;
}

.avir-fbp-approaching-limit {
    color: #b26200 !important;
    font-weight: bold;
}

.avir-fbp-limit-exceeded {
    border-color: #d63638 !important; 
    box-shadow: 0 0 0 1px #d63638;
    animation: avir-fbp-limitFlash 0.8s ease;
}

.avir-fbp-limit-warning {
    color: #d63638;
    font-size: 12px;
    margin-top: 5px;
    font-style: italic;
    animation: avir-fbp-LimCounterFadeIn 0.3s ease;
}

@keyframes avir-fbp-limitFlash {
    0%, 100% { border-color: #d63638; }
    50% { border-color: #ffab00; }
}

@keyframes avir-fbp-LimCounterFadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* Improve textarea appearance */
#avir_fbp_custom_excerpt,
#avir_fbp_instagram_custom_excerpt {
    white-space: pre-wrap;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
    line-height: 1.4;
    padding: 8px;
    transition: border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
}



/* Posts and Pages List Column */
.fixed .column-facebook_posted,
.fixed .column-instagram_posted {
    width: 60px!important;
    text-align: center;
}
/* Apply to both post and page list screens */
.post-type-post .column-facebook_posted .dashicons,
.post-type-post .column-instagram_posted .dashicons,
.post-type-page .column-facebook_posted .dashicons,
.post-type-page .column-instagram_posted .dashicons {
    font-size: 22px!important;
    height: 22px;
    width: 22px;
}
.avir-fbp-status {
    cursor: pointer;
    display: inline-block;
}
.avir-fbp-status.loading {
    opacity: 0.5;
    pointer-events: none;
}

.avir-fbp-link-image-wrapper {
    transition: all 0.3s ease;
}

.avir-fbp-field-group label {
    display: block;
    margin-top: 4px;
	margin-bottom: 5px;
}




/* Settings Page */
.fap-debug-info { 
    margin-top: 30px; 
    padding: 20px; 
    background: #f5f5f5; 
    border-radius: 4px; 
}

.fap-debug-info pre { 
    background: white; 
    padding: 15px; 
    border-radius: 4px; 
    overflow: auto; 
}



/* Status displays */
.avir-fbp-status-container {
    margin-bottom: 15px;
    padding: 0px;
    background: #f5f5f5;
	border: 0px solid #999;
    border-radius: 3px;
}
.avir-fbp-status-container {
    transition: background-color 0.5s ease;
}


.avir-fbp-status-display {
    margin-top: 4px;
    margin-bottom: 4px;
    padding: 5px;
    border-radius: 3px;
}

.avir-fbp-status-display.published {
    background: #D0EDD03;
    border-left: 4px solid #46b450;
}

.avir-fbp-status-display.not-published {
    background: #f7f7f7;
    border-left: 3px solid #ddd;
}

.avir-fbp-warning.yellow {
    background: #fff8e5;
    border-left: 4px solid #ffb900;
    padding: 10px;
    margin-bottom: 15px;
}


/* Test API connection */
#avir-fbp-connection-results pre {
    white-space: pre-wrap; /* Ensure preformatted text wraps */
}
#avir-fbp-connection-results.loading {
    position: relative;
    min-height: 50px; /* Ensure there's enough space for the spinner */
    text-align: center; /* Center the spinner horizontally */
}

#avir-fbp-connection-results.loading:before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 30px;
    height: 30px;
    border: 3px solid rgba(0, 0, 0, 0.1);
    border-top: 3px solid #0073aa; /* WordPress admin color */
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: translate(-50%, -50%) rotate(0deg); }
    100% { transform: translate(-50%, -50%) rotate(360deg); }
}

#avir-fbp-connection-results pre {
    white-space: pre-wrap; /* Ensure preformatted text wraps */
}



/* Cards-style settings*/
/* General card styling */
.avir-fbp-card {
    background-color: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    margin-bottom: 20px;
    padding: 20px;
    border-top: 4px solid #333;
}
.avir-fbp-card.post-editor {
    margin-bottom: 20px;
    padding: 8px;
    border-top: 4px solid #333;
}

/* Facebook card styling */
.avir-fbp-card.facebook {
    background-color: #E9F0FF; /* Pastel blue */
    border-top-color: #1877F2; /* Facebook blue */
}

/* Instagram card styling */
.avir-fbp-card.instagram {
    background-color: #FFEEF5; /* Pastel pink */
    border-top-color: #E1306C; /* Instagram gradient color */
}

/* Card header styling */
.avir-fbp-card h2 {
    margin-top: 0;
    padding-bottom: 10px;
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
    font-size: 18px;
    font-weight: 600;
}

/* Facebook icon */
.avir-fbp-card.facebook h2:before {
    content: "\f305"; /* Facebook icon from Dashicons */
    font-family: dashicons;
    margin-right: 8px;
    color: #1877F2;
    vertical-align: middle;
}

/* Instagram icon */
.avir-fbp-card.instagram h2:before {
    content: "\f12d"; /* Instagram icon from Dashicons */
    font-family: dashicons;
    margin-right: 8px;
    color: #E1306C;
    vertical-align: middle;
}

/* Form elements inside cards */
.avir-fbp-card .form-table {
    margin-top: 15px;
}

.avir-fbp-card .form-table th {
    padding-left: 0;
}

/* Description text */
.avir-fbp-card p.description {
    font-style: italic;
    color: #666;
}

/* Submit button styling */
.avir-fbp-card + p.submit {
    margin-top: 20px;
    padding-top: 15px;
}

/* Fix for the Post Content radio buttons */
/* Improve spacing between form elements */
.form-table td {
    padding: 15px 10px;
}

/* Style section headings inside cards */
.avir-fbp-card h2:first-child {
    margin-top: 0;
    margin-bottom: 10px;
}

/* Hide duplicate section headings */
.avir-fbp-card h2 + p + h2,
.avir-fbp-card h2 + p + h2 + p {
    display: none;
}

/* Make the settings page more responsive */
@media screen and (max-width: 782px) {
    .avir-fbp-card {
        padding: 15px;
    }
    
    .avir-fbp-card .form-table th {
        padding-bottom: 5px;
    }
    
    .avir-fbp-card .form-table td {
        padding-left: 0;
    }
}

/* Test Connection button styling */
#avir-fbp-test-connection {
    margin-bottom: 15px;
}

/* Connection results styling */
#avir-fbp-connection-results {
    margin-top: 15px;
    background: #f5f5f5;
    border-radius: 4px;
    padding: 10px;
}

#avir-fbp-connection-results pre {
    white-space: pre-wrap;
    overflow-x: auto;
    margin: 0;
}

/* Loading indicator for test connection */
#avir-fbp-connection-results.loading {
    position: relative;
    min-height: 50px;
    text-align: center;
}

#avir-fbp-connection-results.loading:before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 30px;
    height: 30px;
    border: 3px solid rgba(0, 0, 0, 0.1);
    border-top: 3px solid #0073aa;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: translate(-50%, -50%) rotate(0deg); }
    100% { transform: translate(-50%, -50%) rotate(360deg); }
}


/* Meta box status display styling */
.avir-fbp-status-display {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    position: relative;
    padding: 8px 30px 8px 8px;
    margin-bottom: 8px;
    border-radius: 4px;
}

.avir-fbp-status-content {
    flex-grow: 1;
    padding-right: 5px;
}

.avir-fbp-status-text {
    margin-left: 4px;
}

.avir-fbp-time-ago {
    font-size: 0.9em;
    color: #666;
    margin-top: 2px;
    margin-left: 8px;
}

.avir-fbp-meta-toggle {
    position: absolute;
    right: 8px;
    top: 8px;
    cursor: pointer;
    transition: transform 0.2s ease;
}

.avir-fbp-meta-toggle:hover {
    transform: scale(1.2);
}

.avir-fbp-meta-toggle .dashicons {
    font-size: 18px !important;
    width: 18px;
    height: 18px;
    line-height: 1;
}

.avir-fbp-meta-toggle.loading {
    opacity: 0.5;
    pointer-events: none;
}

/* Status colors */
.avir-fbp-status-display.published {
    background: #e8f5e9;
    border-left: 4px solid #4caf50;
}

.avir-fbp-status-display.not-published {
    background: #f5f5f5;
    border-left: 4px solid #ddd;
}

/* Facebook API Setup Guide Styling */
.avir-fbp-setup-guide {
    margin-top: 30px;
    padding: 20px;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.avir-fbp-setup-guide h2 {
    margin-top: 0;
    padding-bottom: 10px;
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
    font-size: 20px;
    font-weight: 600;
}

.avir-fbp-notice {
    background-color: #e7f3ff;
    border-left: 4px solid #2196F3;
    padding: 12px 15px;
    margin: 15px 0;
    font-size: 14px;
}

.avir-fbp-setup-section {
    margin-bottom: 25px;
    padding-bottom: 15px;
    border-bottom: 1px solid #f0f0f0;
}

.avir-fbp-setup-section h3 {
    margin-top: 0;
    margin-bottom: 15px;
    font-size: 16px;
    font-weight: 600;
    color: #1877F2; /* Facebook blue */
}

.avir-fbp-setup-section ol,
.avir-fbp-setup-section ul {
    margin-left: 20px;
    margin-bottom: 15px;
}

.avir-fbp-setup-section li {
    margin-bottom: 8px;
    line-height: 1.5;
}

.avir-fbp-setup-section ul li {
    list-style-type: disc;
}

.avir-fbp-tip {
    background-color: #e8f5e9;
    border-left: 4px solid #4caf50;
    padding: 12px 15px;
    margin: 15px 0;
    font-size: 14px;
}

.avir-fbp-warning {
    background-color: #fff8e5;
    border-left: 4px solid #ffb900;
    padding: 12px 15px;
    margin: 15px 0;
    font-size: 14px;
}

.avir-fbp-setup-section a {
    color: #1877F2;
    text-decoration: none;
}

.avir-fbp-setup-section a:hover {
    text-decoration: underline;
}

.avir-fbp-setup-section strong {
    font-weight: 600;
}


