/* 
 * Sync Status CSS
 * Formatting for sync status module in the plugin
 */

/* Cloud icon for synchronized files */
.leopard-served-by-provider .attachment-preview::after {
  content: '';
  position: absolute;
  background: url('../../images/cloud-icon.svg') no-repeat;
  width: 24px;
  height: 24px;
  z-index: 90;
  right: 5%;
  top: 80%;
}

/* Styles related to synchronization */
.current-sync-process, .leopard-sync-notice-title {
  color: #000;
}

.leopard-sync-notice .current-sync-process, .leopard-sync-notice-title {
  color: #fff;
}

.leopard-sync-notice a {
  color: #FF0000;
  padding-left: 15px;
}

.leopard-sync-notice {
  background: #565c70 !important;
  position: relative;
}

.leopard-sync-notice .leopard-sync-notice-title {
  display: inline-block;
}

.leopard-sync-notice .leopard-sync-notice-wrap {
  padding: 10px;
}

.leopard-sync-notice .progress-bar {
  width: 60%;
}

.leopard-sync-notice .spin_loading {
  margin-left: 10px;
  width: 9px;
  height: 9px;
}

.leopard-sync-notice::after {
  content: '';
  z-index: -1;
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border-radius: 3px;
  box-shadow: inset 0 -10px 20px -10px rgba(0,0,0,.2),inset 0 0 5px rgba(0,0,0,.1),0 8px 8px -5px rgba(0,0,0,.25);
}

.leopard-sync-notice .progress_count {
  padding-right: 10px;
}

#leopard-wordpress-offload-media-wrap .spin_loading {
  margin-right: 10px;
}

.col-right .card .spin_loading {
  border: 3px solid #3333331c;
  border-top-color: #333;
}

.col-right .card .progress-bar .progress {
  background: #016087;
}

/* Progress count styling */
.iziToast .progress_count,
.leopard-sync-notice .progress_count,
.progress-details .progress_count {
  display: inline-block;
  padding: 3px 8px;
  font-size: 12px;
  font-weight: 600;
  color: #ffffff;
  background-color: rgba(0, 0, 0, 0.5);
  border-radius: 10px;
  margin-left: 5px;
  text-shadow: 0 1px 1px rgba(0, 0, 0, 0.2);
}

/* Override for legacy progress count styles */
.progress_count:not(.iziToast .progress_count):not(.leopard-sync-notice .progress_count):not(.progress-details .progress_count) {
  display: inline-block;
  padding-left: 7px;
  font-size: 11px;
  font-weight: 700;
}

.leopard-sync-notice #spin_loading, .spin_loading {
  border: 3px solid #7d7979;
  border-top-color: #fff;
}

/* Sync Status Container Styles */
.sync-status-container {
  display: flex;
  align-items: center;
  margin-bottom: 15px;
  padding-bottom: 10px;
  border-bottom: 1px solid rgba(255,255,255,0.1);
}

.sync-status-icon {
  margin-right: 15px;
}

.sync-status-info {
  flex: 1;
}

.sync-operation-name {
  font-weight: bold;
  margin-bottom: 5px;
  font-size: 14px;
}

.sync-status-message {
  font-size: 12px;
  color: rgba(255,255,255,0.7);
}

.file-status-container {
  margin-top: 20px;
  border: 1px solid #ccc;
  border-radius: 4px;
  padding: 10px;
  max-height: 400px;
  overflow-y: auto;
  background: #f9f9f9;
}

.file-status-container h3 {
  margin-top: 0;
}

.current-file-container {
  margin-bottom: 10px;
  padding: 8px;
  border-left: 4px solid #ffba00;
  background: #fff8e5;
}

#current-processing-file {
  word-break: break-all;
  font-family: monospace;
  display: block;
  margin-top: 5px;
  padding: 4px 8px;
  background: #f5f5f5;
  border-radius: 2px;
}

.file-status-summary {
  margin-bottom: 10px;
  display: flex;
  gap: 20px;
}

.status-count.success-count {
  background: #eaffee;
  padding: 8px 12px;
  border-radius: 4px;
  border-left: 3px solid #46b450;
}

.status-count.failed-count {
  background: #fbeaea;
  padding: 8px 12px;
  border-radius: 4px;
  border-left: 3px solid #dc3232;
}

.status-count.success-rate {
  background: #f0f6fc;
  padding: 8px 12px;
  border-radius: 4px;
  border-left: 3px solid #2271b1;
}

#file-status-list {
  background: white;
  border: 1px solid #e0e0e0;
  border-radius: 2px;
  min-height: 50px;
}

/* Enhanced Sync Styles */
.notice.notice-warning {
  margin: 15px 0;
}

.enhanced-sync-menu-item {
  color: #00b9eb;
}

.enhanced-sync-tab {
  background-color: #f0f6fc;
  color: #2271b1;
  font-weight: bold;
  border-bottom-color: #f0f6fc;
}

/* Synchronization Analytics Styles */
.analytics-dashboard-section {
  margin: 30px 0;
  background: #fff;
  border-radius: 5px;
  padding: 20px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.analytics-dashboard-section h2 {
  margin-top: 0;
  padding-bottom: 10px;
  border-bottom: 1px solid #eee;
  color: #23282d;
  font-size: 1.3em;
}

.analytics-cards {
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
  margin-bottom: 20px;
  width: 100%;
  justify-content: space-between;
}

.analytics-card {
  flex: 0 0 calc(50% - 10px);
  max-width: calc(50% - 10px);
  width: calc(50% - 10px);
  background: #f9f9f9;
  border-radius: 5px;
  padding: 15px;
  box-shadow: 0 1px 2px rgba(0,0,0,0.05);
  box-sizing: border-box;
}

@media (max-width: 768px) {
  .analytics-card {
    flex: 0 0 100%;
    max-width: 100%;
    width: 100%;
    margin-bottom: 15px;
  }
}

.analytics-card h3 {
  margin-top: 0;
  margin-bottom: 15px;
  font-size: 16px;
  color: #2271b1;
  border-bottom: 1px solid #eee;
  padding-bottom: 10px;
}

.chart-container {
  position: relative;
  height: 250px;
}

#debug_output {
  display: none;
  margin-top: 15px;
  padding: 10px;
  background: #f0f0f0;
  border: 1px solid #ddd;
  font-family: monospace;
  max-height: 200px;
  overflow: auto;
}

#debug_toggle {
  margin-bottom: 15px;
}

.description {
  margin-left: 10px;
}

#paused_sync_operations {
  display: none;
}

#sync_progress_section {
  display: none;
  margin: 30px 0;
  background: #fff;
  border-radius: 5px;
  padding: 20px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.progress-container {
  margin: 20px 0;
}

.progress-bar {
  height: 20px;
  background-color: #f0f0f0;
  border-radius: 10px;
  overflow: hidden;
  margin-bottom: 5px;
}

.progress-inner {
  height: 100%;
  background-color: #2271b1;
  border-radius: 10px;
  transition: width 0.3s ease;
  width: 0%;
}

.progress-info {
  font-size: 14px;
  color: #666;
}

.performance-metrics {
  display: flex;
  flex-wrap: wrap;
  gap: 15px;
  margin: 15px 0;
  background: #f0f7fc;
  padding: 15px;
  border-radius: 5px;
  border-left: 4px solid #2271b1;
}

.performance-metric {
  flex: 1 1 calc(33.333% - 15px);
  min-width: 150px;
}

.metric-label {
  font-weight: bold;
  margin-bottom: 5px;
  color: #2271b1;
}

.metric-value {
  font-size: 18px;
}

.sync-control-buttons {
  margin: 20px 0;
  display: flex;
  gap: 10px;
}

#resume_sync {
  display: none;
}

#sync_summary {
  display: none;
  margin: 30px 0;
  background: #fff;
  border-radius: 5px;
  padding: 20px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.summary-section h3 {
  margin-top: 0;
  padding-bottom: 10px;
  border-bottom: 1px solid #eee;
  color: #23282d;
  font-size: 1.3em;
}

.status-summary {
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
  margin-top: 15px;
}

.status-item {
  background: #f9f9f9;
  padding: 15px;
  border-radius: 5px;
  min-width: 150px;
  flex: 1;
  box-shadow: 0 1px 2px rgba(0,0,0,0.05);
}

.status-label {
  font-weight: bold;
  margin-bottom: 5px;
  color: #23282d;
}

.status-value {
  font-size: 24px;
  color: #2271b1;
}

#file_status_container {
  display: none;
  margin: 30px 0;
  background: #fff;
  border-radius: 5px;
  padding: 20px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.file-status-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 15px;
  padding-bottom: 10px;
  border-bottom: 1px solid #eee;
}

.file-status-actions {
  display: flex;
  gap: 10px;
}

.file-status-actions .button {
  display: flex;
  align-items: center;
}

.file-status-actions .dashicons {
  margin-right: 5px;
}

.file-status-list {
  max-height: 400px;
  overflow-y: auto;
  border: 1px solid #ddd;
  border-radius: 5px;
  background: #fff;
}

.file-status-item {
  display: flex;
  padding: 10px 15px;
  border-bottom: 1px solid #eee;
}

.file-status-item:last-child {
  border-bottom: none;
}

.file-status-item.success {
  border-left: 4px solid #00a32a;
}

.file-status-item.failed {
  border-left: 4px solid #d63638;
}

.file-status-item.in-progress {
  border-left: 4px solid #f0c33c;
  background-color: #fffdf7;
}

.file-status-icon {
  width: 24px;
  height: 24px;
  text-align: center;
  margin-right: 10px;
  font-weight: bold;
  font-size: 16px;
  line-height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background-color: #f0f0f0;
}

.file-status-item.success .file-status-icon,
[data-status="completed"],
.file-status-item.success [data-status="completed"] {
  color: #fff !important;
  background-color: #00a32a !important;
}

.file-status-item.failed .file-status-icon {
  color: #fff;
  background-color: #d63638;
}

.file-status-item.in-progress .file-status-icon {
  color: #000;
  background-color: #f0c33c;
}

.file-status-details {
  flex: 1;
}

.file-status-name {
  font-weight: bold;
  margin-bottom: 3px;
}

.file-status-meta {
  display: flex;
  font-size: 12px;
  color: #666;
  gap: 10px;
}

.empty-status-message {
  padding: 20px;
  text-align: center;
  color: #666;
  font-style: italic;
}

/* Enhanced Sync System Styles */
.enhanced-sync-container {
  background-color: #fff;
  box-shadow: 0 1px 1px rgba(0,0,0,.04);
  border: 1px solid #c3c4c7;
  padding: 20px;
  margin-top: 20px;
  border-radius: 3px;
}

.enhanced-sync-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
  padding-bottom: 15px;
  border-bottom: 1px solid #f0f0f0;
}

.enhanced-sync-title {
  font-size: 20px;
  font-weight: 600;
  color: #1d2327;
}

.enhanced-sync-actions {
  display: flex;
  gap: 10px;
}

.enhanced-sync-description {
  background-color: #f0f7fc;
  border-left: 4px solid #00a0d2;
  padding: 15px;
  margin-bottom: 20px;
}

.leopard-enhanced-sync-container {
  max-width: 1200px;
  margin: 20px 0;
}

.leopard-enhanced-sync-intro {
  margin-bottom: 20px;
}

.leopard-enhanced-sync-notice {
  margin-top: 30px !important;
}

.paused-operations-section {
  margin: 20px 0;
}

/* Date Range Filter Styles */
#leopard_served_date_range {
  position: absolute !important;
  left: 25%;
  box-shadow: 0 1px 1px rgba(0,0,0,.04);
  border: 1px solid #c3c4c7;
  padding: 10px;
  background-color: #c3c4c7;
  display: none;
}

#posts-filter > div.wp-filter > div.filter-items > div.actions {
  position:relative;
}

#leopard_served_date_range {
  position: absolute !important;
  left: 25%;
  box-shadow: 0 1px 1px rgba(0,0,0,.04);
  border: 1px solid #c3c4c7;
  padding: 10px;
  background-color: #c3c4c7;
}

#LeopardDateRangeToggleToast .iziToast-buttons {
  display: block !important;
}

#media-attachment-cloud-filter-date-range-from, #media-attachment-cloud-filter-date-range-to {
  display: none !important;
}

.estimated-time {
  font-style: italic;
  color: #ffffff;
  font-weight: 500;
  background-color: rgba(0, 0, 0, 0.5);
  padding: 3px 8px;
  border-radius: 10px;
  display: inline-block;
  text-shadow: 0 1px 1px rgba(0, 0, 0, 0.2);
}

/* Hide WebP rebuild option - can be removed when needed */
.sync-operation-card[data-operation="build_webp_version"] {
  display: none;
}