/* Listmonk Status Indicator */
.listmonk-status-indicator {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 500;
    transition: all 0.3s ease;
    cursor: help;
    margin-left: 8px;
    white-space: nowrap;
}

.listmonk-status-indicator.connected {
    background-color: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.listmonk-status-indicator.error {
    background-color: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
    animation: pulse-error 2s infinite;
}

.listmonk-status-indicator.disabled {
    background-color: #e2e3e5;
    color: #6c757d;
    border: 1px solid #d6d8db;
}

.listmonk-status-indicator.checking {
    background-color: #fff3cd;
    color: #856404;
    border: 1px solid #ffeaa7;
}

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

.status-icon {
    font-size: 14px;
    line-height: 1;
}

.status-text {
    font-size: 12px;
    font-weight: 600;
}

/* Sync Notifications */
.sync-error-notification,
.sync-success-notification {
    position: fixed;
    top: 80px;
    right: 20px;
    max-width: 420px;
    background: white;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.15);
    z-index: 10000;
    animation: slideInRight 0.3s ease;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

.sync-error-notification {
    border: 2px solid #dc3545;
}

.sync-success-notification {
    border: 2px solid #28a745;
}

@keyframes slideInRight {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

.notification-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
    border-radius: 6px 6px 0 0;
    font-size: 14px;
}

.sync-error-notification .notification-header {
    background: #dc3545;
    color: white;
}

.sync-success-notification .notification-header {
    background: #28a745;
    color: white;
}

.notification-body {
    padding: 16px;
}

.notification-body p {
    margin: 8px 0;
    color: #333;
    font-size: 14px;
    line-height: 1.4;
}

.notification-body p:first-child {
    margin-top: 0;
}

.notification-body p:last-child {
    margin-bottom: 0;
}

.notification-body code {
    display: block;
    padding: 10px 12px;
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 4px;
    color: #dc3545;
    font-size: 12px;
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
    margin: 10px 0;
    word-break: break-all;
    line-height: 1.3;
}

.close-btn {
    background: none;
    border: none;
    color: white;
    font-size: 18px;
    cursor: pointer;
    padding: 0;
    width: 24px;
    height: 24px;
    line-height: 1;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.2s ease;
}

.close-btn:hover {
    background-color: rgba(255, 255, 255, 0.2);
}

/* Admin Panel Listmonk Section */
.listmonk-section {
    margin-top: 30px;
}

.listmonk-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 20px;
}

.listmonk-stats,
.listmonk-actions {
    background: white;
    padding: 20px;
    border-radius: 8px;
    border: 1px solid #dee2e6;
}

.listmonk-stats h3,
.listmonk-actions h3 {
    margin-top: 0;
    margin-bottom: 15px;
    color: #333;
    font-size: 16px;
    font-weight: 600;
}

.status-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0;
    border-bottom: 1px solid #f0f0f0;
}

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

.status-row span:first-child {
    font-weight: 500;
    color: #666;
}

.status-row span:last-child {
    font-weight: 600;
}

.status-connected {
    color: #28a745;
}

.status-error {
    color: #dc3545;
}

.status-disabled {
    color: #6c757d;
}

.sync-buttons {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.sync-buttons .btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 16px;
    font-size: 14px;
    font-weight: 500;
    text-align: left;
}

.sync-buttons .btn span:first-child {
    font-size: 16px;
}

.sync-progress {
    background: white;
    padding: 20px;
    border-radius: 8px;
    border: 1px solid #dee2e6;
    margin-top: 20px;
}

.progress-bar-container {
    margin: 15px 0;
}

.progress-bar {
    width: 100%;
    height: 20px;
    background-color: #f0f0f0;
    border-radius: 10px;
    overflow: hidden;
}

.progress-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, #28a745, #20c997);
    border-radius: 10px;
    transition: width 0.3s ease;
    width: 0%;
}

#sync-results {
    margin-top: 15px;
}

.sync-result {
    padding: 10px 15px;
    border-radius: 6px;
    margin-bottom: 10px;
    font-size: 14px;
}

.sync-result.success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.sync-result.error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.sync-result.info {
    background: #d1ecf1;
    color: #0c5460;
    border: 1px solid #bee5eb;
}

/* Mobile responsive */
@media (max-width: 768px) {
    .listmonk-status-indicator {
        font-size: 12px;
        padding: 4px 8px;
        gap: 4px;
    }
    
    .status-text {
        display: none; /* Hide text on mobile */
    }
    
    .sync-error-notification,
    .sync-success-notification {
        left: 10px;
        right: 10px;
        max-width: none;
        top: 60px;
    }
    
    .listmonk-container {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .sync-buttons {
        gap: 8px;
    }
    
    .sync-buttons .btn {
        padding: 12px 16px;
    }
}

@media (max-width: 480px) {
    .listmonk-status-indicator {
        padding: 3px 6px;
    }
    
    .status-icon {
        font-size: 12px;
    }
    
    .notification-body {
        padding: 12px;
    }
    
    .notification-body code {
        font-size: 11px;
        padding: 8px 10px;
    }
}
