/**
 * All of the CSS for your admin-specific functionality should be
 * included in this file.
 */

/* Compatibility Page Styles */
.metasync-compatibility-sections {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

.metasync-compatibility-section {
    background: var(--dashboard-card-bg, #fff);
    border: 1px solid #e1e1e1;
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    transition: box-shadow 0.3s ease;
}

.metasync-compatibility-section:hover {
    box-shadow: 0 4px 8px rgba(0,0,0,0.15);
}

.metasync-compatibility-section h3 {
    margin-top: 0;
    margin-bottom: 15px;
    color: var(--dashboard-accent, #3b82f6) !important;
    font-size: 18px;
    font-weight: 600;
    border-bottom: 2px solid #e1e1e1;
    padding-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.metasync-plugin-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 0;
    border-bottom: 1px solid #f5f5f5;
    transition: background-color 0.2s ease;
}

.metasync-plugin-info {
    display: flex;
    align-items: center;
    gap: 12px;
    flex: 1;
}

.metasync-plugin-logo {
    width: 32px;
    height: 32px;
    border-radius: 6px;
    object-fit: contain;
    background: #f8f9fa;
    padding: 4px;
    border: 1px solid #e1e1e1;
}

/* Handle broken images gracefully */
.metasync-plugin-logo:not([src]),
.metasync-plugin-logo[src=""],
.metasync-plugin-logo[src*="error"] {
    display: none;
}

/* Show placeholder when no logo */
.metasync-plugin-info:not(:has(.metasync-plugin-logo[src]))::before {
    content: "🔧";
    width: 32px;
    height: 32px;
    border-radius: 6px;
    background: #f8f9fa;
    padding: 4px;
    border: 1px solid #e1e1e1;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    margin-right: 12px;
}

.metasync-plugin-details {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.metasync-plugin-name {
    font-weight: 500;
    color: var(--dashboard-text-primary, #ffffff) !important;
    font-size: 14px;
    margin: 0;
}

.metasync-plugin-install-status {
    font-size: 11px;
    color: #666;
    font-weight: 400;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.metasync-plugin-install-status.installed {
    color: #28a745;
}

.metasync-plugin-install-status.not-installed {
    color: #dc3545;
}

/* New Status Labels System */
.metasync-plugin-status-labels {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-top: 6px;
    flex-wrap: wrap;
}

.metasync-status-label {
    display: inline-flex;
    align-items: center;
    padding: 3px 10px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    line-height: 1.4;
    transition: all 0.2s ease;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

/* Installed Label - Blue Theme */
.metasync-label-installed {
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
    color: #ffffff;
    border: 1px solid #2563eb;
}

/* Active Label - Green Theme */
.metasync-label-active {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: #ffffff;
    border: 1px solid #059669;
}

/* Not Active Label - Orange/Amber Theme */
.metasync-label-not-active {
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
    color: #ffffff;
    border: 1px solid #d97706;
}

/* Not Installed Label - Gray Theme */
.metasync-label-not-installed {
    background: linear-gradient(135deg, #6b7280 0%, #4b5563 100%);
    color: #ffffff;
    border: 1px solid #4b5563;
}

.metasync-plugin-item:last-child {
    border-bottom: none;
}

.metasync-plugin-item:hover {
    background-color: rgba(0,0,0,0.02);
    border-radius: 4px;
    margin: 0 -8px;
    padding-left: 8px;
    padding-right: 8px;
}


.metasync-plugin-status {
    display: flex;
    align-items: center;
    gap: 8px;
}

.metasync-status-badge {
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.metasync-status-supported {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.metasync-status-coming-soon {
    background: #fff3cd;
    color: #856404;
    border: 1px solid #ffeaa7;
}

.metasync-status-not-installed {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.metasync-plugin-version {
    font-size: 12px;
    color: #666;
    background: #f8f9fa;
    padding: 2px 6px;
    border-radius: 3px;
    font-family: monospace;
}

/* Responsive Design */
@media (max-width: 768px) {
    .metasync-compatibility-sections {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .metasync-compatibility-section {
        padding: 15px;
    }
    
    .metasync-plugin-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }
    
    .metasync-plugin-status {
        align-self: flex-end;
    }
}

/* Google Index API Button Styling */
.button.button-link-delete:hover {
    color: #ffffff !important;
    background: #dc3545 !important;
    border-color: #dc3545 !important;
}

/* Dark Mode Support */
@media (prefers-color-scheme: dark) {
    .metasync-compatibility-section {
        background: var(--dashboard-card-bg, #1a1f26);
        border-color: var(--dashboard-border, #374151);
        color: var(--dashboard-text-primary, #ffffff);
    }
    
    .metasync-compatibility-section h3 {
        color: var(--dashboard-accent, #3b82f6) !important;
        border-bottom-color: var(--dashboard-border, #374151);
    }
    
    .metasync-plugin-name {
        color: var(--dashboard-text-primary, #ffffff) !important;
    }
    
    .metasync-plugin-item {
        border-bottom-color: var(--dashboard-border, #374151);
    }
    
    .metasync-plugin-item:hover {
        background-color: var(--dashboard-card-hover, #222831);
    }
    
    .metasync-plugin-version {
        background: var(--dashboard-border, #374151);
        color: var(--dashboard-text-secondary, #9ca3af);
    }

    /* Dark Mode - Status Labels */
    .metasync-label-installed {
        background: linear-gradient(135deg, #2563eb 0%, #1e40af 100%);
        border-color: #1e3a8a;
        box-shadow: 0 2px 4px rgba(37, 99, 235, 0.3);
    }

    .metasync-label-active {
        background: linear-gradient(135deg, #059669 0%, #047857 100%);
        border-color: #065f46;
        box-shadow: 0 2px 4px rgba(5, 150, 105, 0.3);
    }

    .metasync-label-not-active {
        background: linear-gradient(135deg, #d97706 0%, #b45309 100%);
        border-color: #92400e;
        box-shadow: 0 2px 4px rgba(217, 119, 6, 0.3);
    }

    .metasync-label-not-installed {
        background: linear-gradient(135deg, #4b5563 0%, #374151 100%);
        border-color: #1f2937;
        box-shadow: 0 2px 4px rgba(75, 85, 99, 0.3);
    }

    .description {
        color: var(--dashboard-text-secondary, #9ca3af);
    }
}

/* Search Atlas Connect Styles
   Handles 1-click connect UI for retrieving Search Atlas API key and Otto UUID.
   Does NOT provide WordPress login functionality. */
.metasync-sa-connect-container {
    background: #fff;
    border: 1px solid #ccd0d4;
    border-radius: 6px;
    padding: 20px;
    margin-top: 15px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

/* Prevent dashboard loading conflicts on connect elements */
.metasync-sa-connect-container .no-loading,
#connect-searchatlas-btn.no-loading,
#reset-searchatlas-auth.no-loading,
.metasync-sa-connect-btn.no-loading,
.metasync-sa-connect-protected {
    position: relative;
}

.metasync-sa-connect-container .no-loading::after,
#connect-searchatlas-btn.no-loading::after,
#reset-searchatlas-auth.no-loading::after,
.metasync-sa-connect-btn.no-loading::after,
.metasync-sa-connect-protected::after,
#connect-searchatlas-btn.dashboard-loading::after {
    display: none !important; /* Override any dashboard loading CSS */
}

/* Override dashboard loading on connect button */
#connect-searchatlas-btn.dashboard-loading {
    opacity: 1 !important;
    pointer-events: auto !important;
    position: relative !important;
}

/* Prevent dashboard.js from disabling connect buttons */
.metasync-sa-connect-protected:disabled {
    opacity: 0.7 !important;
    pointer-events: auto !important;
}

.metasync-sa-connect-title {
    font-size: 16px;
    font-weight: 600;
    color: #23282d;
    margin: 0 0 15px 0;
    display: flex;
    align-items: center;
    gap: 8px;
}

.metasync-sa-connect-description {
    color: #646970;
    margin-bottom: 20px;
    font-size: 14px;
    line-height: 1.5;
}

#connect-searchatlas-btn {
    position: relative;
    background: linear-gradient(135deg, #0073aa 0%, #005177 100%);
    color: #fff;
    border: none;
    padding: 12px 24px;
    border-radius: 6px;
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-width: 180px;
    justify-content: center;
}

#connect-searchatlas-btn:hover:not(:disabled) {
    background: linear-gradient(135deg, #005177 0%, #003d56 100%);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0,115,170,0.3);
}

#connect-searchatlas-btn:disabled {
    opacity: 0.7;
    cursor: not-allowed;
    transform: none;
}

.metasync-sa-connect-loading {
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid #ffffff40;
    border-top: 2px solid #ffffff;
    border-radius: 50%;
    animation: metasync-spin 1s linear infinite;
    vertical-align: middle;
    margin-right: 6px;
    position: static; /* Keep in normal document flow */
}

@keyframes metasync-spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.metasync-sa-connect-progress {
    margin-top: 15px;
    padding: 15px;
    background: #f8f9fa;
    border-left: 4px solid #0073aa;
    border-radius: 0 4px 4px 0;
    display: none;
}

.metasync-sa-connect-progress-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
    font-size: 14px;
}

.metasync-sa-connect-progress-time {
    color: #646970;
    font-size: 12px;
    font-weight: normal;
}

.metasync-sa-connect-progress-text {
    margin-top: 8px;
    color: #646970;
    font-size: 13px;
    font-style: italic;
}

.metasync-sa-connect-progress-bar {
    width: 100%;
    height: 6px;
    background: #e1e1e1;
    border-radius: 3px;
    overflow: hidden;
    margin: 10px 0;
}

.metasync-sa-connect-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #0073aa 0%, #005177 100%);
    width: 0%;
    transition: width 0.3s ease;
    border-radius: 3px;
}

.metasync-sa-connect-status {
    margin-top: 15px;
    padding: 12px 16px;
    border-radius: 6px;
    display: none;
    font-weight: 500;
    /* Removed metasync-slideIn animation - was too distracting */
}

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

.metasync-sa-connect-status.success {
    background: #d4edda;
    border: 1px solid #c3e6cb;
    color: #155724;
}

.metasync-sa-connect-status.error {
    background: #f8d7da;
    border: 1px solid #f5c6cb;
    color: #721c24;
}

.metasync-sa-connect-status.info {
    background: #d1ecf1;
    border: 1px solid #bee5eb;
    color: #0c5460;
}

.metasync-sa-connect-status.warning {
    background: #fff3cd;
    border: 1px solid #ffeaa7;
    color: #856404;
}

.metasync-sa-connect-status-content {
    margin-bottom: 10px;
}

.metasync-sa-connect-status-title {
    font-weight: 600;
    font-size: 15px;
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.metasync-sa-connect-status-message {
    font-size: 14px;
    line-height: 1.4;
    opacity: 0.9;
}

.metasync-sa-connect-icon {
    display: inline-block;
    margin-right: 8px;
    font-size: 16px;
}

/* Enhanced visual feedback */
.metasync-sa-connect-container:hover {
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
    transition: box-shadow 0.3s ease;
}

.metasync-sa-connect-success-animation {
    animation: metasync-successPulse 0.6s ease-out;
}

@keyframes metasync-successPulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.02); }
    100% { transform: scale(1); }
}

/* Tooltip styles for help text */
.metasync-tooltip {
    position: relative;
    display: inline-block;
    cursor: help;
    color: #0073aa;
}

.metasync-tooltip::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    background: #23282d;
    color: #fff;
    padding: 6px 10px;
    border-radius: 4px;
    font-size: 12px;
    white-space: nowrap;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    z-index: 1000;
}

.metasync-tooltip:hover::after {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) translateY(-5px);
}

.metasync-sa-connect-buttons {
    display: flex;
    gap: 12px;
    align-items: center;
    flex-wrap: wrap;
    margin-bottom: 15px;
}

.metasync-sa-reset-btn {
    background: #dc3545;
    color: #fff;
    border: 1px solid #dc3545;
    padding: 10px 18px;
    border-radius: 5px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.metasync-sa-reset-btn:hover:not(:disabled) {
    background: #c82333;
    border-color: #c82333;
    transform: translateY(-1px);
    box-shadow: 0 3px 8px rgba(220,53,69,0.3);
}

.metasync-sa-reset-btn:disabled {
    opacity: 0.7;
    cursor: not-allowed;
    transform: none;
}

.metasync-sa-connect-actions {
    margin-top: 15px;
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.metasync-sa-connect-btn {
    padding: 8px 16px;
    border-radius: 4px;
    font-size: 13px;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.metasync-sa-connect-btn.primary {
    background: #0073aa;
    color: #fff;
    border: 1px solid #0073aa;
}

.metasync-sa-connect-btn.secondary {
    background: #f1f1f1;
    color: #50575e;
    border: 1px solid #ccd0d4;
}

.metasync-sa-connect-btn:hover {
    transform: translateY(-1px);
}

.metasync-pulse {
    animation: metasync-pulse 2s ease-in-out infinite;
}

@keyframes metasync-pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.7; }
}

/* Enhanced Progress Bar Animations */
.metasync-sa-connect-progress-fill {
    position: relative;
    overflow: hidden;
}

.metasync-sa-connect-progress-fill::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    bottom: 0;
    right: 0;
    background-image: linear-gradient(
        -45deg,
        rgba(255, 255, 255, 0.2) 25%,
        transparent 25%,
        transparent 50%,
        rgba(255, 255, 255, 0.2) 50%,
        rgba(255, 255, 255, 0.2) 75%,
        transparent 75%,
        transparent
    );
    background-size: 20px 20px;
    animation: metasync-progressStripes 1s linear infinite;
}

@keyframes metasync-progressStripes {
    0% { background-position: 0 0; }
    100% { background-position: 20px 0; }
}

/* Enhanced button states */
#connect-searchatlas-btn.connecting {
    background: linear-gradient(135deg, #f39c12 0%, #e67e22 100%);
}

#connect-searchatlas-btn.authenticating {
    background: linear-gradient(135deg, #3498db 0%, #2980b9 100%);
}

#connect-searchatlas-btn.success {
    background: linear-gradient(135deg, #27ae60 0%, #229954 100%);
}

/* Mobile Responsive Design */
@media (max-width: 768px) {
    .metasync-sa-connect-container {
        padding: 15px;
        margin-top: 10px;
        border-radius: 8px;
    }
    
    .metasync-sa-connect-buttons {
        flex-direction: column;
        gap: 10px;
        align-items: stretch;
    }
    
    #connect-searchatlas-btn {
        width: 100%;
        padding: 15px;
        font-size: 16px;
        touch-action: manipulation; /* Improves tap responsiveness */
        order: 1;
    }
    
    .metasync-sa-reset-btn {
        width: 100%;
        padding: 12px 18px;
        font-size: 14px;
        justify-content: center;
        order: 2;
    }
    
    .metasync-sa-connect-actions {
        flex-direction: column;
        gap: 8px;
    }
    
    .metasync-sa-connect-btn {
        justify-content: center;
        padding: 12px 16px;
        font-size: 14px;
    }
    
    .metasync-sa-connect-progress {
        padding: 12px;
    }
    
    .metasync-sa-connect-progress-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 5px;
    }
    
    .metasync-sa-connect-status {
        padding: 15px;
        margin-top: 12px;
    }
    
    .metasync-sa-connect-status-title {
        font-size: 16px;
    }
    
    /* Improve touch targets on mobile */
    .metasync-sa-connect-btn, .metasync-sa-reset-btn {
        min-height: 44px;
    }
    
    /* Mobile Header Optimizations */
    .metasync-header {
        flex-direction: column;
        gap: 15px;
        text-align: center;
    }
    
    .metasync-header-actions {
        flex-direction: column;
        gap: 10px;
        width: 100%;
    }
    
    .metasync-dashboard-btn {
        width: 100%;
        justify-content: center;
        padding: 12px 20px;
        font-size: 16px;
    }
    
    .metasync-integration-status {
        justify-content: center;
    }
}

/* Tablet optimizations */
@media (min-width: 769px) and (max-width: 1024px) {
    .metasync-sa-connect-container {
        padding: 18px;
    }
    
    .metasync-sa-connect-actions {
        flex-wrap: wrap;
        justify-content: flex-start;
    }
}

/* Dashboard Button Styling */
.metasync-header-actions {
    display: flex;
    align-items: center;
    gap: 15px;
}

.metasync-dashboard-btn {
    background: linear-gradient(135deg, #0073aa 0%, #005177 100%);
    color: #fff;
    text-decoration: none;
    padding: 10px 18px;
    border-radius: 6px;
    font-weight: 500;
    font-size: 14px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: all 0.3s ease;
    border: none;
    cursor: pointer;
}

.metasync-dashboard-btn:hover,
.metasync-dashboard-btn:focus {
    background: linear-gradient(135deg, #005177 0%, #003d56 100%);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0,115,170,0.3);
    color: #fff;
    text-decoration: none;
}

.metasync-integration-status {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    padding: 8px 12px;
    border-radius: 5px;
    font-weight: 500;
}

.metasync-integration-status.integrated {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.metasync-integration-status.not-integrated {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.metasync-integration-status.warning {
    background: #fff3cd;
    color: #856404;
    border: 1px solid #ffeeba;
}

.metasync-integration-status .status-indicator {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    display: inline-block;
}

.metasync-integration-status.integrated .status-indicator {
    background: #28a745;
}

.metasync-integration-status.not-integrated .status-indicator {
    background: #dc3545;
}

.metasync-integration-status.warning .status-indicator {
    background: #ffb900;
}

/* Header Layout */
.metasync-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding: 20px;
    background: #fff;
    border: 1px solid #ccd0d4;
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.metasync-header-left {
    display: flex;
    align-items: center;
    gap: 15px;
}

.metasync-logo {
    max-height: 40px;
    width: auto;
}

/* Dashboard Iframe Styling */
.metasync-dashboard-iframe-container {
    padding: 0;
    overflow: hidden;
}

.metasync-dashboard-iframe-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 20px 15px 20px;
    border-bottom: 1px solid #e1e1e1;
    background: #f8f9fa;
}

.metasync-dashboard-iframe-header h2 {
    margin: 0;
    color: #23282d;
    font-size: 18px;
}

.metasync-dashboard-controls {
    display: flex;
    gap: 8px;
}

.metasync-dashboard-iframe-wrapper {
    position: relative;
    background: #fff;
    overflow: hidden;
}

/* Iframe wrapper overlay - DISABLED to prevent black subsections */
/* .metasync-dashboard-iframe-wrapper::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, #0073aa 0%, #005177 100%);
    z-index: 1;
} */

#metasync-dashboard-iframe {
    border: none;
    display: block;
    background: #f8f9fa;
    transition: opacity 0.3s ease;
    
    /* Custom scrollbar styling for better design integration */
    scrollbar-width: thin;
    scrollbar-color: #c1c1c1 #f8f9fa;
}

/* WebKit browsers (Chrome, Safari, Edge) scrollbar styling */
#metasync-dashboard-iframe::-webkit-scrollbar {
    width: 12px;
    height: 12px;
}

#metasync-dashboard-iframe::-webkit-scrollbar-track {
    background: #f8f9fa;
    border-radius: 6px;
}

#metasync-dashboard-iframe::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 6px;
    border: 2px solid #f8f9fa;
}

#metasync-dashboard-iframe::-webkit-scrollbar-thumb:hover {
    background: #a8a8a8;
}

#metasync-dashboard-iframe::-webkit-scrollbar-corner {
    background: #f8f9fa;
}

#metasync-dashboard-iframe[src=""] {
    opacity: 0.7;
}

.metasync-dashboard-iframe-footer {
    padding: 10px 20px;
    background: #f8f9fa;
    border-top: 1px solid #e1e1e1;
}

.metasync-dashboard-iframe-footer code {
    background: #e9ecef;
    padding: 2px 6px;
    border-radius: 3px;
    font-size: 12px;
}

/* Loading State for Iframe */
.metasync-dashboard-iframe-loading {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
    z-index: 2;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.metasync-dashboard-iframe-loading .spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #0073aa;
    border-radius: 50%;
    animation: metasync-spin 1s linear infinite;
    margin: 0 auto 15px;
    display: block;
}

.metasync-dashboard-iframe-loading p {
    margin: 0;
    color: #666;
    font-size: 14px;
    text-align: center;
}

/* Mobile Iframe Optimizations */
@media (max-width: 768px) {
    .metasync-dashboard-iframe-header {
        flex-direction: column;
        gap: 15px;
        align-items: stretch;
        text-align: center;
    }
    
    .metasync-dashboard-controls {
        justify-content: center;
        flex-wrap: wrap;
    }
    
    #metasync-dashboard-iframe {
        height: 600px; /* Shorter on mobile */
    }
    
    .metasync-dashboard-iframe-footer {
        text-align: center;
    }
}

/* Accessibility Improvements */
.metasync-sa-connect-status:focus {
    outline: 2px solid #005177;
    outline-offset: 2px;
}

.screen-reader-text {
    clip: rect(1px, 1px, 1px, 1px);
    position: absolute !important;
    height: 1px;
    width: 1px;
    overflow: hidden;
}

/* Legacy styles maintained for backward compatibility */
.table {
    border: 0px;
    margin: 0px;
}

.table td {
    text-align: center;
    border-bottom: 1px solid gray;
    padding: 3px;
}

.description {
    color: #666;
    font-size: 13px;
    line-height: 1.5;
}

.descriptionValue {
    color: green;
    padding: 2px;
}

.bold {
    font-weight: 600;
}

.wide-text {
    width: 100%;
}
.pl {
    padding-left: 30px;
}
.pr {
    padding-right: 30px;
}
.pt {
    padding-top: 30px;
}
.result-wrapper {
    background-color: white;
    text-align: center;
    padding: 20px;
}
.green-text-color {
    color: green;
}

.red-text-color {
    color: red;
}

.checkbox-list li {
    padding-bottom: 30px;
}

.input-length {
    width: 20%;
}

.add-form-table {
    width: 70%;
    background-color: white;
}

.add-form-table tr th {
    padding-left: 10px;
}

#source_urls {
    padding: 0px;
    margin: 0px;
}

#add-redirection-form {
    display: none;
}
.hide {
    display: none;
}
.show {
    display: block;
}
.code-box {
    background-color: black !important;
    color: gray  !important;
    width: 100%;
}
.dashicons-searchatlas {
    background-image: url('data:image/svg+xml;base64, ');
    background-size: 50%;
    background-repeat: no-repeat;
    background-position: center;
}

/* XML Sitemap Styles */
.metasync-sitemap-container {
    max-width: 1200px;
    margin: 0 auto;
}

.metasync-sitemap-status-card,
.metasync-sitemap-warning-card,
.metasync-sitemap-actions-card,
.metasync-sitemap-preview-card,
.metasync-sitemap-info-card {
    margin-bottom: 20px;
}

.metasync-sitemap-status-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 20px;
}

.metasync-sitemap-stat {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 15px;
    background: var(--dashboard-card-bg, #f8f9fa);
    border: 1px solid var(--dashboard-border, #e1e1e1);
    border-radius: 8px;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.metasync-sitemap-stat:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.metasync-sitemap-stat .stat-icon {
    font-size: 32px;
    line-height: 1;
}

.metasync-sitemap-stat .stat-content {
    flex: 1;
}

.metasync-sitemap-stat .stat-label {
    font-size: 12px;
    color: var(--dashboard-text-secondary, #666);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 5px;
    font-weight: 600;
}

.metasync-sitemap-stat .stat-value {
    font-size: 24px;
    font-weight: 700;
    color: var(--dashboard-text-primary, #23282d);
}

.metasync-sitemap-stat .stat-value.stat-value-small {
    font-size: 14px;
}

.metasync-sitemap-stat .stat-value.status-active {
    color: #28a745;
}

.metasync-sitemap-stat .stat-value.status-inactive {
    color: #dc3545;
}

.metasync-sitemap-url-box {
    padding: 15px;
    background: var(--dashboard-card-bg, #f0f6ff);
    border: 1px solid var(--dashboard-accent, #3b82f6);
    border-radius: 6px;
    margin-top: 20px;
}

.metasync-sitemap-url-box strong {
    display: block;
    margin-bottom: 8px;
    color: var(--dashboard-text-primary, #23282d);
}

.metasync-sitemap-link {
    color: var(--dashboard-accent, #0073aa);
    text-decoration: none;
    font-weight: 500;
    word-break: break-all;
}

.metasync-sitemap-link:hover {
    text-decoration: underline;
}

.metasync-sitemap-link .dashicons {
    font-size: 14px;
    vertical-align: middle;
}

.metasync-sitemap-info-notice {
    background: #e7f3ff;
    border-left: 4px solid #0073aa;
}

.metasync-info-notice-content {
    display: flex;
    align-items: flex-start;
    gap: 15px;
}

.metasync-info-notice-content .dashicons {
    flex-shrink: 0;
    margin-top: 2px;
}

.metasync-sitemap-actions-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
}

.metasync-sitemap-action-form {
    text-align: center;
}

.metasync-sitemap-button-large {
    width: 100%;
    min-height: 60px;
    font-size: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.metasync-sitemap-button-large .dashicons {
    font-size: 20px;
}

.metasync-button-description {
    margin-top: 10px;
    font-size: 13px;
    color: var(--dashboard-text-secondary, #666);
    font-style: italic;
}

.button-warning {
    background: #ff9800;
    border-color: #f57c00;
    color: #fff;
}

.button-warning:hover,
.button-warning:focus {
    background: #f57c00;
    border-color: #e65100;
    color: #fff;
}

.metasync-sitemap-preview-container {
    background: var(--dashboard-card-bg, #f8f9fa);
    border: 1px solid var(--dashboard-border, #e1e1e1);
    border-radius: 8px;
    overflow: hidden;
}

.metasync-sitemap-preview-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 15px;
    background: var(--dashboard-border, #e9ecef);
    border-bottom: 1px solid var(--dashboard-border, #dee2e6);
}

.metasync-preview-label {
    font-family: monospace;
    font-weight: 600;
    color: var(--dashboard-text-primary, #23282d);
}

.metasync-sitemap-code-block {
    max-height: 400px;
    overflow: auto;
}

.metasync-sitemap-code-block pre {
    margin: 0;
    padding: 20px;
    background: var(--dashboard-card-bg, #f8f9fa);
    font-family: 'SF Mono', Monaco, 'Cascadia Code', 'Roboto Mono', Consolas, monospace;
    font-size: 13px;
    line-height: 1.6;
    color: var(--dashboard-text-primary, #23282d);
    white-space: pre-wrap;
    word-wrap: break-word;
}

.metasync-info-section {
    margin-bottom: 20px;
}

.metasync-info-section h3 {
    color: var(--dashboard-accent, #3b82f6);
    font-size: 16px;
    margin-bottom: 10px;
}

.metasync-info-section p {
    color: var(--dashboard-text-secondary, #666);
    line-height: 1.6;
    margin-bottom: 10px;
}

.metasync-submit-list {
    list-style: none;
    padding: 0;
}

.metasync-submit-list li {
    padding: 8px 0;
    color: var(--dashboard-text-secondary, #666);
}

.metasync-submit-list li strong {
    color: var(--dashboard-text-primary, #23282d);
}

.metasync-submit-list code {
    background: var(--dashboard-border, #e9ecef);
    padding: 2px 6px;
    border-radius: 3px;
    font-size: 12px;
    color: var(--dashboard-accent, #0073aa);
}

.metasync-inline-form {
    margin-top: 15px;
}

@media (max-width: 768px) {
    .metasync-sitemap-status-grid {
        grid-template-columns: 1fr;
    }

    .metasync-sitemap-actions-grid {
        grid-template-columns: 1fr;
    }

    .metasync-sitemap-stat .stat-value {
        font-size: 20px;
    }
}

/* Sitemap Files Table */
.metasync-sitemap-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 15px;
    background: var(--dashboard-card-bg);
    border-radius: 8px;
    overflow: hidden;
}

.metasync-sitemap-table th {
    background: var(--dashboard-card-header-bg, rgba(255,255,255,0.05));
    color: var(--dashboard-text-primary);
    padding: 12px 15px;
    text-align: left;
    font-weight: 600;
    border-bottom: 1px solid var(--dashboard-border-color);
}

.metasync-sitemap-table td {
    padding: 12px 15px;
    color: var(--dashboard-text-primary);
    border-bottom: 1px solid var(--dashboard-border-color);
}

.metasync-sitemap-table tbody tr:hover {
    background: var(--dashboard-card-header-bg, rgba(255,255,255,0.03));
}

.metasync-sitemap-table tbody tr:last-child td {
    border-bottom: none;
}

.metasync-sitemap-table .sitemap-filename {
    font-weight: 600;
    color: var(--dashboard-text-primary);
}

.metasync-sitemap-table .sitemap-url-range {
    font-size: 12px;
    color: var(--dashboard-text-secondary);
    margin-top: 4px;
}

.metasync-sitemap-table .button-view {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 6px 12px;
    background: var(--dashboard-accent-color, #6366f1);
    color: #fff;
    border: none;
    border-radius: 6px;
    font-size: 13px;
    text-decoration: none;
    transition: background 0.2s ease;
}

.metasync-sitemap-table .button-view:hover {
    background: var(--dashboard-accent-hover, #4f46e5);
    color: #fff;
}

.metasync-sitemap-table .button-view .dashicons {
    font-size: 14px;
    width: 14px;
    height: 14px;
}

@media (max-width: 768px) {
    .metasync-sitemap-table th,
    .metasync-sitemap-table td {
        padding: 10px 12px;
        font-size: 13px;
    }
}

/* ================================================
   Content Genius User Role Sync Selector
   ================================================ */

.metasync-role-selector-container {
    display: block;
    max-width: 600px;
    max-height: 250px;
    overflow-y: auto;
    overflow-x: hidden;
    border: 1px solid #ddd;
    border-radius: 6px;
    padding: 15px;
    background: transparent;
    margin-bottom: 10px;
}

/* Scrollbar styling for webkit browsers */
.metasync-role-selector-container::-webkit-scrollbar {
    width: 8px;
}

.metasync-role-selector-container::-webkit-scrollbar-track {
    background: var(--dashboard-border, #f1f1f1);
    border-radius: 4px;
}

.metasync-role-selector-container::-webkit-scrollbar-thumb {
    background: var(--dashboard-text-secondary, #999);
    border-radius: 4px;
    transition: background 0.3s ease;
}

.metasync-role-selector-container::-webkit-scrollbar-thumb:hover {
    background: var(--dashboard-text-primary, #666);
}

/* All Roles Option */
.metasync-role-option-all {
    display: block;
    width: 100%;
    padding: 10px;
    background: transparent;
    border: none;
    cursor: pointer;
    border-radius: 4px;
    transition: background-color 0.2s ease;
}

.metasync-role-option-all:hover {
    background-color: rgba(0, 0, 0, 0.05);
}

.metasync-role-option-all input[type="checkbox"] {
    margin: 0 8px 0 0;
    vertical-align: middle;
}

.metasync-role-option-all strong {
    vertical-align: middle;
    color: var(--dashboard-text-primary, #23282d);
    font-weight: 600;
    font-size: 14px;
}

/* Divider */
.metasync-role-divider {
    margin: 15px 0;
    border: 0;
    border-top: 1px solid var(--dashboard-border, #ddd);
}

/* Individual Role Options */
.metasync-role-option {
    display: block;
    width: 100%;
    margin-bottom: 8px;
    padding: 8px 10px;
    cursor: pointer;
    background: transparent;
    border: none;
    border-radius: 4px;
    transition: background-color 0.2s ease;
}

.metasync-role-option:hover {
    background-color: rgba(0, 0, 0, 0.05);
}

.metasync-role-option:last-child {
    margin-bottom: 0;
}

.metasync-role-option input[type="checkbox"] {
    margin: 0 8px 0 0;
    vertical-align: middle;
}

.metasync-role-label {
    color: var(--dashboard-text-primary, #23282d);
    font-size: 14px;
    vertical-align: middle;
    cursor: pointer;
}


/* Responsive adjustments */
@media (max-width: 768px) {
    .metasync-role-selector-container {
        max-height: 200px;
        padding: 12px;
    }

    .metasync-role-option-all,
    .metasync-role-option {
        padding: 6px 8px;
    }

    .metasync-role-label,
    .metasync-role-option-all strong {
        font-size: 13px;
    }
}

/* Dark Mode Support for Role Selector */
@media (prefers-color-scheme: dark) {
    .metasync-role-selector-container {
        border-color: var(--dashboard-border, #374151);
    }

    .metasync-role-label,
    .metasync-role-option-all strong {
        color: var(--dashboard-text-primary, #ffffff);
    }

    .metasync-role-divider {
        border-top-color: var(--dashboard-border, #374151);
    }

    .metasync-role-option:hover,
    .metasync-role-option-all:hover {
        background-color: var(--dashboard-card-hover, rgba(255, 255, 255, 0.05));
    }
}

/* HTML-Converted Pages Badge */
.metasync-html-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 10px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #ffffff;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    cursor: help;
    transition: all 0.2s ease;
    box-shadow: 0 2px 4px rgba(102, 126, 234, 0.2);
}

.metasync-html-badge:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(102, 126, 234, 0.3);
}

.metasync-badge-icon {
    font-size: 13px;
    line-height: 1;
    animation: pulse 2s ease-in-out infinite;
}

.metasync-badge-text {
    line-height: 1;
}

@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.7;
    }
}

/* Responsive adjustments for badge */
@media (max-width: 782px) {
    .metasync-html-badge {
        font-size: 10px;
        padding: 3px 8px;
        gap: 3px;
    }

    .metasync-badge-icon {
        font-size: 12px;
    }
}

/* Dark mode support for badge */
@media (prefers-color-scheme: dark) {
    .metasync-html-badge {
        background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
        box-shadow: 0 2px 4px rgba(102, 126, 234, 0.3);
    }

    .metasync-html-badge:hover {
        box-shadow: 0 4px 8px rgba(102, 126, 234, 0.4);
    }
}

/* Page Editor Notice Banner */
.metasync-editor-notice {
    margin: 15px 0 20px;
    border-left: 4px solid #667eea;
    background: linear-gradient(90deg, rgba(102, 126, 234, 0.05) 0%, rgba(118, 75, 162, 0.02) 100%);
}

.metasync-editor-notice-content {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 8px 12px;
}

.metasync-editor-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 14px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #ffffff;
    border-radius: 14px;
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    white-space: nowrap;
    box-shadow: 0 2px 6px rgba(102, 126, 234, 0.25);
}

.metasync-editor-message {
    margin: 0;
    font-size: 13px;
    line-height: 1.5;
    color: #2c3e50;
}

.metasync-editor-message strong {
    color: #667eea;
}

/* Quick Edit Badge Display */
.metasync-quick-edit-source {
    clear: both;
    padding: 10px 12px;
}

.metasync-quick-edit-source .title {
    display: inline-block;
    min-width: 80px;
    font-weight: 600;
    color: #1d2327;
}

.metasync-quick-edit-badge-container {
    display: inline-block;
    vertical-align: middle;
    margin-left: 8px;
}

.metasync-quick-edit-badge-container em {
    color: #787c82;
    font-size: 12px;
}

/* Dashboard Widget */
.metasync-dashboard-widget {
    margin: -12px;
}

.metasync-widget-stats {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #ffffff;
    padding: 20px;
    text-align: center;
}

.metasync-stat-box {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}

.metasync-stat-number {
    font-size: 48px;
    font-weight: 700;
    line-height: 1;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.metasync-stat-label {
    font-size: 14px;
    font-weight: 500;
    opacity: 0.95;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.metasync-widget-list {
    padding: 16px 20px;
}

.metasync-widget-list h4 {
    margin: 0 0 12px;
    font-size: 14px;
    font-weight: 600;
    color: #1d2327;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.metasync-widget-list ul {
    margin: 0;
    padding: 0;
    list-style: none;
}

.metasync-widget-page-item {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 10px 0;
    border-bottom: 1px solid #f0f0f1;
}

.metasync-widget-page-item:last-child {
    border-bottom: none;
}

.metasync-page-icon {
    font-size: 16px;
    line-height: 1;
    padding-top: 2px;
    opacity: 0.7;
}

.metasync-page-details {
    flex: 1;
    min-width: 0;
}

.metasync-page-title {
    display: block;
    font-weight: 600;
    color: #2271b1;
    text-decoration: none;
    margin-bottom: 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.metasync-page-title:hover {
    color: #135e96;
    text-decoration: underline;
}

.metasync-page-meta {
    display: block;
    font-size: 12px;
    color: #787c82;
}

.metasync-page-meta a {
    color: #787c82;
    text-decoration: none;
}

.metasync-page-meta a:hover {
    color: #2271b1;
}

.metasync-widget-footer {
    padding: 12px 20px;
    background: #f6f7f7;
    border-top: 1px solid #e0e0e0;
    text-align: center;
}

.metasync-widget-footer a {
    color: #667eea;
    text-decoration: none;
    font-weight: 600;
    font-size: 13px;
}

.metasync-widget-footer a:hover {
    color: #764ba2;
    text-decoration: underline;
}

.metasync-dashboard-widget-empty {
    padding: 20px;
    text-align: center;
}

/* Responsive adjustments for editor notice */
@media (max-width: 782px) {
    .metasync-editor-notice-content {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }

    .metasync-editor-badge {
        font-size: 11px;
        padding: 5px 12px;
    }

    .metasync-editor-message {
        font-size: 12px;
    }
}

/* Dark mode support for new elements */
@media (prefers-color-scheme: dark) {
    .metasync-editor-notice {
        background: linear-gradient(90deg, rgba(102, 126, 234, 0.15) 0%, rgba(118, 75, 162, 0.05) 100%);
    }

    .metasync-editor-message {
        color: #e4e4e7;
    }

    .metasync-quick-edit-source .title {
        color: #f0f0f1;
    }

    .metasync-widget-list h4 {
        color: #f0f0f1;
    }

    .metasync-widget-page-item {
        border-bottom-color: #3c434a;
    }

    .metasync-page-title {
        color: #72aee6;
    }

    .metasync-page-title:hover {
        color: #9ecaed;
    }

    .metasync-page-meta,
    .metasync-page-meta a {
        color: #a7aaad;
    }

    .metasync-widget-footer {
        background: #1d2327;
        border-top-color: #3c434a;
    }
}